修改强制更新 和银行卡识别的bug

This commit is contained in:
md 2021-09-08 16:46:02 +08:00
parent 1cc7e45c9a
commit 1eebd16086
11 changed files with 76 additions and 46 deletions

View File

@ -3,14 +3,14 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion '29.0.2' buildToolsVersion '29.0.2'
//ndkVersion '23.0.7123448' ndkVersion '23.0.7123448'
defaultConfig { defaultConfig {
applicationId "com.navinfo.outdoor" applicationId "com.navinfo.outdoor"
minSdkVersion 22 minSdkVersion 22
targetSdkVersion 30 targetSdkVersion 30
versionCode 1 versionCode 2
versionName "1.0" versionName "2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
lintOptions { lintOptions {

View File

@ -237,13 +237,6 @@ public class MainActivity extends BaseActivity {
} }
} }
}); });
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//用户点击了取消
initTime();
}
});
} }
builder.create().show(); builder.create().show();
} }

View File

@ -1,6 +1,8 @@
package com.navinfo.outdoor.activity; package com.navinfo.outdoor.activity;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
@ -54,16 +56,19 @@ import com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle;
import com.tencent.tencentmap.mapsdk.maps.model.Polyline; import com.tencent.tencentmap.mapsdk.maps.model.Polyline;
import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions; import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.io.File; import java.io.File;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE; import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE;
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER; import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER;
@ -79,7 +84,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
private Polyline polyline; private Polyline polyline;
private String finalVideoPath; // 摄像后最终保存的文件名 private String finalVideoPath; // 摄像后最终保存的文件名
private ViewGroup layerChange; // 切换地图和相机的父控件 private ViewGroup layerChange; // 切换地图和相机的父控件
private CheckBox capturePicture,cbMapType;//拍照 private CheckBox capturePicture, cbMapType;//拍照
private boolean isMapSlide = false; private boolean isMapSlide = false;
private boolean listenerPicture = false; private boolean listenerPicture = false;
private SimpleDateFormat formatter; private SimpleDateFormat formatter;
@ -91,11 +96,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
public boolean handleMessage(@NonNull Message msg) { public boolean handleMessage(@NonNull Message msg) {
if (msg.what == 0x101 && listenerPicture) { if (msg.what == 0x101 && listenerPicture) {
camera.takePicture(); camera.takePicture();
} else if (msg.what == 0x102){ } else if (msg.what == 0x102) {
if (btnSwitch != null) { if (btnSwitch != null) {
// tencentMap.setBaseMapEnabled(true);
btnSwitch.setEnabled(true); btnSwitch.setEnabled(true);
} }
} else if (msg.what == 0x103){ } else if (msg.what == 0x103) {
listenerPicture = false; listenerPicture = false;
if (type != 3) { if (type != 3) {
capturePicture.setText("开始采集"); capturePicture.setText("开始采集");
@ -130,13 +136,14 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
formatter = new SimpleDateFormat("yyyyMMdd HHmmss"); formatter = new SimpleDateFormat("yyyyMMdd HHmmss");
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
ivMap = findViewById(R.id.iv_map); ivMap = findViewById(R.id.iv_map);
ivMap.setOnClickListener(this::onClick);
btnSwitch = findViewById(R.id.btn_switch); btnSwitch = findViewById(R.id.btn_switch);
btnSwitch.setOnClickListener(this); btnSwitch.setOnClickListener(this);
//相机记录器 //相机记录器
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE); CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
ivZoomAdd =findViewById(R.id.iv_zoom_add); ivZoomAdd = findViewById(R.id.iv_zoom_add);
ivZoomAdd.setOnClickListener(this); ivZoomAdd.setOnClickListener(this);
ivZoomDel =findViewById(R.id.iv_zoom_del); ivZoomDel = findViewById(R.id.iv_zoom_del);
ivZoomDel.setOnClickListener(this); ivZoomDel.setOnClickListener(this);
// cbMapType =findViewById(R.id.cb_map_type); // cbMapType =findViewById(R.id.cb_map_type);
// cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { // cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@ -145,11 +152,11 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
// setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER); // setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER);
// } // }
// }); // });
ivLocation =findViewById(R.id.iv_location); ivLocation = findViewById(R.id.iv_location);
ivLocation.setOnClickListener(this); ivLocation.setOnClickListener(this);
camera =findViewById(R.id.camera); camera = findViewById(R.id.camera);
camera.setOnClickListener(this); camera.setOnClickListener(this);
capturePicture =findViewById(R.id.capture_picture); capturePicture = findViewById(R.id.capture_picture);
if (type == 3) { if (type == 3) {
capturePicture.setText("拍摄"); capturePicture.setText("拍摄");
} else { } else {
@ -172,12 +179,12 @@ 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); stopPicture.setOnClickListener(this);
//获取地图 //获取地图
tencentMap = ivMap.getMap(); tencentMap = ivMap.getMap();
//获取地图UI 设置对象 //获取地图UI 设置对象
UiSettings uiSettings =tencentMap.getUiSettings(); UiSettings uiSettings = tencentMap.getUiSettings();
//设置logo的大小 //设置logo的大小
uiSettings.setLogoScale(0.7f); uiSettings.setLogoScale(0.7f);
uiSettings.setRotateGesturesEnabled(false);//禁止地图旋转手势. uiSettings.setRotateGesturesEnabled(false);//禁止地图旋转手势.
@ -200,6 +207,15 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
} }
} }
} }
tencentMap.setOnMapClickListener(new TencentMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng latLng) {
btnSwitch.setEnabled(false);
handler.sendEmptyMessageDelayed(0x102, 2000);// 利用handler延迟发送更改状态信息
benSwitch();
}
});
camera.addCameraListener(new CameraListener() {//相机预览监听 camera.addCameraListener(new CameraListener() {//相机预览监听
@Override @Override
public void onPictureTaken(@NonNull @NotNull PictureResult result) { public void onPictureTaken(@NonNull @NotNull PictureResult result) {
@ -221,10 +237,10 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
if (type == 3) { if (type == 3) {
message.what = 0x103; message.what = 0x103;
handler.sendMessageDelayed(message, 0); handler.sendMessageDelayed(message, 0);
Toast.makeText(PicturesActivity.this, "保存成功:" + (videoIndex+1), Toast.LENGTH_SHORT).show(); Toast.makeText(PicturesActivity.this, "保存成功:" + (videoIndex + 1), Toast.LENGTH_SHORT).show();
} else { } else {
message.what = 0x101; message.what = 0x101;
Toast.makeText(PicturesActivity.this, "保存成功" + (videoIndex+1), Toast.LENGTH_SHORT).show(); Toast.makeText(PicturesActivity.this, "保存成功" + (videoIndex + 1), Toast.LENGTH_SHORT).show();
handler.sendMessageDelayed(message, 1500); handler.sendMessageDelayed(message, 1500);
} }
} }
@ -238,6 +254,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
Log.d("captureTime", captureTime + ""); Log.d("captureTime", captureTime + "");
} }
} }
//录像监听 //录像监听
@Override @Override
public void onVideoTaken(@NonNull @NotNull VideoResult result) { public void onVideoTaken(@NonNull @NotNull VideoResult result) {
@ -256,6 +273,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
super.onVideoRecordingStart(); super.onVideoRecordingStart();
} }
}); });
DisplayMetrics dm = new DisplayMetrics(); DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm); getWindowManager().getDefaultDisplay().getMetrics(dm);
FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//相机的宽高 FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//相机的宽高
@ -319,9 +337,9 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
finish(); finish();
break; break;
case R.id.btn_switch: case R.id.btn_switch:
v.setEnabled(false); // v.setEnabled(false);
handler.sendEmptyMessageDelayed(0x102, 2000);// 利用handler延迟发送更改状态信息 // handler.sendEmptyMessageDelayed(0x102, 2000);// 利用handler延迟发送更改状态信息
benSwitch(); // benSwitch();
break; break;
case R.id.iv_zoom_add://放大 case R.id.iv_zoom_add://放大
CameraUpdate cameraUpdateIn = CameraUpdateFactory.zoomIn(); CameraUpdate cameraUpdateIn = CameraUpdateFactory.zoomIn();
@ -342,6 +360,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
tencentMap.animateCamera(cameraSigma); tencentMap.animateCamera(cameraSigma);
} }
break; break;
} }
} }
@ -358,6 +378,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
bitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true); bitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
return bitmap; return bitmap;
} }
/** /**
* 设置定位图标样式 * 设置定位图标样式
*/ */
@ -447,6 +468,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
capturePicture.setText("继续采集"); capturePicture.setText("继续采集");
} }
} }
@Override @Override
public void onSaveInstanceState(@NonNull Bundle outState) { public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
@ -455,6 +477,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
obtain.obj = true; obtain.obj = true;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();

View File

@ -182,7 +182,7 @@ public class Constant {
public static TencentMap.OnMarkerClickListener markerClickListener=null; public static TencentMap.OnMarkerClickListener markerClickListener=null;
public static final String NAVIN_FO="9.06"; public static final String NAVIN_FO="9.07";//版本
/** /**
* 联系我们的QQ群名称和QQ群号 * 联系我们的QQ群名称和QQ群号

View File

@ -5,6 +5,7 @@ import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
@ -145,6 +146,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
case R.id.btn_bank: case R.id.btn_bank:
if (etBankNum.getText().toString().equals("")) { if (etBankNum.getText().toString().equals("")) {
Toast.makeText(getActivity(), "银行卡号不能为空", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "银行卡号不能为空", Toast.LENGTH_SHORT).show();
Log.e("TAG", "onClick: "+etBankNum );
return; return;
} }
gatheringNetWork(); gatheringNetWork();
@ -234,7 +236,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
if (bankCardBean==null){ if (bankCardBean==null){
Toast.makeText(getContext(), "请手动添加银行卡号", Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), "请手动添加银行卡号", Toast.LENGTH_SHORT).show();
}else { }else {
if (bankCardBean.getResult().getBank_card_number()!=null){ if (bankCardBean.getResult()!=null&&bankCardBean.getResult().getBank_card_number()!=null){
String bank_card_number = bankCardBean.getResult().getBank_card_number(); String bank_card_number = bankCardBean.getResult().getBank_card_number();
etBankNum.setText(bank_card_number); etBankNum.setText(bank_card_number);
}else { }else {

View File

@ -164,6 +164,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private int messageType = 0;//0: 已读消息 1新消息 private int messageType = 0;//0: 已读消息 1新消息
private SharedPreferences.Editor sharedEdit; private SharedPreferences.Editor sharedEdit;
private SharedPreferences sharedPreferences; private SharedPreferences sharedPreferences;
private int getMessageType;
public static TreasureFragment newInstance(Bundle bundle) { public static TreasureFragment newInstance(Bundle bundle) {
@ -183,10 +184,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private void refreshFilterData() { private void refreshFilterData() {
String dataTime = sharedPreferences.getString("dataTime", null); String dataTime = sharedPreferences.getString("dataTime", null);
int type = sharedPreferences.getInt("type", 0); getMessageType = sharedPreferences.getInt("type", 0);
if (type == 0) {//隐藏 if (getMessageType == 0) {//隐藏
ivMassNotification.setVisibility(View.GONE); ivMassNotification.setVisibility(View.GONE);
} else {//显示S } else {//显示S
ivMassNotification.setVisibility(View.VISIBLE); ivMassNotification.setVisibility(View.VISIBLE);
@ -199,7 +200,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis()); calendar.setTimeInMillis(System.currentTimeMillis());
String presentData = formatter.format(calendar.getTime());//当前时间 String presentData = formatter.format(calendar.getTime());//当前时间
int result = presentData.compareTo(newData); int result = presentData.compareTo(newData);//当前时间和请求时间进行比较
if (result>=0){ if (result>=0){
//进行请求 //进行请求
initMessageNotice(); initMessageNotice();
@ -405,6 +406,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
int[] widthHeight = DensityUtil.getDeviceInfo(getActivity()); int[] widthHeight = DensityUtil.getDeviceInfo(getActivity());
treasureMap.getLayoutParams().width = widthHeight[0]; treasureMap.getLayoutParams().width = widthHeight[0];
treasureMap.getLayoutParams().height = widthHeight[1]; treasureMap.getLayoutParams().height = widthHeight[1];
} }
/** /**
@ -584,7 +586,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
// 折线的颜色为绿色 // 折线的颜色为绿色
.color(Color.parseColor("#0096FF")) .color(Color.parseColor("#0096FF"))
// 折线宽度为5像素 // 折线宽度为5像素
.width(10) .width(15)
// 还可以添加描边颜色 // 还可以添加描边颜色
//.borderColor(0xffff0000) //.borderColor(0xffff0000)
// 描边颜色的宽度线宽还是 25 像素不过填充的部分宽度为 `width` - 2 * `borderWidth` // 描边颜色的宽度线宽还是 25 像素不过填充的部分宽度为 `width` - 2 * `borderWidth`
@ -592,6 +594,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.arrow(true) .arrow(true)
.arrowSpacing(100) .arrowSpacing(100)
.arrowTexture(bitmapLine); .arrowTexture(bitmapLine);
// 绘制折线 // 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions); Polyline polyline = tencentMap.addPolyline(polylineOptions);
polyline.setZIndex(MARKER_LINE); polyline.setZIndex(MARKER_LINE);
@ -1552,6 +1555,13 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
refreshFilterData(); refreshFilterData();
break; break;
case R.id.iv_message: case R.id.iv_message:
if (getMessageType ==1){//判断获取sp里面的type是否是1
messageType =0;
ivMassNotification.setVisibility(View.GONE);
}else {
return;
}
Intent messageIntent = new Intent(getContext(), FragmentManagement.class); Intent messageIntent = new Intent(getContext(), FragmentManagement.class);
messageIntent.putExtra("tag", 35); messageIntent.putExtra("tag", 35);
startActivity(messageIntent); startActivity(messageIntent);

View File

@ -3,9 +3,9 @@ package com.navinfo.outdoor.http;
import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.api.Constant;
public class HttpInterface { public class HttpInterface {
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口 public static final String IP_TEST = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
public static final String DATA_IP = "http://172.23.139.4:9999/m4";//接口 public static final String DATA_IP = "http://172.23.139.4:9999/m4";//接口
public static final String IP_TEST = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口 public static final String IP = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口 public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
public static final String APKIP = "http://172.23.139.4:8001/"; public static final String APKIP = "http://172.23.139.4:8001/";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 620 B

After

Width:  |  Height:  |  Size: 1015 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -16,12 +16,12 @@
android:id="@+id/camera" android:id="@+id/camera"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:cameraPictureSizeMaxArea="1700000" app:cameraPictureSizeMaxArea="3200000"
app:cameraPictureSizeMaxHeight="1280" app:cameraPictureSizeMaxHeight="2000"
app:cameraPictureSizeMinHeight="720" app:cameraPictureSizeMinHeight="1000"
app:cameraPictureSizeMaxWidth="1280" app:cameraPictureSizeMaxWidth="2000"
app:cameraPictureSizeMinWidth="720" app:cameraPictureSizeMinWidth="1000"
app:cameraPictureSizeAspectRatio="1280:720" app:cameraPictureSizeAspectRatio="1920:1080"
android:keepScreenOn="true" android:keepScreenOn="true"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -47,6 +47,7 @@
app:layout_constraintBottom_toTopOf="@+id/btn_stop_picture" app:layout_constraintBottom_toTopOf="@+id/btn_stop_picture"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/btn_switch" app:layout_constraintStart_toStartOf="@+id/btn_switch"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
@ -89,6 +90,7 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginEnd="25dp" android:layout_marginEnd="25dp"
android:text="切换" android:text="切换"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />

View File

@ -34,8 +34,8 @@
<ImageView <ImageView
android:id="@+id/image_heard" android:id="@+id/image_heard"
android:layout_width="50dp" android:layout_width="70dp"
android:layout_height="50dp" android:layout_height="70dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -49,7 +49,7 @@
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:text="NO7378" android:text="NO7378"
android:textColor="#fff" android:textColor="#fff"
android:textSize="22sp" android:textSize="25sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintStart_toEndOf="@+id/image_heard" app:layout_constraintStart_toEndOf="@+id/image_heard"