修改一下bug
This commit is contained in:
parent
1f4b71362f
commit
36a7b0a771
@ -52,7 +52,6 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
public class FragmentManagement extends BaseActivity {
|
||||
private FragmentManager fragmentManager;
|
||||
private int fourthly_tag;
|
||||
private MineFragment mineFragment;//我的fragment -1
|
||||
private FindFragment findFragment;//发现的fragment -2
|
||||
private RecordFragment recordFragment;//纪录的fragment -3
|
||||
@ -97,7 +96,7 @@ public class FragmentManagement extends BaseActivity {
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
fourthly_tag = getIntent().getIntExtra("tag", 0);
|
||||
int fourthly_tag = getIntent().getIntExtra("tag", 0);
|
||||
fragmentManager = getSupportFragmentManager();
|
||||
if (fourthly_tag != 0) {
|
||||
selectorFragment(fourthly_tag);
|
||||
|
@ -252,5 +252,4 @@ public class GuidanceActivity extends BaseActivity {
|
||||
super.onDestroy();
|
||||
frameLayout.removeAllViews();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,23 +14,13 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.navinfo.outdoor.util.TecentLocationUtils;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@ -26,20 +27,21 @@ public class ImageShowActivity extends BaseActivity implements View.OnClickListe
|
||||
return R.layout.activity_image_show;
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
imgUrl = getIntent().getStringArrayListExtra("info");
|
||||
Log.d("ImageShowActivity", "initData-----------------: "+imgUrl);
|
||||
Log.d("ImageShowActivity", "initData: "+imgUrl);
|
||||
page_number.setText("1" + "/" + imgUrl.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
image_pager = (ViewPager) findViewById(R.id.image_pager);
|
||||
page_number = (TextView) findViewById(R.id.page_number);
|
||||
ImageView download = (ImageView) findViewById(R.id.download);
|
||||
image_pager =findViewById(R.id.image_pager);
|
||||
page_number =findViewById(R.id.page_number);
|
||||
ImageView download =findViewById(R.id.download);
|
||||
download.setOnClickListener(this);
|
||||
initViewPager();
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.navinfo.outdoor.activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
@ -19,6 +20,7 @@ public class LinkActivity extends BaseActivity implements View.OnClickListener {
|
||||
return R.layout.activity_link;
|
||||
}
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
|
@ -1,52 +1,34 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Message;
|
||||
import android.view.Display;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.github.lazylibrary.util.MD5;
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
import com.navinfo.outdoor.bean.LoginOauthTokenBean;
|
||||
import com.navinfo.outdoor.bean.UserBean;
|
||||
import com.navinfo.outdoor.bean.UserDetailBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.Base64;
|
||||
import com.navinfo.outdoor.util.Md5Util;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 登录页
|
||||
*/
|
||||
@ -85,11 +67,12 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CommitPrefEdits")
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
navInfoEditor = getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE).edit();
|
||||
SharedPreferences navInfo = getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE);
|
||||
navInfoEditor = navInfo.edit();
|
||||
TextView tvRegister = findViewById(R.id.tv_register);
|
||||
etLoginName = findViewById(R.id.et_login_name);
|
||||
etLoginPaw = findViewById(R.id.et_login_paw);
|
||||
@ -101,15 +84,13 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
tvStatement.setOnClickListener(this);
|
||||
tvRegister.setOnClickListener(this);
|
||||
tvForgetPaw.setOnClickListener(this);
|
||||
if (navInfo !=null){
|
||||
String user_name = navInfo.getString("user_name", null);
|
||||
if (user_name!=null&&!user_name.equals("")){
|
||||
etLoginName.setText(user_name);
|
||||
}
|
||||
String pass_word = navInfo.getString("pass_word", null);
|
||||
if (pass_word!=null&&!pass_word.equals("")){
|
||||
etLoginPaw.setText(pass_word);
|
||||
}
|
||||
String user_name = navInfo.getString("user_name", null);
|
||||
if (user_name!=null&&!user_name.equals("")){
|
||||
etLoginName.setText(user_name);
|
||||
}
|
||||
String pass_word = navInfo.getString("pass_word", null);
|
||||
if (pass_word!=null&&!pass_word.equals("")){
|
||||
etLoginPaw.setText(pass_word);
|
||||
}
|
||||
|
||||
}
|
||||
@ -144,7 +125,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
}else {
|
||||
initLogIn(name, paw);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case R.id.tv_statement:
|
||||
@ -184,7 +164,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
navInfoEditor.commit();
|
||||
Constant.ACCESS_TOKEN=body.getAccess_token();
|
||||
Constant.REFRESH_TOKEN=body.getRefresh_token();
|
||||
Constant.USERID=body.getUserId();
|
||||
Constant.USHERED =body.getUserId();
|
||||
Constant.PASS_WORD=paw;
|
||||
initGetUserInfo();//获取用户信息
|
||||
} else {
|
||||
@ -227,11 +207,11 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
navInfoEditor.putString("qq",body.getQq());
|
||||
Constant.QQ=body.getQq();
|
||||
navInfoEditor.putString("wechat",body.getWechat());
|
||||
Constant.WECHAT=body.getWechat();
|
||||
Constant.WCHAR =body.getWechat();
|
||||
UserDetailBean.BodyBean.UserBankcardBean userBankcard = body.getUserBankcard();
|
||||
if (userBankcard!=null){//存储银行卡信息
|
||||
navInfoEditor.putString("bankAccount",userBankcard.getBankAccount());//银行卡编号
|
||||
Constant.BANKACCOUNT=userBankcard.getBankAccount();
|
||||
Constant.BACKGROUND =userBankcard.getBankAccount();
|
||||
navInfoEditor.putString("idNumber",userBankcard.getIdNumber());//银行卡账号
|
||||
Constant.ID_NUMBER=userBankcard.getIdNumber();
|
||||
}
|
||||
@ -242,9 +222,9 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
navInfoEditor.putString("idnum",userAuth.getIdnum());//身份证号码
|
||||
Constant.ID_NUM=userAuth.getIdnum();
|
||||
navInfoEditor.putInt("auditstatus",userAuth.getAuditstatus());//审核状态
|
||||
Constant.AUDITSTATUS=userAuth.getAuditstatus();
|
||||
Constant.AUDIOTAPES =userAuth.getAuditstatus();
|
||||
navInfoEditor.putString("auditmsg",userAuth.getAuditmsg());//审核信息
|
||||
Constant.AUDITMSG=userAuth.getAuditmsg();
|
||||
Constant.AUDITING =userAuth.getAuditmsg();
|
||||
}
|
||||
navInfoEditor.commit();
|
||||
int needGuide = body.getNeedGuide();//0不需要 1需要
|
||||
|
@ -56,7 +56,7 @@ public class MainActivity extends BaseActivity {
|
||||
//调用系统安装程序
|
||||
//安装apk,也可以进行静默安装
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
File file = new File(Constant.NAVINFO_APk+"DTXB.apk");
|
||||
File file = new File(Constant.NABISCO_APk +"DTXB.apk");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
Uri contentUri = FileProvider.getUriForFile(MainActivity.this, "com.navinfo.outdoor.fileprovider", file);
|
||||
@ -278,7 +278,7 @@ public class MainActivity extends BaseActivity {
|
||||
con.setRequestMethod("GET");
|
||||
con.connect();
|
||||
if (con.getResponseCode() == 200) {
|
||||
File files = new File(Constant.NAVINFO_APk);
|
||||
File files = new File(Constant.NABISCO_APk);
|
||||
if (!files.exists()){
|
||||
files.mkdir();
|
||||
}
|
||||
@ -288,7 +288,7 @@ public class MainActivity extends BaseActivity {
|
||||
FileOutputStream fileOutputStream = null;
|
||||
if (is != null) {
|
||||
//对apk进行保存
|
||||
File file = new File(Constant.NAVINFO_APk+"DTXB.apk");
|
||||
File file = new File(Constant.NABISCO_APk +"DTXB.apk");
|
||||
fileOutputStream = new FileOutputStream(file);
|
||||
byte[] buf = new byte[1024];
|
||||
int ch;
|
||||
|
@ -4,6 +4,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.graphics.Bitmap;
|
||||
@ -92,10 +93,9 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
private long captureTime = 0;
|
||||
private android.widget.Button btnSwitch;
|
||||
private TencentMap tencentMap;
|
||||
private MyLocationStyle locationStyle;
|
||||
private TextureMapView ivMap;
|
||||
private CheckBox captureVideo; // 拍摄视频
|
||||
private Button btnVideo, stopVideo;
|
||||
private Button btnVideo;
|
||||
|
||||
private String finalVideoPath; // 摄像后最终保存的文件名
|
||||
// private File tmpFile; // 合并文件的临时文件路径
|
||||
@ -130,6 +130,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
});
|
||||
private int videoIndex;
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
EventBus.getDefault().register(this);
|
||||
@ -201,7 +202,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
}
|
||||
});
|
||||
|
||||
stopVideo = findViewById(R.id.btn_stop_video);
|
||||
Button stopVideo = findViewById(R.id.btn_stop_video);
|
||||
stopVideo.setOnClickListener(this);
|
||||
/*
|
||||
* camera.setVideoBitRate(2000000);
|
||||
@ -289,7 +290,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
@Override
|
||||
public void onVideoTaken(@NonNull @NotNull VideoResult result) {
|
||||
super.onVideoTaken(result);
|
||||
/* showLoadingDialog();
|
||||
/* showLoadingDialog();
|
||||
dismissLoadingDialog();*/
|
||||
if (isFinishActivity) {
|
||||
PictureActivity.this.finish();
|
||||
@ -340,7 +341,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
}
|
||||
}).start();*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraError(@NonNull @NotNull CameraException exception) {
|
||||
super.onCameraError(exception);
|
||||
@ -350,10 +350,10 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
@Override
|
||||
public void onVideoRecordingStart() {
|
||||
super.onVideoRecordingStart();
|
||||
/**
|
||||
/*
|
||||
* 获取当前视频的时间,记录csv文件时使用
|
||||
* */
|
||||
// long currentTime = AWMp4ParserHelper.getInstance().getVedasTotalTime(new File(finalVideoPath));
|
||||
// long currentTime = AWMp4ParserHelper.getInstance().getVedasTotalTime(new File(finalVideoPath));
|
||||
timerTask = new CsvTimerTask(new File(finalVideoPath + ".txt"));
|
||||
timer.schedule(timerTask, 0, period * 1000);
|
||||
// // 开始采集,每隔2秒实时记录位置信息、视频时间以及设备时间
|
||||
@ -363,7 +363,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
// timerTask.setCurrentVideoTime(currentTime/1000+1);
|
||||
// timer.schedule(timerTask, 1, period*1000);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -436,14 +435,12 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
Toast.makeText(this, content, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
camera.setMode(Mode.VIDEO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
@ -568,7 +565,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
tencentMap.setLocationSource(new MyTecentLocationSource(this));
|
||||
tencentMap.setMyLocationEnabled(true);
|
||||
|
||||
locationStyle = new MyLocationStyle();
|
||||
MyLocationStyle locationStyle = new MyLocationStyle();
|
||||
locationStyle = locationStyle.myLocationType(type);
|
||||
//创建图标
|
||||
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(getBitMap());
|
||||
|
@ -3,6 +3,7 @@ package com.navinfo.outdoor.activity;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.graphics.Bitmap;
|
||||
@ -82,19 +83,23 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
private Polyline polyline;
|
||||
private String finalVideoPath; // 摄像后最终保存的文件名
|
||||
private ViewGroup layerChange; // 切换地图和相机的父控件
|
||||
private CheckBox capturePicture;//拍照
|
||||
private CheckBox capturePicture,cbMapType;//拍照
|
||||
private boolean isMapSlide = false;
|
||||
private int pageNum=1;//拍了多少张照片
|
||||
private boolean listenerPicture = false;
|
||||
private SimpleDateFormat formatter;
|
||||
private File paperFile;
|
||||
private int type, videoIndex;
|
||||
private ImageView ivZoomAdd, ivZoomDel, ivLocation;
|
||||
private Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
public boolean handleMessage(@NonNull Message msg) {
|
||||
if (msg.what == 0x101 && listenerPicture) {
|
||||
camera.takePicture();
|
||||
} else if (msg.what == 0x102) {
|
||||
} else if (msg.what == 0x102){
|
||||
if (btnSwitch != null) {
|
||||
btnSwitch.setEnabled(true);
|
||||
}
|
||||
} else if (msg.what == 0x103) {
|
||||
} else if (msg.what == 0x103){
|
||||
listenerPicture = false;
|
||||
if (type != 3) {
|
||||
capturePicture.setText("开始采集");
|
||||
@ -104,15 +109,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
return false;
|
||||
}
|
||||
});
|
||||
private boolean listenerPicture = false;
|
||||
private SimpleDateFormat formatter;
|
||||
private File paperFile;
|
||||
private int type;
|
||||
private int videoIndex;
|
||||
private ImageView ivZoomAdd;
|
||||
private ImageView ivZoomDel;
|
||||
private ImageView ivLocation;
|
||||
private CheckBox cbMapType;
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -120,6 +116,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
return R.layout.activity_pictures;
|
||||
}
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
@ -133,30 +130,29 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
File file = new File(finalVideoPath);
|
||||
paperFile = new File(Objects.requireNonNull(file.getParentFile()).getAbsoluteFile() + "/" + "paper.txt");
|
||||
}
|
||||
|
||||
formatter = new SimpleDateFormat("yyyyMMdd HHmmss");
|
||||
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
ivMap = (TextureMapView) findViewById(R.id.iv_map);
|
||||
btnSwitch = (Button) findViewById(R.id.btn_switch);
|
||||
ivMap = findViewById(R.id.iv_map);
|
||||
btnSwitch = findViewById(R.id.btn_switch);
|
||||
btnSwitch.setOnClickListener(this);
|
||||
//相机记录器
|
||||
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
||||
ivZoomAdd = findViewById(R.id.iv_zoom_add);
|
||||
ivZoomAdd =findViewById(R.id.iv_zoom_add);
|
||||
ivZoomAdd.setOnClickListener(this);
|
||||
ivZoomDel = findViewById(R.id.iv_zoom_del);
|
||||
ivZoomDel =findViewById(R.id.iv_zoom_del);
|
||||
ivZoomDel.setOnClickListener(this);
|
||||
cbMapType = findViewById(R.id.cb_map_type);
|
||||
cbMapType =findViewById(R.id.cb_map_type);
|
||||
cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER);
|
||||
}
|
||||
});
|
||||
ivLocation = findViewById(R.id.iv_location);
|
||||
ivLocation =findViewById(R.id.iv_location);
|
||||
ivLocation.setOnClickListener(this);
|
||||
camera = findViewById(R.id.camera);
|
||||
camera =findViewById(R.id.camera);
|
||||
camera.setOnClickListener(this);
|
||||
capturePicture = findViewById(R.id.capture_picture);
|
||||
capturePicture =findViewById(R.id.capture_picture);
|
||||
if (type == 3) {
|
||||
capturePicture.setText("拍摄");
|
||||
} else {
|
||||
@ -179,21 +175,19 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Button stopPicture = findViewById(R.id.btn_stop_picture);
|
||||
Button stopPicture =findViewById(R.id.btn_stop_picture);
|
||||
stopPicture.setOnClickListener(this);
|
||||
//获取地图
|
||||
tencentMap = ivMap.getMap();
|
||||
//获取地图UI 设置对象
|
||||
UiSettings uiSettings = tencentMap.getUiSettings();
|
||||
UiSettings uiSettings =tencentMap.getUiSettings();
|
||||
//设置logo的大小
|
||||
uiSettings.setLogoScale(0.7f);
|
||||
uiSettings.setRotateGesturesEnabled(false);//禁止地图旋转手势.
|
||||
uiSettings.setTiltGesturesEnabled(false);//禁止倾斜手势.
|
||||
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
|
||||
initLine();
|
||||
//相机预览监听
|
||||
camera.addCameraListener(new CameraListener() {
|
||||
camera.addCameraListener(new CameraListener() {//相机预览监听
|
||||
@Override
|
||||
public void onPictureTaken(@NonNull @NotNull PictureResult result) {
|
||||
if (listenerPicture) {
|
||||
@ -214,17 +208,14 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
if (type == 3) {
|
||||
message.what = 0x103;
|
||||
handler.sendMessageDelayed(message, 0);
|
||||
Toast.makeText(PicturesActivity.this, "保存成功:" + pageNum++, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(PicturesActivity.this, "保存成功:" + videoIndex, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
message.what = 0x101;
|
||||
Toast.makeText(PicturesActivity.this, "保存成功" + pageNum++, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(PicturesActivity.this, "保存成功" + videoIndex, Toast.LENGTH_SHORT).show();
|
||||
handler.sendMessageDelayed(message, 2000);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
if (camera.isTakingVideo()) {
|
||||
message("Captured while taking video. Size=" + result.getSize());
|
||||
@ -233,9 +224,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
captureTime = callbackTime - 300;
|
||||
Log.d("captureTime", captureTime + "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//录像监听
|
||||
@Override
|
||||
public void onVideoTaken(@NonNull @NotNull VideoResult result) {
|
||||
@ -254,14 +243,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
super.onVideoRecordingStart();
|
||||
}
|
||||
});
|
||||
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//相机的宽高
|
||||
layoutParamsMap.height = dm.widthPixels / 3;
|
||||
layoutParamsMap.width = dm.heightPixels / 3;
|
||||
ivMap.setLayoutParams(layoutParamsMap);
|
||||
|
||||
}
|
||||
|
||||
private void message(String content) {
|
||||
@ -318,10 +305,9 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
setResult(0x102, intent);
|
||||
finish();
|
||||
break;
|
||||
|
||||
case R.id.btn_switch:
|
||||
v.setEnabled(false);
|
||||
handler.sendEmptyMessageDelayed(0x102, 2000); // 利用handler延迟发送更改状态信息
|
||||
handler.sendEmptyMessageDelayed(0x102, 2000);// 利用handler延迟发送更改状态信息
|
||||
benSwitch();
|
||||
break;
|
||||
case R.id.iv_zoom_add://放大
|
||||
@ -359,7 +345,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
bitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置定位图标样式
|
||||
*/
|
||||
@ -379,7 +364,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
tencentMap.setMyLocationStyle(locationStyle);
|
||||
}
|
||||
|
||||
|
||||
public void benSwitch() {
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
@ -391,7 +375,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
FrameLayout.LayoutParams layoutParamsCamera = (FrameLayout.LayoutParams) camera.getLayoutParams();//相机的宽高
|
||||
int heightCamera = camera.getMeasuredHeight();
|
||||
int widthCamera = camera.getMeasuredWidth();
|
||||
|
||||
layerChange.removeAllViews();
|
||||
if (widthMap > widthCamera) {
|
||||
layoutParamsCamera.width = dm.widthPixels;
|
||||
@ -415,7 +398,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
initMapShort();
|
||||
}
|
||||
}
|
||||
|
||||
//小图
|
||||
private void initMapBig() {
|
||||
isMapSlide = false;
|
||||
@ -425,9 +407,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
ivLocation.setVisibility(View.GONE);
|
||||
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
|
||||
cbMapType.setChecked(false);
|
||||
|
||||
}
|
||||
|
||||
//大图
|
||||
private void initMapShort() {
|
||||
isMapSlide = true;
|
||||
@ -438,13 +418,10 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
camera.open();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -464,14 +441,11 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
if (type != 3) {
|
||||
listenerPicture = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
// stopTakenVideo();
|
||||
camera.destroy();
|
||||
if (polyline != null) {
|
||||
polyline.remove();
|
||||
@ -484,7 +458,6 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@ -492,14 +465,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
if (msg.what == Constant.EVENT_WHAT_LOCATION_CHANGE) { // 用户位置更新
|
||||
if (tencentMap != null && !isMapSlide) {
|
||||
TencentLocation tencentLocation = (TencentLocation) msg.obj;
|
||||
CameraUpdate cameraSigma =
|
||||
CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||
new LatLng(tencentLocation.getLatitude(), tencentLocation.getLongitude()), //中心点坐标,地图目标经纬度
|
||||
tencentMap.getCameraPosition().zoom, //目标缩放级别
|
||||
0, //目标倾斜角
|
||||
tencentLocation.getBearing())); //目标旋转角 0~360° (正北方为0)
|
||||
tencentMap.animateCamera(cameraSigma);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
|
||||
public class TestActivity {
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
@ -14,8 +15,6 @@ import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
@ -23,9 +22,7 @@ import com.google.gson.Gson;
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
@ -33,7 +30,6 @@ import com.navinfo.outdoor.bean.CityBean;
|
||||
import com.navinfo.outdoor.bean.JsonBean;
|
||||
import com.navinfo.outdoor.bean.UserBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.DialogCallback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
||||
@ -43,10 +39,6 @@ import org.json.JSONArray;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static com.tencent.mapsdk.internal.aaa.getContext;
|
||||
|
||||
/**
|
||||
* 用户资料
|
||||
@ -82,12 +74,13 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("CommitPrefEdits")
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
initJsonData();
|
||||
navInfo = getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE);
|
||||
navInfoEditor = getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE).edit();
|
||||
navInfoEditor = navInfo.edit();
|
||||
ivUser = findViewById(R.id.iv_user);
|
||||
ivUser.setOnClickListener(this);
|
||||
btnAttestation = findViewById(R.id.btn_attestations);
|
||||
@ -118,7 +111,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
if (regions!=null){
|
||||
region.setText(regions);
|
||||
}
|
||||
if (Constant.AUDITSTATUS==1){
|
||||
if (Constant.AUDIOTAPES ==1){
|
||||
btnAttestation.setText("已认证");
|
||||
}
|
||||
if (Constant.ID_NUMBER!=null){
|
||||
@ -135,15 +128,15 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
finish();
|
||||
break;
|
||||
case R.id.btn_gathering:
|
||||
if (Constant.AUDITSTATUS==-1){
|
||||
if (Constant.AUDIOTAPES ==-1){
|
||||
Toast.makeText(this, "请先实名认证", Toast.LENGTH_SHORT).show();
|
||||
}else if (Constant.AUDITSTATUS==1){//认证通过
|
||||
}else if (Constant.AUDIOTAPES ==1){//认证通过
|
||||
|
||||
Intent gatheringIntent = new Intent(this, FragmentManagement.class);
|
||||
gatheringIntent.putExtra("tag", 24);
|
||||
startActivity(gatheringIntent);
|
||||
}else if (Constant.AUDITSTATUS==0){
|
||||
Toast.makeText(this, Constant.AUDITMSG+"", Toast.LENGTH_SHORT).show();
|
||||
}else if (Constant.AUDIOTAPES ==0){
|
||||
Toast.makeText(this, Constant.AUDITING +"", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case R.id.btn_attestations:
|
||||
@ -173,13 +166,13 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
userqq = etQq.getText().toString().trim();
|
||||
usermailbox = etMailbox.getText().toString().trim();
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("pid",Constant.USERID);
|
||||
httpParams.put("pid",Constant.USHERED);
|
||||
long time = System.currentTimeMillis();
|
||||
httpParams.put("datetime", time);
|
||||
boolean isQQNum_matcher = userqq.matches("[1-9][0-9]{4,14}");
|
||||
// 邮箱匹配结果
|
||||
boolean isEmail_matcher = usermailbox.matches( "^[\\w-\\+]+(\\.[\\w]+)*@[\\w-]+(\\.[\\w]+)*(\\.[a-z]{2,})$");
|
||||
//userqq.length() < 11 && userqq.length() > 5
|
||||
//user.length() < 11 && user.length() > 5
|
||||
if (TextUtils.isEmpty(userphone) || TextUtils.isEmpty(userqq) || TextUtils.isEmpty(usermailbox)|| TextUtils.isEmpty(region_id)) {
|
||||
if (region_id == null || region_id.equals("")) {
|
||||
Toast.makeText(this, "所在地区为空,请重新输入", Toast.LENGTH_SHORT).show();
|
||||
@ -206,7 +199,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
if (!isEmail_matcher) {
|
||||
Toast.makeText(this, "邮箱格式错误", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
// httpParams.put("qq",userqq); //邮箱
|
||||
httpParams.put("mail",usermailbox); //邮箱
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -30,6 +31,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
return R.layout.activity_web;
|
||||
}
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
@ -77,17 +79,15 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onSuccess: sss********sssssssssssss 失败" + e.getMessage() + "");
|
||||
Log.d("TAG", "onError:失败" + e.getMessage() + "");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.iv_icon:
|
||||
finish();
|
||||
break;
|
||||
if (v.getId() == R.id.iv_icon) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,6 +101,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
return super.shouldOverrideUrlLoading(view, url);
|
||||
}
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
view.getSettings().setJavaScriptEnabled(true);
|
||||
@ -110,6 +111,7 @@ public class WebActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||
view.getSettings().setJavaScriptEnabled(true);
|
||||
|
@ -40,7 +40,7 @@ public class CapacityEvaluationAdapter extends RecyclerView.Adapter<CapacityEval
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.tvCapacity.setText(capacityList.get(position).getTitle());
|
||||
holder.tvResults.setText(capacityList.get(position).getStatus() + "");
|
||||
holder.tvResults.setText((Integer) capacityList.get(position).getStatus());
|
||||
Glide.with(context).load(capacityList.get(position).getIconurl()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(holder.ivCapacity);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -42,7 +42,7 @@ public class CapacityItemAdapter extends RecyclerView.Adapter<CapacityItemAdapte
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.tvCapItem.setText(capItemList.get(position).getTitle());
|
||||
holder.tvReams.setText(capItemList.get(position).getStatus()+"");
|
||||
holder.tvReams.setText((Integer) capItemList.get(position).getStatus());
|
||||
Glide.with(context).load(capItemList.get(position).getIconurl()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(holder.ivCapItem);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@ -51,6 +52,7 @@ public class CapacityMeasureAdapter extends RecyclerView.Adapter<CapacityMeasure
|
||||
return new ViewHolder(inflate);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
final boolean single = measureList.get(position).isSingle();//是否多选
|
||||
@ -116,11 +118,10 @@ public class CapacityMeasureAdapter extends RecyclerView.Adapter<CapacityMeasure
|
||||
TextView tvOptionContent = optionLayer.findViewById(R.id.tv_option_content);
|
||||
|
||||
if (option != null) {
|
||||
if (option.startsWith("http")) {
|
||||
// Glide.with(context).load(option).into(ivOption);
|
||||
} else {
|
||||
if (!option.startsWith("http")) {
|
||||
tvOptionContent.setText(option);
|
||||
}
|
||||
} // Glide.with(context).load(option).into(ivOption);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EventPrefectureAdapter extends RecyclerView.Adapter<EventPrefectureAdapter.ViewHolder> {
|
||||
private List<TaskPrefectureBean.BodyBean.ListBean> dataBeans;
|
||||
private List<TaskPrefectureBean.BodyBean.ListBean> dataBeans;
|
||||
private Context context;
|
||||
|
||||
public EventPrefectureAdapter(List<TaskPrefectureBean.BodyBean.ListBean> dataBeans, Context context) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
@ -39,6 +40,7 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
|
||||
return new ViewHolder(inflate);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
PoiEntity poiEntity = allPoi.get(position);
|
||||
@ -50,12 +52,12 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
|
||||
}
|
||||
|
||||
if (poiEntity.getPrecision() != null) {
|
||||
holder.tvMoney.setText("¥" + format2(Double.valueOf(poiEntity.getPrecision())));
|
||||
holder.tvMoney.setText("¥" + format2(Double.parseDouble(poiEntity.getPrecision())));
|
||||
} else {
|
||||
holder.tvMoney.setText("¥" + 0);
|
||||
}
|
||||
if (poiEntity.getDist() != null) {
|
||||
holder.tvDistance.setText("距离:" + format2(Double.valueOf(poiEntity.getDist()) / 1000) + "km");
|
||||
holder.tvDistance.setText("距离:" + format2(Double.parseDouble(poiEntity.getDist()) / 1000) + "km");
|
||||
} else {
|
||||
holder.tvDistance.setText("距离:" + 0);
|
||||
}
|
||||
@ -148,7 +150,7 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
|
||||
|
||||
nf.setMaximumFractionDigits(2);
|
||||
|
||||
/** setMinimumFractionDigits设置成2
|
||||
/*setMinimumFractionDigits设置成2
|
||||
* 如果不这么做,那么当value的值是100.00的时候返回100
|
||||
* 而不是100.00
|
||||
|
||||
|
@ -21,13 +21,13 @@ import java.util.ArrayList;
|
||||
*/
|
||||
public class ImagePagerAdapter extends PagerAdapter {
|
||||
Context context;
|
||||
ArrayList<String> imgsUrl;
|
||||
ArrayList<String> impsUrl;
|
||||
LayoutInflater inflater = null;
|
||||
|
||||
ImageView full_image;
|
||||
public ImagePagerAdapter(Context context, ArrayList<String> imusUrl) {
|
||||
this.context = context;
|
||||
this.imgsUrl = imusUrl;
|
||||
this.impsUrl = imusUrl;
|
||||
inflater = LayoutInflater.from(context);
|
||||
|
||||
}
|
||||
@ -40,7 +40,7 @@ public class ImagePagerAdapter extends PagerAdapter {
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return imgsUrl == null ? 0 : imgsUrl.size();
|
||||
return impsUrl == null ? 0 : impsUrl.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -59,7 +59,7 @@ public class ImagePagerAdapter extends PagerAdapter {
|
||||
public Object instantiateItem(@NotNull ViewGroup container, int position) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.details_imageshow_item, null);
|
||||
full_image = (ImageView)view.findViewById(R.id.full_image);
|
||||
Glide.with(context).load(imgsUrl.get(position)).into(full_image);
|
||||
Glide.with(context).load(impsUrl.get(position)).into(full_image);
|
||||
|
||||
((ViewPager) container).addView(view);
|
||||
return view;
|
||||
|
@ -48,34 +48,34 @@ public class PoiRecycleAdapter extends RecyclerView.Adapter<PoiRecycleAdapter.My
|
||||
|
||||
|
||||
public String getList() {
|
||||
String a="";
|
||||
StringBuilder a= new StringBuilder();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
PhoneBean poiBean = list.get(i);
|
||||
if (list.size()==1){
|
||||
if(poiBean.getPhone().indexOf('1')==0){
|
||||
a=poiBean.getPhone();
|
||||
a = new StringBuilder(poiBean.getPhone());
|
||||
}else {
|
||||
a=poiBean.getArea()+"-"+poiBean.getPhone();
|
||||
a = new StringBuilder(poiBean.getArea() + "-" + poiBean.getPhone());
|
||||
}
|
||||
}else {
|
||||
if (i==list.size()-1){
|
||||
if(poiBean.getPhone().indexOf('1')==0){
|
||||
a+=poiBean.getPhone();
|
||||
a.append(poiBean.getPhone());
|
||||
}else {
|
||||
a+=poiBean.getArea()+"-"+poiBean.getPhone();
|
||||
a.append(poiBean.getArea()).append("-").append(poiBean.getPhone());
|
||||
}
|
||||
}else{
|
||||
if(poiBean.getPhone().indexOf('1')==0){
|
||||
a+=poiBean.getPhone()+"|";
|
||||
a.append(poiBean.getPhone()).append("|");
|
||||
}else {
|
||||
a+=poiBean.getArea()+"-"+poiBean.getPhone()+"|";
|
||||
a.append(poiBean.getArea()).append("-").append(poiBean.getPhone()).append("|");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return a;
|
||||
return a.toString();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
@ -38,8 +38,8 @@ public class PoiTaskAdapter extends RecyclerView.Adapter<PoiTaskAdapter.ViewHold
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull @NotNull ViewHolder holder, int position) {
|
||||
HasSubmitBean.BodyBean.ListBean listBean = listBeans.get(position);
|
||||
holder.tvnName.setText(listBean.getName()+"");
|
||||
holder.tvTime.setText(listBean.getCreateTime()+"");
|
||||
holder.tvnName.setText(listBean.getName());
|
||||
holder.tvTime.setText(listBean.getCreateTime());
|
||||
if (listBean.getAuditStatus()==0){
|
||||
holder.tvAuditStatus.setText("审核通过");
|
||||
}else if (listBean.getAuditStatus() == 1){
|
||||
|
@ -7,7 +7,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@ -19,13 +18,12 @@ import com.navinfo.outdoor.room.PoiEntity;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.ViewHolder> {
|
||||
private Vector<PoiEntity> allRoad = new Vector<>();
|
||||
private final Vector<PoiEntity> allRoad = new Vector<>();
|
||||
private Context context;
|
||||
|
||||
public StaySubmitAdapter(Context context) {
|
||||
@ -44,10 +42,8 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
}
|
||||
|
||||
public void setAllDataChecked(boolean isChecked) {
|
||||
if (this.allRoad != null) {
|
||||
for (PoiEntity entity : this.allRoad) {
|
||||
entity.setChecked(isChecked);
|
||||
}
|
||||
for (PoiEntity entity : this.allRoad) {
|
||||
entity.setChecked(isChecked);
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +53,7 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (allRoad) {
|
||||
Iterator iterator = allRoad.iterator();
|
||||
Iterator<PoiEntity> iterator = allRoad.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||
if (poiEntity.isChecked()) {
|
||||
|
@ -29,7 +29,7 @@ public class TaskPrefectureAdapter extends RecyclerView.Adapter<TaskPrefectureAd
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View mView = LayoutInflater.from(context).inflate(R.layout.task_prefecture_item, parent, false);
|
||||
// int parentHeight= parent.getHeight();
|
||||
//int parentHeight= parent.getHeight();
|
||||
// parent.getWidth();
|
||||
// ViewGroup.LayoutParams layoutParams = viewHolder.itemView.getLayoutParams();
|
||||
// layoutParams.height = (parentHeight/ 6);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -45,11 +46,12 @@ public class WithdrawalAdapter extends RecyclerView.Adapter<WithdrawalAdapter.On
|
||||
return new OnViewHolder(inflate);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull @NotNull OnViewHolder holder, int position) {
|
||||
if (dataBeans != null && dataBeans.size() > position) {
|
||||
WithdrawalBean.BodyBean.ListBean listBean = dataBeans.get(position);
|
||||
holder.tvTitle.setText(listBean.getExchangePrice() + "");
|
||||
holder.tvTitle.setText(listBean.getExchangePrice()+"");
|
||||
holder.tvTime.setText(listBean.getCommitDate());
|
||||
holder.tvDec.setText(listBean.getAdminConfirm() == 0 ? "未审核" : "已审核");
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
package com.navinfo.outdoor.api;
|
||||
|
||||
import android.os.StrictMode;
|
||||
|
||||
@ -10,6 +10,7 @@ import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 获取token
|
||||
*/
|
@ -1,13 +1,13 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
package com.navinfo.outdoor.api;
|
||||
|
||||
|
||||
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.Base64Util;
|
||||
import com.navinfo.outdoor.http.HttpUtil;
|
||||
import com.navinfo.outdoor.util.FileUtil;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* 银行卡识别
|
||||
*/
|
||||
@ -35,7 +35,7 @@ public class BankCard {
|
||||
String param = "image=" + imgParam;
|
||||
|
||||
// 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
|
||||
String accessToken =AuthService.getAuth("iafhTwf6LnOMoYTiZQDlrKTu","0d3yoIsrsrAspUMoyNkWeeqDTvxvg9QB");
|
||||
String accessToken = AuthService.getAuth("iafhTwf6LnOMoYTiZQDlrKTu","0d3yoIsrsrAspUMoyNkWeeqDTvxvg9QB");
|
||||
return HttpUtil.post(url, accessToken, param);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
@ -45,7 +45,7 @@ public class Constant {
|
||||
public static String SHARED_PREFERENCES = "navInfo";
|
||||
public static String DATA_FILE = "dataFile";
|
||||
//下载文件
|
||||
public static final String NAVINFO_APk = BASE_FOLDER + "/apk/";
|
||||
public static final String NABISCO_APk = BASE_FOLDER + "/apk/";
|
||||
public static int TelLength=0;
|
||||
|
||||
public static void initRootFolder(String userId) {
|
||||
@ -83,19 +83,19 @@ public class Constant {
|
||||
*/
|
||||
public static String ACCESS_TOKEN = null;
|
||||
public static String REFRESH_TOKEN = null;
|
||||
public static String USERID = null;
|
||||
public static String USHERED = null;
|
||||
|
||||
public static String USER_NAME = null;//登录账号/修改账号/注册
|
||||
public static String PASS_WORD = null;//登录密码/修改密码/注册密码
|
||||
public static String AUDITMSG = null;//身份证审核信息
|
||||
public static int AUDITSTATUS = -1;//身份证审核状态 //0:不通過,1:通過,-1:待审核
|
||||
public static String AUDITING = null;//身份证审核信息
|
||||
public static int AUDIOTAPES = -1;//身份证审核状态 //0:不通過,1:通過,-1:待审核
|
||||
public static String ID_NUM = null;//身份证号
|
||||
public static String NAME = null;//身份证姓名
|
||||
public static String ID_NUMBER = null;//银行卡号
|
||||
public static String BANKACCOUNT = null;//银行卡编码
|
||||
public static String BACKGROUND = null;//银行卡编码
|
||||
public static int SEX = -1;//性别
|
||||
public static String QQ = null;
|
||||
public static String WECHAT = null;
|
||||
public static String WCHAR = null;
|
||||
public static String MOBILE = null;//手机号
|
||||
public static String FILE_PATH = null;//银行卡图片途径
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
package com.navinfo.outdoor.api;
|
||||
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.Base64Util;
|
||||
import com.navinfo.outdoor.http.HttpUtil;
|
||||
import com.navinfo.outdoor.util.FileUtil;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* 身份证识别
|
||||
*/
|
@ -10,12 +10,10 @@ import com.lzy.okgo.cookie.CookieJarImpl;
|
||||
import com.lzy.okgo.cookie.store.DBCookieStore;
|
||||
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
|
||||
import com.lzy.okgo.model.HttpHeaders;
|
||||
import com.navinfo.outdoor.util.SdkFolderCreate;
|
||||
import com.navinfo.outdoor.util.TecentLocationUtils;
|
||||
import com.navinfo.outdoor.util.TalentLocationUtils;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.umeng.umcrash.UMCrash;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@ -42,7 +40,7 @@ public class UserApplication extends Application {
|
||||
initOkGo();
|
||||
|
||||
|
||||
TecentLocationUtils.getInstance(this).startLocation(this);
|
||||
TalentLocationUtils.getInstance(this).startLocation(this);
|
||||
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ import com.navinfo.outdoor.util.NetWorkUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
@ -63,7 +64,6 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
mView = LayoutInflater.from(getActivity()).inflate(getLayout(), container, false);
|
||||
// homeActivity = (HomeActivity) getActivity();
|
||||
return mView;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -84,7 +84,7 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
}
|
||||
|
||||
protected <T extends View> T findViewById(@IdRes int id) {
|
||||
return getView().findViewById(id);
|
||||
return Objects.requireNonNull(getView()).findViewById(id);
|
||||
}
|
||||
|
||||
protected void debounce(View view) {
|
||||
|
@ -42,11 +42,7 @@ public abstract class BaseObserver<T> extends ResourceSubscriber <T> {
|
||||
// 解析错误
|
||||
onFail("解析错误");
|
||||
} else {
|
||||
if (e != null) {
|
||||
onFail(e.toString());
|
||||
} else {
|
||||
onFail("未知错误");
|
||||
}
|
||||
onFail(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,6 @@ import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.Geohash;
|
||||
import com.navinfo.outdoor.util.GeometryTools;
|
||||
import com.navinfo.outdoor.util.MapManager;
|
||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||
import com.navinfo.outdoor.util.PhotoUtils;
|
||||
import com.navinfo.outdoor.util.PictureUtil;
|
||||
import com.navinfo.outdoor.util.ToastUtil;
|
||||
|
@ -1,14 +1,10 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
@ -28,26 +24,20 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.google.gson.Gson;
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.BankCard;
|
||||
import com.navinfo.outdoor.adapter.BankAdapter;
|
||||
import com.navinfo.outdoor.api.BankCard;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.BankCardBean;
|
||||
import com.navinfo.outdoor.bean.BankPathBean;
|
||||
import com.navinfo.outdoor.bean.BankPhoneBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.DialogCallback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.navinfo.outdoor.util.Geohash;
|
||||
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||
import com.navinfo.outdoor.util.PhotoUtils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
@ -190,7 +180,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
|
||||
HttpParams httpParams = new HttpParams();
|
||||
|
||||
httpParams.put("userid", Constant.USERID);
|
||||
httpParams.put("userid", Constant.USHERED);
|
||||
httpParams.put("bankAccount", value);//银行id
|
||||
httpParams.put("idNumber", etBankAccount);//银行卡号
|
||||
OkGoBuilder.getInstance().Builder(getActivity())
|
||||
@ -207,7 +197,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "绑定成功", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Constant.BANKACCOUNT=value;
|
||||
Constant.BACKGROUND =value;
|
||||
Constant.ID_NUMBER=etBankAccount;
|
||||
getActivity().finish();
|
||||
return false;
|
||||
|
@ -60,7 +60,6 @@ import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.Geohash;
|
||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||
import com.navinfo.outdoor.util.PhotoUtils;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
||||
|
@ -23,8 +23,8 @@ import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.IdCard;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.api.IdCard;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.IdCardNumberBean;
|
||||
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
||||
@ -112,7 +112,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
LinearLayout linearLayout = findViewById(R.id.ll_pic);//身份证照片
|
||||
useCamera = findViewById(R.id.user_attestation_camera);
|
||||
useCamera.setOnClickListener(this);
|
||||
if (Constant.AUDITSTATUS==-1){//审核中
|
||||
if (Constant.AUDIOTAPES ==-1){//审核中
|
||||
if (Constant.NAME!=null&&Constant.ID_NUM!=null){
|
||||
tvTitle.setText("1.审核中");
|
||||
linearHint.setVisibility(View.VISIBLE);
|
||||
@ -127,14 +127,14 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
etNamePhone.setEnabled(true);
|
||||
btnAttestation.setEnabled(true);
|
||||
}
|
||||
}else if (Constant.AUDITSTATUS==0){//不通过
|
||||
}else if (Constant.AUDIOTAPES ==0){//不通过
|
||||
linearHint.setVisibility(View.GONE);
|
||||
etAttestationName.setText(Constant.NAME);
|
||||
etNamePhone.setText(Constant.ID_NUM);
|
||||
etAttestationName.setEnabled(true);
|
||||
etNamePhone.setEnabled(true);
|
||||
btnAttestation.setEnabled(true);
|
||||
}else if (Constant.AUDITSTATUS==1){//通过
|
||||
}else if (Constant.AUDIOTAPES ==1){//通过
|
||||
tvTitle.setText("1.审核通过");
|
||||
linearHint.setVisibility(View.VISIBLE);
|
||||
etAttestationName.setText(Constant.NAME);
|
||||
@ -257,7 +257,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
showLoadingDialog();
|
||||
setLoadingDialogText("实名认证中...");
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("userid", Constant.USERID);
|
||||
httpParams.put("userid", Constant.USHERED);
|
||||
httpParams.put("name", attestationName);
|
||||
httpParams.put("idnum", namePhone);
|
||||
OkGoBuilder.getInstance().Builder(getActivity())
|
||||
@ -277,7 +277,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Constant.NAME=attestationName;
|
||||
Constant.ID_NUM=namePhone;
|
||||
Constant.AUDITSTATUS=-1;
|
||||
Constant.AUDIOTAPES =-1;
|
||||
getActivity().finish();
|
||||
return false;
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@ -89,7 +87,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
if (Constant.ID_NUMBER==null||Constant.BANKACCOUNT==null){
|
||||
if (Constant.ID_NUMBER==null||Constant.BACKGROUND ==null){
|
||||
Toast.makeText(getActivity(), "没有绑定银行卡,请先绑定银行卡", Toast.LENGTH_SHORT).show();
|
||||
checkBox.setChecked(false);
|
||||
}else {
|
||||
|
@ -144,7 +144,7 @@ public class HttpInterface {
|
||||
//dtxbmaps.navinfo.com/dtxb/m4/user/user/1/getUserDetailByUserid/1?datetime=1628749294718
|
||||
USER_DETAIL_BY_USER_ID = TEST_IP + USER_PATH + "user/" + USERID + "/getUserDetailByUserid/" + USERID; //获取用户信息
|
||||
//http://172.21.98.90:9999/m4/user/userGuide/1/insertUserGuide
|
||||
INSERT_USER_GUIDE=TEST_GUIDANCE_IP +USER_PATH+"userGuide/"+USERID+"/insertUserGuide";//引导页完成接口
|
||||
INSERT_USER_GUIDE=TEST_IP +USER_PATH+"userGuide/"+USERID+"/insertUserGuide";//引导页完成接口
|
||||
/**
|
||||
* 发现
|
||||
* Path=/m4/msgList/**
|
||||
|
@ -161,7 +161,7 @@ public class OkGoBuilder<T> {
|
||||
if (throwable != null) {
|
||||
throwable.printStackTrace();
|
||||
callback.onError(throwable, 2);
|
||||
/**
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
@ -179,15 +179,15 @@ public class OkGoBuilder<T> {
|
||||
} else {
|
||||
headers.put("Authorization", "bearer " + token);
|
||||
}
|
||||
String util = "";//k1=v1&k2=v2&k3=v3
|
||||
StringBuilder util = new StringBuilder();//k1=v1&k2=v2&k3=v3
|
||||
if (params != null && params.urlParamsMap != null) {
|
||||
for (Map.Entry<String, List<String>> entry : params.urlParamsMap.entrySet()) {
|
||||
if (!"file".equals(entry.getKey())) {
|
||||
util += entry.getKey() + "=" + entry.getValue().get(0).toString() + "&";
|
||||
util.append(entry.getKey()).append("=").append(entry.getValue().get(0).toString()).append("&");
|
||||
}
|
||||
}
|
||||
if (util != null && !util.equals("")) {
|
||||
util = util.substring(0, util.length() - 1);
|
||||
if (!util.toString().equals("")) {
|
||||
util = new StringBuilder(util.substring(0, util.length() - 1));
|
||||
}
|
||||
}
|
||||
headers.put("key", Md5Util.toMD5("dtxb_2021_navinfo" + util));
|
||||
@ -211,7 +211,7 @@ public class OkGoBuilder<T> {
|
||||
long time = System.currentTimeMillis();
|
||||
params.put("datetime", time);
|
||||
try {
|
||||
okhttp3.Response execute = OkGo
|
||||
return OkGo
|
||||
// 请求方式和请求url
|
||||
.<PoiUploadBean>post(url)
|
||||
.headers(getHeader())
|
||||
@ -221,7 +221,6 @@ public class OkGoBuilder<T> {
|
||||
|
||||
.tag(this)
|
||||
.execute();
|
||||
return execute;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -273,7 +272,7 @@ public class OkGoBuilder<T> {
|
||||
if (throwable != null) {
|
||||
throwable.printStackTrace();
|
||||
callback.onError(throwable, 2);
|
||||
/**
|
||||
/*
|
||||
* 友盟+
|
||||
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
|
||||
*/
|
||||
@ -342,12 +341,11 @@ public class OkGoBuilder<T> {
|
||||
long time = System.currentTimeMillis();
|
||||
params.put("datetime", time);
|
||||
try {
|
||||
okhttp3.Response execute = OkGo.<String>get(url)
|
||||
return OkGo.<String>get(url)
|
||||
.headers(getHeader())
|
||||
.params(params)
|
||||
.tag(this)
|
||||
.execute();
|
||||
return execute;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -29,9 +29,9 @@ public class ContactView {
|
||||
private ViewGroup rootView;
|
||||
private List<PhoneBean> poiBeanList;
|
||||
|
||||
public ContactView(Context context, ViewGroup roatView, List<PhoneBean> poiBeans) {
|
||||
public ContactView(Context context, ViewGroup ratView, List<PhoneBean> poiBeans) {
|
||||
this.context = context;
|
||||
this.rootView = roatView;
|
||||
this.rootView = ratView;
|
||||
this.poiBeanList = poiBeans;
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ public class ContactView {
|
||||
/**
|
||||
* ViewHolder的类,用于缓存控件
|
||||
*/
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
static class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvPhone;
|
||||
EditText editAreaCode, editPhoneNumber;
|
||||
ImageView image;
|
||||
|
@ -20,13 +20,13 @@ public class MyTecentLocationSource implements LocationSource{
|
||||
@Override
|
||||
public void activate(OnLocationChangedListener onLocationChangedListener) {
|
||||
locationChangedListener = onLocationChangedListener;
|
||||
TecentLocationUtils.getInstance(mContext).getLocationChangedListenerList().add(onLocationChangedListener);
|
||||
TalentLocationUtils.getInstance(mContext).getLocationChangedListenerList().add(onLocationChangedListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deactivate() {
|
||||
if (locationChangedListener!=null) {
|
||||
TecentLocationUtils.getInstance(mContext).getLocationChangedListenerList().remove(locationChangedListener);
|
||||
TalentLocationUtils.getInstance(mContext).getLocationChangedListenerList().remove(locationChangedListener);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.util;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
@ -23,10 +24,10 @@ public class PhotoPathUtil {
|
||||
*
|
||||
* @param data
|
||||
* @param d 类型
|
||||
* @param coord 经纬度加密
|
||||
* @param chord 经纬度加密
|
||||
* @return
|
||||
*/
|
||||
public static String getTakePhotoPath(Intent data,String d,String coord) {
|
||||
public static String getTakePhotoPath(Intent data,String d,String chord) {
|
||||
Bitmap photo = null;
|
||||
int angle=0;
|
||||
Uri uri = data.getData();
|
||||
@ -45,7 +46,7 @@ public class PhotoPathUtil {
|
||||
|
||||
FileOutputStream fileOutputStream = null;
|
||||
try {
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-ddHHmmss");
|
||||
@SuppressLint("SimpleDateFormat") DateFormat formatter = new SimpleDateFormat("yyyy-MM-ddHHmmss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
@ -54,7 +55,7 @@ public class PhotoPathUtil {
|
||||
if (angle==0){
|
||||
angle=90;
|
||||
}
|
||||
File file = new File(Constant.PICTURE_FOLDER+d+time+"_p"+coord+"_a"+angle+".jpg");
|
||||
File file = new File(Constant.PICTURE_FOLDER+d+time+"_p"+chord+"_a"+angle+".jpg");
|
||||
/***打开文件输出流*/
|
||||
fileOutputStream = new FileOutputStream(file);
|
||||
// 生成图片文件
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.navinfo.outdoor.util;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
@ -17,7 +16,7 @@ import java.util.BitSet;
|
||||
import static org.greenrobot.eventbus.EventBus.TAG;
|
||||
|
||||
public class PhotoUtils {
|
||||
private static int numbits = 6 * 5;
|
||||
private static int nubbins = 6 * 5;
|
||||
// 为了加密,所以改了base32编码代码表
|
||||
final static char[] digits = { 'd', 'f', 'g', 'y', 'n', 't', 'u', 'v', 'q',
|
||||
'b', '9', 's', 'z', '7', 'i', '2', 'h', '5', '0', 'p', '4', 'm',
|
||||
@ -34,24 +33,23 @@ public class PhotoUtils {
|
||||
lat= initEncode(latLng);
|
||||
}
|
||||
long time = System.currentTimeMillis();
|
||||
File file = new File(Constant.PICTURE_FOLDER, d + time + "_p" + lat + "_a" + 0 + ".jpg");
|
||||
return file;
|
||||
return new File(Constant.PICTURE_FOLDER, d + time + "_p" + lat + "_a" + 0 + ".jpg");
|
||||
}
|
||||
|
||||
public static String initEncode(LatLng latLng) {
|
||||
BitSet latbits = getBits(latLng.latitude, -90, 90);
|
||||
BitSet lonbits = getBits(latLng.longitude, -180, 180);
|
||||
BitSet latents = getBits(latLng.latitude, -90, 90);
|
||||
BitSet lobbies = getBits(latLng.longitude, -180, 180);
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
for (int i = 0; i < numbits; i++) {
|
||||
buffer.append((lonbits.get(i)) ? '1' : '0');
|
||||
buffer.append((latbits.get(i)) ? '1' : '0');
|
||||
for (int i = 0; i < nubbins; i++) {
|
||||
buffer.append((lobbies.get(i)) ? '1' : '0');
|
||||
buffer.append((latents.get(i)) ? '1' : '0');
|
||||
}
|
||||
return base32(Long.parseLong(buffer.toString(), 2));
|
||||
}
|
||||
|
||||
private static BitSet getBits(double lat, double floor, double ceiling) {
|
||||
BitSet buffer = new BitSet(numbits);
|
||||
for (int i = 0; i < numbits; i++) {
|
||||
BitSet buffer = new BitSet(nubbins);
|
||||
for (int i = 0; i < nubbins; i++) {
|
||||
double mid = (floor + ceiling) / 2;
|
||||
if (lat >= mid) {
|
||||
buffer.set(i);
|
||||
|
@ -23,8 +23,6 @@ public class PictureUtil {
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
|
||||
fos.flush();
|
||||
fos.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -18,22 +18,22 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TecentLocationUtils implements TencentLocationListener{
|
||||
public class TalentLocationUtils implements TencentLocationListener{
|
||||
private TencentLocationManager locationManager;
|
||||
private TencentLocationRequest locationRequest;
|
||||
private List<LocationSource.OnLocationChangedListener> locationChangedListenerList;
|
||||
private boolean isLocationStart; // 标识是否已经启动定位
|
||||
|
||||
private static TecentLocationUtils instance;
|
||||
private static TalentLocationUtils instance;
|
||||
|
||||
public static TecentLocationUtils getInstance(Context mContext) {
|
||||
public static TalentLocationUtils getInstance(Context mContext) {
|
||||
if (instance == null) {
|
||||
instance = new TecentLocationUtils(mContext);
|
||||
instance = new TalentLocationUtils(mContext);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public TecentLocationUtils(Context mContext) {
|
||||
public TalentLocationUtils(Context mContext) {
|
||||
init(mContext);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.util;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@ -44,6 +45,7 @@ public class ToastUtil {
|
||||
* @param context
|
||||
* @param message
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void showShort(Context context, CharSequence message) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
@ -61,6 +63,7 @@ public class ToastUtil {
|
||||
* @param context
|
||||
* @param resId 资源ID:getResources().getString(R.string.xxxxxx);
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void showShort(Context context, int resId) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
@ -78,6 +81,7 @@ public class ToastUtil {
|
||||
* @param context
|
||||
* @param message
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void showLong(Context context, CharSequence message) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
@ -95,6 +99,7 @@ public class ToastUtil {
|
||||
* @param context
|
||||
* @param resId 资源ID:getResources().getString(R.string.xxxxxx);
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void showLong(Context context, int resId) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
@ -113,6 +118,7 @@ public class ToastUtil {
|
||||
* @param message
|
||||
* @param duration 单位:毫秒
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void show(Context context, CharSequence message, int duration) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
@ -131,6 +137,7 @@ public class ToastUtil {
|
||||
* @param resId 资源ID:getResources().getString(R.string.xxxxxx);
|
||||
* @param duration 单位:毫秒
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void show(Context context, int resId, int duration) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
@ -150,6 +157,7 @@ public class ToastUtil {
|
||||
* @param duration 单位:毫秒
|
||||
* @param view 显示自己的View
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void customToastView(Context context, CharSequence message, int duration, View view) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
@ -174,6 +182,7 @@ public class ToastUtil {
|
||||
* @param xOffset
|
||||
* @param yOffset
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void customToastGravity(Context context, CharSequence message, int duration, int gravity, int xOffset, int yOffset) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
@ -197,6 +206,7 @@ public class ToastUtil {
|
||||
* @param xOffset
|
||||
* @param yOffset
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void showToastWithImageAndText(Context context, CharSequence message, int iconResId, int duration, int gravity, int xOffset, int yOffset) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
@ -228,6 +238,7 @@ public class ToastUtil {
|
||||
* @param horizontalMargin
|
||||
* @param verticalMargin
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void customToastAll(Context context, CharSequence message, int duration, View view, boolean isGravity, int gravity, int xOffset, int yOffset, boolean isMargin, float horizontalMargin, float verticalMargin) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
@ -263,6 +274,7 @@ public class ToastUtil {
|
||||
* @param horizontalMargin
|
||||
* @param verticalMargin
|
||||
*/
|
||||
@SuppressLint("ShowToast")
|
||||
public static void customToastAll(Context context, int resId, int duration, View view, boolean isGravity, int gravity, int xOffset, int yOffset, boolean isMargin, float horizontalMargin, float verticalMargin) {
|
||||
if (isShow) {
|
||||
if (mToast == null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user