修改bug
This commit is contained in:
parent
a432e51e75
commit
48ed8dd67a
@ -9,8 +9,8 @@ android {
|
|||||||
applicationId "com.navinfo.outdoor"
|
applicationId "com.navinfo.outdoor"
|
||||||
minSdkVersion 22
|
minSdkVersion 22
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 6
|
versionCode 7
|
||||||
versionName "6.1112"
|
versionName "6.1113"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
lintOptions {
|
lintOptions {
|
||||||
|
@ -56,6 +56,7 @@ public class HomeActivity extends BaseActivity{
|
|||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
return R.layout.activity_home;
|
return R.layout.activity_home;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
@ -63,6 +64,7 @@ public class HomeActivity extends BaseActivity{
|
|||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
@ -86,6 +88,7 @@ public class HomeActivity extends BaseActivity{
|
|||||||
public Fragment getItem(int i) {
|
public Fragment getItem(int i) {
|
||||||
return fragments.get(i);
|
return fragments.get(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return fragments.size();
|
return fragments.size();
|
||||||
@ -128,17 +131,20 @@ public class HomeActivity extends BaseActivity{
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//点击table layout效果
|
//点击table layout效果
|
||||||
@Override
|
@Override
|
||||||
public void onTabUnselected(TabLayout.Tab tab) {
|
public void onTabUnselected(TabLayout.Tab tab) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTabReselected(TabLayout.Tab tab) {
|
public void onTabReselected(TabLayout.Tab tab) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onEvent(Message data) {
|
public void onEvent(Message data) {
|
||||||
if (data.what == Constant.EVENT_WORK_HOME) {
|
if (data.what == Constant.EVENT_WORK_HOME) {
|
||||||
@ -158,6 +164,11 @@ public class HomeActivity extends BaseActivity{
|
|||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
DialogSettings.style = DialogSettings.STYLE.STYLE_IOS;
|
||||||
MessageDialog.show(this, "提示", dataString, "确定");
|
MessageDialog.show(this, "提示", dataString, "确定");
|
||||||
}
|
}
|
||||||
|
} else if (data.what == Constant.EVENT_MESSAGE) {
|
||||||
|
String dataString = (String) data.obj;
|
||||||
|
if (!dataString.equals("")) {
|
||||||
|
Toast.makeText(this, dataString, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,6 +184,7 @@ public class HomeActivity extends BaseActivity{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||||
|
@ -588,12 +588,14 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
camera.open();
|
camera.open();
|
||||||
|
tvMapView.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onRestart() {
|
protected void onRestart() {
|
||||||
super.onRestart();
|
super.onRestart();
|
||||||
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
|
tvMapView.onRestart();
|
||||||
if (radioPicture != 1) {
|
if (radioPicture != 1) {
|
||||||
capturePicture.setChecked(false);
|
capturePicture.setChecked(false);
|
||||||
capturePicture.setText("继续采集");
|
capturePicture.setText("继续采集");
|
||||||
@ -613,6 +615,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
picturesBuilder.append("onPause ,");
|
picturesBuilder.append("onPause ,");
|
||||||
|
tvMapView.onPause();
|
||||||
camera.close();
|
camera.close();
|
||||||
stopTimer();
|
stopTimer();
|
||||||
}
|
}
|
||||||
@ -621,12 +624,14 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
|||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
picturesBuilder.append("onStop ,");
|
picturesBuilder.append("onStop ,");
|
||||||
|
tvMapView.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
camera.destroy();
|
camera.destroy();
|
||||||
|
tvMapView.onDestroy();
|
||||||
systemTTS.stopSpeak();
|
systemTTS.stopSpeak();
|
||||||
stopTimer();
|
stopTimer();
|
||||||
if (polyline != null) {
|
if (polyline != null) {
|
||||||
|
@ -26,6 +26,7 @@ public class Constant {
|
|||||||
public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确";
|
public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确";
|
||||||
public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败";
|
public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败";
|
||||||
public static final String ROOT_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor";
|
public static final String ROOT_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor";
|
||||||
|
|
||||||
public static String BASE_FOLDER = ROOT_FOLDER;
|
public static String BASE_FOLDER = ROOT_FOLDER;
|
||||||
//保存图片的目录
|
//保存图片的目录
|
||||||
public static String PICTURE_FOLDER;
|
public static String PICTURE_FOLDER;
|
||||||
@ -138,6 +139,7 @@ public class Constant {
|
|||||||
public static final int NEST_WORD_REGISTER=51;//所有的保存
|
public static final int NEST_WORD_REGISTER=51;//所有的保存
|
||||||
public static final int STAY_SUBMIT_ITEM = 52;//待提交
|
public static final int STAY_SUBMIT_ITEM = 52;//待提交
|
||||||
public static final int HAS_SUBMIT_ITEM = 53;//已提交
|
public static final int HAS_SUBMIT_ITEM = 53;//已提交
|
||||||
|
public static final int EVENT_MESSAGE = 55;//提示消息
|
||||||
public static final String INTENT_POI_VIDEO_TYPE = "poi_video_type";
|
public static final String INTENT_POI_VIDEO_TYPE = "poi_video_type";
|
||||||
public static int NUMBER = 200; //任务个数
|
public static int NUMBER = 200; //任务个数
|
||||||
public static int LIMIT_TYPE = -1; //权限类型,普通任务-0,专属任务-1
|
public static int LIMIT_TYPE = -1; //权限类型,普通任务-0,专属任务-1
|
||||||
@ -163,7 +165,7 @@ public class Constant {
|
|||||||
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
|
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
|
||||||
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
|
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
|
||||||
public static TencentMap.OnMarkerClickListener markerClickListener = null;
|
public static TencentMap.OnMarkerClickListener markerClickListener = null;
|
||||||
public static final String NAVIN_FO = "11.12";//版本日期
|
public static final String NAVIN_FO = "11.15";//版本日期
|
||||||
//marker
|
//marker
|
||||||
public static final BitmapDescriptor MARKER_POI_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
public static final BitmapDescriptor MARKER_POI_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||||
public static final BitmapDescriptor MARKER_CHARGE_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
public static final BitmapDescriptor MARKER_CHARGE_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
||||||
|
@ -41,6 +41,7 @@ import com.navinfo.outdoor.room.PoiDatabase;
|
|||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
import com.navinfo.outdoor.util.FlushTokenUtil;
|
import com.navinfo.outdoor.util.FlushTokenUtil;
|
||||||
import com.navinfo.outdoor.util.PoiSaveUtils;
|
import com.navinfo.outdoor.util.PoiSaveUtils;
|
||||||
|
import com.umeng.umcrash.UMCrash;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@ -389,6 +390,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
try {
|
||||||
List<PoiEntity> roadAll = roadDao.getAllPoiByRecoded();
|
List<PoiEntity> roadAll = roadDao.getAllPoiByRecoded();
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@ -406,8 +408,14 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
UMCrash.generateCustomLog(e, "自定义");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(getActivity(), "无法读取数据库,请尝试重启程序!", Toast.LENGTH_SHORT).show();
|
||||||
|
UMCrash.generateCustomLog("无法读取数据库", "自定义");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,9 +3,12 @@ package com.navinfo.outdoor.util;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class PoiEntityDeleteUtil {
|
public class PoiEntityDeleteUtil {
|
||||||
@ -21,10 +24,12 @@ public class PoiEntityDeleteUtil {
|
|||||||
public void deleteUtil(Context context, PoiEntity poiEntity) {
|
public void deleteUtil(Context context, PoiEntity poiEntity) {
|
||||||
switch (poiEntity.getType()) {
|
switch (poiEntity.getType()) {
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
|
||||||
case 5:
|
case 5:
|
||||||
initDelete(poiEntity);
|
initDelete(poiEntity);
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
initPileDelete(context,poiEntity);
|
||||||
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
initPicture(poiEntity);
|
initPicture(poiEntity);
|
||||||
@ -32,6 +37,33 @@ public class PoiEntityDeleteUtil {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private void initPileDelete(Context context, PoiEntity poiEntity) {
|
||||||
|
if (poiEntity != null) {
|
||||||
|
if (poiEntity.getPhotoInfo() != null) {
|
||||||
|
for (int i = 0; i < poiEntity.getPhotoInfo().size(); i++) {
|
||||||
|
File file = new File(poiEntity.getPhotoInfo().get(i).getPhoto());
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (poiEntity.getId() != null) {
|
||||||
|
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(context).getChargingPileDao().getChargingPileByStationId(poiEntity.getId());
|
||||||
|
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||||
|
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
|
||||||
|
List<File> chargingPileFileList = new ArrayList<>();
|
||||||
|
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
|
||||||
|
for (String photoPath : chargingPileEntity.getPhotos()) {
|
||||||
|
chargingPileFileList.add(new File(photoPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < chargingPileFileList.size(); i++) {
|
||||||
|
chargingPileFileList.get(i).delete();
|
||||||
|
}
|
||||||
|
PoiDatabase.getInstance(context).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void initPicture(PoiEntity poiEntity) {
|
private void initPicture(PoiEntity poiEntity) {
|
||||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
|
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
|
||||||
|
@ -23,9 +23,7 @@ public class TalentLocationUtils implements TencentLocationListener{
|
|||||||
private TencentLocationRequest locationRequest;
|
private TencentLocationRequest locationRequest;
|
||||||
private List<LocationSource.OnLocationChangedListener> locationChangedListenerList;
|
private List<LocationSource.OnLocationChangedListener> locationChangedListenerList;
|
||||||
private boolean isLocationStart; // 标识是否已经启动定位
|
private boolean isLocationStart; // 标识是否已经启动定位
|
||||||
|
|
||||||
private static TalentLocationUtils instance;
|
private static TalentLocationUtils instance;
|
||||||
|
|
||||||
public static TalentLocationUtils getInstance(Context mContext) {
|
public static TalentLocationUtils getInstance(Context mContext) {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new TalentLocationUtils(mContext);
|
instance = new TalentLocationUtils(mContext);
|
||||||
@ -114,6 +112,26 @@ public class TalentLocationUtils implements TencentLocationListener{
|
|||||||
currentLocationMsg.what = Constant.EVENT_WHAT_LOCATION_CHANGE;
|
currentLocationMsg.what = Constant.EVENT_WHAT_LOCATION_CHANGE;
|
||||||
currentLocationMsg.obj = Constant.currentLocation;
|
currentLocationMsg.obj = Constant.currentLocation;
|
||||||
EventBus.getDefault().post(currentLocationMsg);
|
EventBus.getDefault().post(currentLocationMsg);
|
||||||
|
}else if (i==TencentLocation.ERROR_NETWORK){//网络问题引起的定位失败
|
||||||
|
Message currentLocationMsg = Message.obtain();
|
||||||
|
currentLocationMsg.what = Constant.EVENT_MESSAGE;
|
||||||
|
currentLocationMsg.obj = "网络问题引起的定位失败";
|
||||||
|
EventBus.getDefault().post(currentLocationMsg);
|
||||||
|
}else if (i==TencentLocation.ERROR_BAD_JSON){//GPS, Wi-Fi 或基站错误引起的定位失败: 1、用户的手机确实采集不到定位凭据,比如偏远地区比如地下车库电梯内等; 2、开关跟权限问题,比如用户关闭了位置信息,关闭了Wi-Fi,未授予app定位权限等。
|
||||||
|
Message currentLocationMsg = Message.obtain();
|
||||||
|
currentLocationMsg.what = Constant.EVENT_MESSAGE;
|
||||||
|
currentLocationMsg.obj = "GPS, Wi-Fi 或基站错误引起的定位失败";
|
||||||
|
EventBus.getDefault().post(currentLocationMsg);
|
||||||
|
}else if (i==TencentLocation.ERROR_WGS84){
|
||||||
|
Message currentLocationMsg = Message.obtain();
|
||||||
|
currentLocationMsg.what = Constant.EVENT_MESSAGE;
|
||||||
|
currentLocationMsg.obj ="无法将WGS84坐标转换成GCJ-02坐标时的定位失败";
|
||||||
|
EventBus.getDefault().post(currentLocationMsg);
|
||||||
|
}else if (i==TencentLocation.ERROR_UNKNOWN){
|
||||||
|
Message currentLocationMsg = Message.obtain();
|
||||||
|
currentLocationMsg.what = Constant.EVENT_MESSAGE;
|
||||||
|
currentLocationMsg.obj ="未知原因引起的定位失败";
|
||||||
|
EventBus.getDefault().post(currentLocationMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user