diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 0cb8468..7fa9baf 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -56,5 +56,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 3d9d3c6..7fd56be 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -4,16 +4,16 @@ apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
android {
- compileSdkVersion 30
+ compileSdkVersion 32
buildToolsVersion '29.0.2'
//ndkVersion '23.0.7123448'
defaultConfig {
applicationId "com.navinfo.outdoor"
minSdkVersion 24
- targetSdkVersion 30
- versionCode 38
- versionName "8.221207"
+ targetSdkVersion 32
+ versionCode 39
+ versionName "8.221214"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
@@ -66,8 +66,8 @@ android {
//}
dependencies {
- implementation fileTree(dir: "libs", include: ["*.jar"])
- implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
+ implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.1.0'
@@ -160,8 +160,8 @@ dependencies {
implementation 'cn.jzvd:jiaozivideoplayer:7.4.2'
//图片压缩 https://github.com/Hu12037102/ImageCompress
implementation 'com.github.Hu12037102:ImageCompress:2.3.0'
- //webp 转换
- implementation 'com.wanghong.webpnative:webpnative:0.1.0'
+// //webp 转换
+// implementation 'com.wanghong.webpnative:webpnative:0.1.0'
// 自动发送邮件 https://github.com/teprinciple/MailSender
implementation 'com.teprinciple:mailsender:1.2.0'
// // https://github.com/JiongBull/jlog/blob/master/README_ZH.md 日志记录
diff --git a/app/libs/webpnative-0.1.0.aar b/app/libs/webpnative-0.1.0.aar
new file mode 100644
index 0000000..d7b2f5b
Binary files /dev/null and b/app/libs/webpnative-0.1.0.aar differ
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index db73bc6..7068e75 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -58,27 +58,32 @@
android:supportsRtl="true"
android:theme="@style/Theme.WhiteScreen"
tools:targetApi="n">
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ android:launchMode="singleTop"
+ android:exported="true"/>
+ android:launchMode="singleTop"
+ android:exported="true"/>
+ android:launchMode="singleTop"
+ android:exported="true"/>
+ android:screenOrientation="portrait"
+ android:exported="true">
diff --git a/app/src/main/java/com/navinfo/outdoor/activity/AutoTakePictureActivity.java b/app/src/main/java/com/navinfo/outdoor/activity/AutoTakePictureActivity.java
index 5967873..33e72b5 100644
--- a/app/src/main/java/com/navinfo/outdoor/activity/AutoTakePictureActivity.java
+++ b/app/src/main/java/com/navinfo/outdoor/activity/AutoTakePictureActivity.java
@@ -81,6 +81,8 @@ import com.navinfo.outdoor.util.GPSUtils;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
import com.navinfo.outdoor.util.Gps;
+import com.navinfo.outdoor.util.LocationLifeCycle;
+import com.navinfo.outdoor.util.MyLocation;
import com.navinfo.outdoor.util.MyTecentLocationSource;
import com.navinfo.outdoor.util.NaviUtils;
import com.navinfo.outdoor.util.PreserveUtils;
@@ -574,20 +576,18 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
// 在数据库中记录照片、轨迹位置以及卫星颗数
LocationRecorder recorder = new LocationRecorder();
recorder.setTime(Long.parseLong(file.getName()));
- recorder.setTencentLocationX(Constant.currentLocation.getLongitude());
- recorder.setTencentLocationY(Constant.currentLocation.getLatitude());
- gpsLocation = GPSUtils.getInstance(AutoTakePictureActivity.this).getLocation();
+ // 记录主定位方式
+ recorder.setTencentLocationX(LocationLifeCycle.getInstance().getMainLocation().getLongitude());
+ recorder.setTencentLocationY(LocationLifeCycle.getInstance().getMainLocation().getLatitude());
+ // 记录辅助定位方式
+ MyLocation gpsLocation = LocationLifeCycle.getInstance().getReferenceLocation();
if (gpsLocation!=null) {
recorder.setGpsLocationX(gpsLocation.getLongitude());
recorder.setGpsLocationY(gpsLocation.getLatitude());
}
- if (Constant.currentLocation.getBearing() != 0) {
- recorder.setBearing(Constant.currentLocation.getBearing());
- } else {
- recorder.setBearing(Constant.currentLocation.getDirection());
- }
+ recorder.setBearing(LocationLifeCycle.getInstance().getMainLocation().getBearing());
recorder.setImgFileName(file.getAbsolutePath());
- recorder.setRssi(Constant.currentLocation.getGPSRssi());
+ recorder.setRssi(GPSUtils.getInstance(AutoTakePictureActivity.this).getSateliteCount());
recorder.setSatelliteCount(GPSUtils.getInstance(AutoTakePictureActivity.this).getSateliteCount());
Observable.just(recorder).observeOn(Schedulers.io())
.filter(roadMatchEntity -> roadMatchEntity!=null)
@@ -629,9 +629,9 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
}
});
}
- if (Constant.currentLocation != null) { //筛选从服务器获取到的数据
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) { //筛选从服务器获取到的数据
// 注意,此处只获取道路数据
- tencentMarkerUtils.initNetMarkerList(AutoTakePictureActivity.this, Constant.currentLocation, tencentMap, removables,
+ tencentMarkerUtils.initNetMarkerList(AutoTakePictureActivity.this, LocationLifeCycle.getInstance().getMainLocation(), tencentMap, removables,
"4"/*只获取道路数据*/,"0"/*只获取未领取的数据*/, removableHashMap, 50, new TencentMarkerUtils.MarkerInitCallback() {
@Override
@@ -934,7 +934,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
return;
}
// RxJava处理,子线程中做后台计算路径规划
- Geometry currentGeometry = GeometryTools.createGeometry(new double[]{Constant.currentLocation.getLongitude(), Constant.currentLocation.getLatitude()});
+ Geometry currentGeometry = GeometryTools.createGeometry(new double[]{LocationLifeCycle.getInstance().getMainLocation().getLongitude(), LocationLifeCycle.getInstance().getMainLocation().getLatitude()});
Observable.create(
new ObservableOnSubscribe() {
@Override
@@ -983,7 +983,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
// 显示导航类型选择的对话框
Constant.currentNaviType = nav_type;
try {
- tencentNaviManager = NaviUtils.getInstance().searchRouteOnly(AutoTakePictureActivity.this, Constant.currentNaviType, new NaviPoi(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), new NaviPoi(endPoint.getY(), endPoint.getX()), routeSearchCallback);
+ tencentNaviManager = NaviUtils.getInstance().searchRouteOnly(AutoTakePictureActivity.this, Constant.currentNaviType, new NaviPoi(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()), new NaviPoi(endPoint.getY(), endPoint.getX()), routeSearchCallback);
} catch (Exception e) {
e.printStackTrace();
com.github.lazylibrary.util.ToastUtils.showToast(AutoTakePictureActivity.this, e.getMessage());
@@ -992,7 +992,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
});
} else {
// 已选择导航方式
- tencentNaviManager = NaviUtils.getInstance().searchRouteOnly(AutoTakePictureActivity.this, Constant.currentNaviType, new NaviPoi(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), new NaviPoi(endPoint.getY(), endPoint.getX()), routeSearchCallback);
+ tencentNaviManager = NaviUtils.getInstance().searchRouteOnly(AutoTakePictureActivity.this, Constant.currentNaviType, new NaviPoi(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()), new NaviPoi(endPoint.getY(), endPoint.getX()), routeSearchCallback);
}
} catch (Exception e) {
e.printStackTrace();
@@ -1422,7 +1422,10 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
* 开始记录位置信息
* */
private void startRecordLocation() {
- handler.sendEmptyMessage(0x101);
+ // 只有以前不记录照片,此刻才需要发送新的消息开始拍摄
+ if (!handler.hasMessages(0x101)) {
+ handler.sendEmptyMessage(0x101);
+ }
}
/**
* 停止记录位置信息
@@ -1451,9 +1454,9 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
setLocMarkerStyle(MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER);
break;
case R.id.iv_location://定位:
- if (Constant.currentLocation != null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) {
CameraUpdate cameraSigma = CameraUpdateFactory
- .newCameraPosition(new CameraPosition(new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标,地图目标经纬度
+ .newCameraPosition(new CameraPosition(new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()), //中心点坐标,地图目标经纬度
17, //目标缩放级别
0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
0)); //目标旋转角 0~360° (正北方为0)
@@ -1654,9 +1657,6 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
editor.putString("match-data", gson.toJson(roadMatchEntityList));
editor.commit();
}
- if (gpsUtils!=null) {
- gpsUtils.unRegisterAllListener();
- }
if (mediaPlayer!=null) {
mediaPlayer.release();
}
@@ -1757,16 +1757,17 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
*/
public void addTrackMarker() {
LatLng latLng = null;
- if (Constant.currentLocation.getGPSRssi() != 0) {
- latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
- } else {
- if (gpsLocation == null) {
- latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
- } else {
- double[] doubles = Gps.toGCJ02Point(gpsLocation.getLatitude(), gpsLocation.getLongitude());
- latLng = new LatLng(doubles[0],doubles[1]);
- }
- }
+ latLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude());
+// if (GPSUtils.getInstance(AutoTakePictureActivity.this).getSateliteCount() != 0) {
+// latLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude());
+// } else {
+// if (gpsLocation == null) {
+// latLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude());
+// } else {
+// double[] doubles = Gps.toGCJ02Point(gpsLocation.getLatitude(), gpsLocation.getLongitude());
+// latLng = new LatLng(doubles[0],doubles[1]);
+// }
+// }
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng)
.icon(pileDescriptor)
.alpha(0.9f)
@@ -2069,7 +2070,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
bearing = getBearing(oldCurrentLocation.getX(), currentPoint.getX(), oldCurrentLocation.getY(), currentPoint.getY());
}
- float speed = Constant.currentLocation.getSpeed();//米/秒
+ float speed = LocationLifeCycle.getInstance().getMainLocation().getSpeed();//米/秒
if (speed != 0) {
speed = (speed * 3600 / 1000);//km/h
} else {
diff --git a/app/src/main/java/com/navinfo/outdoor/activity/LoginActivity.java b/app/src/main/java/com/navinfo/outdoor/activity/LoginActivity.java
index 720aa14..2dc6ac3 100644
--- a/app/src/main/java/com/navinfo/outdoor/activity/LoginActivity.java
+++ b/app/src/main/java/com/navinfo/outdoor/activity/LoginActivity.java
@@ -37,7 +37,6 @@ import com.navinfo.outdoor.util.APKVersionCodeUtils;
import com.navinfo.outdoor.util.Base64;
import com.navinfo.outdoor.util.Md5Util;
import com.navinfo.outdoor.util.TimestampUtil;
-import com.navinfo.outdoor.util.ToastUtil;
import com.navinfo.outdoor.util.ToastUtils;
import com.umeng.umcrash.UMCrash;
diff --git a/app/src/main/java/com/navinfo/outdoor/activity/MainActivity.java b/app/src/main/java/com/navinfo/outdoor/activity/MainActivity.java
index 186fbe4..48547a5 100644
--- a/app/src/main/java/com/navinfo/outdoor/activity/MainActivity.java
+++ b/app/src/main/java/com/navinfo/outdoor/activity/MainActivity.java
@@ -41,9 +41,6 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.http.UploadCallBack;
import com.navinfo.outdoor.util.APKVersionCodeUtils;
-import com.navinfo.outdoor.util.Base64;
-import com.navinfo.outdoor.util.Md5Util;
-import com.navinfo.outdoor.util.ToastUtil;
import com.navinfo.outdoor.util.ToastUtils;
diff --git a/app/src/main/java/com/navinfo/outdoor/activity/PictureActivity.java b/app/src/main/java/com/navinfo/outdoor/activity/PictureActivity.java
index d079685..1aa3e50 100644
--- a/app/src/main/java/com/navinfo/outdoor/activity/PictureActivity.java
+++ b/app/src/main/java/com/navinfo/outdoor/activity/PictureActivity.java
@@ -33,6 +33,7 @@ import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.AWMp4ParserHelper;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.MyTecentLocationSource;
import com.navinfo.outdoor.util.ToastUtils;
import com.otaliastudios.cameraview.CameraException;
@@ -476,10 +477,10 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
tencentMap.animateCamera(cameraUpdateOut);
break;
case R.id.iv_location://定位:
- if (Constant.currentLocation != null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) {
CameraUpdate cameraSigma =
CameraUpdateFactory.newCameraPosition(new CameraPosition(
- new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标,地图目标经纬度
+ new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()), //中心点坐标,地图目标经纬度
tencentMap.getCameraPosition().zoom, //目标缩放级别
0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
0)); //目标旋转角 0~360° (正北方为0)
@@ -722,17 +723,17 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
sb.append(",");
sb.append(currentVideoTime);// 记录视频时间
sb.append(",");
- sb.append(Constant.currentLocation.getLatitude());
+ sb.append(LocationLifeCycle.getInstance().getMainLocation().getLatitude());
sb.append(",");
- sb.append(Constant.currentLocation.getLongitude());
+ sb.append(LocationLifeCycle.getInstance().getMainLocation().getLongitude());
sb.append(",");
- if (Constant.currentLocation.getBearing() != 0) {
- sb.append(Constant.currentLocation.getBearing());
+ if (LocationLifeCycle.getInstance().getTencentLocation().getBearing() != 0) {
+ sb.append(LocationLifeCycle.getInstance().getMainLocation().getBearing());
} else {
- sb.append(Constant.currentLocation.getDirection());
+ sb.append(LocationLifeCycle.getInstance().getTencentLocation().getDirection());
}
sb.append("\r\n");
- LatLng latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
+ LatLng latLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude());
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.circle);
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng)
.icon(pileDescriptor)
diff --git a/app/src/main/java/com/navinfo/outdoor/activity/PicturesActivity.java b/app/src/main/java/com/navinfo/outdoor/activity/PicturesActivity.java
index b4edc8d..f9b07d0 100644
--- a/app/src/main/java/com/navinfo/outdoor/activity/PicturesActivity.java
+++ b/app/src/main/java/com/navinfo/outdoor/activity/PicturesActivity.java
@@ -50,6 +50,8 @@ import com.navinfo.outdoor.util.GPSUtils;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
import com.navinfo.outdoor.util.Gps;
+import com.navinfo.outdoor.util.LocationLifeCycle;
+import com.navinfo.outdoor.util.MyLocation;
import com.navinfo.outdoor.util.MyTecentLocationSource;
import com.navinfo.outdoor.util.SystemTTS;
import com.navinfo.outdoor.util.TimestampUtil;
@@ -137,14 +139,13 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
private CheckBox capturePicture; //拍照
private File paperFile, logFile;
private ImageView ivZoomAdd, ivZoomDel, ivLocation, ivPicRoadImage, ivPicVideoImage, imageView;
- private TencentLocation oldCurrentLocation = null;
+ private MyLocation oldCurrentLocation = null;
private Timer timer;
private TimerTask timerTask;
private SystemTTS systemTTS;
private StringBuilder picturesBuilder;
private LatLng startLatLine, endLatLine;
private TextView tvTitle, tvConvert/*照片已转换为webp的张数*/;
- private Location gpsLocation;
private boolean isMapSlide = false;
private boolean isOration = true; // 当前是否为自动拍照模式
private boolean isTerminus = false;
@@ -685,9 +686,9 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
break;
case R.id.iv_location://定位:
picturesBuilder.append(TimestampUtil.time()).append(",").append("onClick 点击了定位 ,");
- if (Constant.currentLocation != null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) {
CameraUpdate cameraSigma = CameraUpdateFactory
- .newCameraPosition(new CameraPosition(new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标,地图目标经纬度
+ .newCameraPosition(new CameraPosition(new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()), //中心点坐标,地图目标经纬度
17, //目标缩放级别
0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
0)); //目标旋转角 0~360° (正北方为0)
@@ -932,33 +933,29 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
sb.append(index == -1 ? 0 : index);//個數
startVideoIndex = index == -1 ? 0 : index;
sb.append(",");
- sb.append(Constant.currentLocation.getLatitude());
+ sb.append(LocationLifeCycle.getInstance().getMainLocation().getLatitude());
sb.append(",");
- sb.append(Constant.currentLocation.getLongitude());
+ sb.append(LocationLifeCycle.getInstance().getMainLocation().getLongitude());
sb.append(",");
- if (Constant.currentLocation.getBearing() != 0) {
- sb.append(Constant.currentLocation.getBearing());
- } else {
- sb.append(Constant.currentLocation.getDirection());
- }
+ sb.append(LocationLifeCycle.getInstance().getMainLocation().getBearing());
sb.append(",");
- int gpsRssi = Constant.currentLocation.getGPSRssi();
+ int gpsRssi = GPSUtils.getInstance(PicturesActivity.this).getSateliteCount();
if (gpsRssi == 0) {
sb.append("无信号");
sb.append(",");
- } else if (gpsRssi == 1) {
+ } else if (gpsRssi <= 3) {
sb.append("弱");
sb.append(",");
- } else if (gpsRssi == 2) {
+ } else if (gpsRssi <= 8) {
sb.append("中");
sb.append(",");
- } else if (gpsRssi == 3) {
+ } else {
sb.append("强");
sb.append(",");
}
sb.append(GPSUtils.getInstance(PicturesActivity.this).getSateliteCount());
sb.append(",");
- gpsLocation = GPSUtils.getInstance(PicturesActivity.this).getLocation();
+ MyLocation gpsLocation = LocationLifeCycle.getInstance().getReferenceLocation();
if (gpsLocation != null) {
// double[] doubles = Gps.toGCJ02Point(gpsLocation.getLatitude(), gpsLocation.getLongitude());
sb.append(gpsLocation.getLatitude());
@@ -983,9 +980,9 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
}
private void initTerminus() {
- if (Constant.currentLocation != null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) {
if (endLatLine != null && startLatLine != null) {
- LatLng newLatLine = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
+ LatLng newLatLine = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude());
double startDistance = GeometryTools.distanceToDouble(newLatLine, startLatLine);
double endDistance = GeometryTools.distanceToDouble(newLatLine, endLatLine);
if (startDistance > endDistance) { //endDistance: 起点 startDistance:终点
@@ -1008,7 +1005,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
if (isSpeedLimitTips == true) {
return;
}
- float speed = Constant.currentLocation.getSpeed();//米/秒
+ float speed = LocationLifeCycle.getInstance().getMainLocation().getSpeed();//米/秒
if (speed != 0) {
float a = (speed * 3600 / 1000);//km/h
if (type == 3) {
@@ -1027,7 +1024,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
} else {
if (oldCurrentLocation != null) {
LatLng startLatLng = new LatLng(oldCurrentLocation.getLatitude(), oldCurrentLocation.getLongitude());//旧的坐标
- LatLng endLatLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());//新的坐标
+ LatLng endLatLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude());//新的坐标
double geometry = GeometryTools.distanceToDouble(startLatLng, endLatLng);//米
if (type == 3) {
if (radioPicture == 2) {
@@ -1063,7 +1060,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
}
}
}
- oldCurrentLocation = Constant.currentLocation;
+ oldCurrentLocation = LocationLifeCycle.getInstance().getMainLocation();
}
}
@@ -1134,16 +1131,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
*/
public void initMarker(boolean isOration) {
LatLng latLng = null;
- if (isOration) {
- latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
- } else {
- if (gpsLocation == null) {
- latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
- } else {
- double[] doubles = Gps.toGCJ02Point(gpsLocation.getLatitude(), gpsLocation.getLongitude());
- latLng = new LatLng(doubles[0],doubles[1]);
- }
- }
+ latLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude());
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory
.fromResource(R.drawable.circle);
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng)
diff --git a/app/src/main/java/com/navinfo/outdoor/api/Constant.java b/app/src/main/java/com/navinfo/outdoor/api/Constant.java
index dce0f2e..60b5aad 100644
--- a/app/src/main/java/com/navinfo/outdoor/api/Constant.java
+++ b/app/src/main/java/com/navinfo/outdoor/api/Constant.java
@@ -231,14 +231,13 @@ public class Constant {
public static String getRssiDesStr(int rssi) {
if (rssi == 0) {
return "无信号";
- } else if (rssi == 1) {
+ } else if (rssi <= 3) {
return "弱";
- } else if (rssi == 2) {
+ } else if (rssi <= 8) {
return "中";
- } else if (rssi == 3) {
+ } else {
return "强";
}
- return "无信号"; // 默认为无信号
}
public static Set submitIdSet = new HashSet<>();
diff --git a/app/src/main/java/com/navinfo/outdoor/base/BaseDrawerFragment.java b/app/src/main/java/com/navinfo/outdoor/base/BaseDrawerFragment.java
index a7103ab..d1da9e5 100644
--- a/app/src/main/java/com/navinfo/outdoor/base/BaseDrawerFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/base/BaseDrawerFragment.java
@@ -13,6 +13,7 @@ import androidx.annotation.NonNull;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.room.ChargingPileEntity;
import com.navinfo.outdoor.room.PoiEntity;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.MapManager;
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
import com.tencent.tencentmap.mapsdk.maps.CameraUpdate;
@@ -36,9 +37,9 @@ public abstract class BaseDrawerFragment extends BaseFragment {
protected void initData() {
tencentMap = MapManager.getInstance().getTencentMap();
super.initData();
- if (Constant.currentLocation!=null){
- int mockGps = Constant.currentLocation.isMockGps();
- int gpsRssi = Constant.currentLocation.getGPSRssi();//无信号,信号弱,信号中,信号强
+ if (LocationLifeCycle.getInstance().getTencentLocation()!=null){
+ int mockGps = LocationLifeCycle.getInstance().getTencentLocation().isMockGps();
+ int gpsRssi = LocationLifeCycle.getInstance().getTencentLocation().getGPSRssi();//无信号,信号弱,信号中,信号强
//1为是,0为否,-1为无法判断
if (mockGps == 1) {
onBackPressed();
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/AreaHubFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/AreaHubFragment.java
index 9a8e44f..4567719 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/AreaHubFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/AreaHubFragment.java
@@ -61,6 +61,7 @@ import com.navinfo.outdoor.util.DataSaveUtils;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.PoiSaveUtils;
import com.navinfo.outdoor.util.PreserveUtils;
import com.navinfo.outdoor.util.TimestampUtil;
@@ -518,8 +519,8 @@ public class AreaHubFragment extends BaseDrawerFragment implements View.OnClickL
public void onClick(View v) {
if (spnRoadName.getTag()!=null) { // 用户已经设置楼层信息
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了拍摄的按钮 ,");
- double latitude = Constant.currentLocation.getLatitude();
- double longitude = Constant.currentLocation.getLongitude();
+ double latitude = LocationLifeCycle.getInstance().getMainLocation().getLatitude();
+ double longitude = LocationLifeCycle.getInstance().getMainLocation().getLongitude();
LatLng startLatLng = new LatLng(latitude, longitude);// 用户当前位置
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);// 起點 于用戶的距離
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);// 終點于用戶的距離
@@ -540,7 +541,7 @@ public class AreaHubFragment extends BaseDrawerFragment implements View.OnClickL
intents.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
intents.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
intents.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
- int gpsRssi = Constant.currentLocation.getGPSRssi();
+ int gpsRssi = LocationLifeCycle.getInstance().getTencentLocation().getGPSRssi();
if (gpsRssi == 0) {
intents.putExtra(Constant.INTENT_BOOLEAN, false);
} else {
@@ -553,7 +554,7 @@ public class AreaHubFragment extends BaseDrawerFragment implements View.OnClickL
break;
case R.id.tv_combo://自动连拍:
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了自动连拍的按钮 ,");
- LatLng startLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()); //用户当前位置
+ LatLng startLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()); //用户当前位置
double geom = GeometryTools.distanceToDouble(startLng, latLng);
double rearGeom = GeometryTools.distanceToDouble(startLng, rearLatLng);
if (geom > rearGeom) {//用戶在终点开始作业
@@ -573,7 +574,7 @@ public class AreaHubFragment extends BaseDrawerFragment implements View.OnClickL
intent.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
intent.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
intent.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
- int gpsRss = Constant.currentLocation.getGPSRssi();
+ int gpsRss = LocationLifeCycle.getInstance().getTencentLocation().getGPSRssi();
if (gpsRss == 0) {
intent.putExtra(Constant.INTENT_BOOLEAN, false);
} else {
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/BuildingInsideFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/BuildingInsideFragment.java
index d0e3f12..24ab090 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/BuildingInsideFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/BuildingInsideFragment.java
@@ -56,6 +56,7 @@ import com.navinfo.outdoor.util.DataSaveUtils;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.PoiSaveUtils;
import com.navinfo.outdoor.util.PreserveUtils;
import com.navinfo.outdoor.util.TimestampUtil;
@@ -451,8 +452,8 @@ public class BuildingInsideFragment extends BaseDrawerFragment implements View.O
break;
case R.id.tv_short://点击拍摄
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了拍摄的按钮 ,");
- double latitude = Constant.currentLocation.getLatitude();
- double longitude = Constant.currentLocation.getLongitude();
+ double latitude = LocationLifeCycle.getInstance().getMainLocation().getLatitude();
+ double longitude = LocationLifeCycle.getInstance().getMainLocation().getLongitude();
LatLng startLatLng = new LatLng(latitude, longitude);// 用户当前位置
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);// 起點 于用戶的距離
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);// 終點于用戶的距離
@@ -473,7 +474,7 @@ public class BuildingInsideFragment extends BaseDrawerFragment implements View.O
intents.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
intents.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
intents.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
- int gpsRssi = Constant.currentLocation.getGPSRssi();
+ int gpsRssi = LocationLifeCycle.getInstance().getTencentLocation().getGPSRssi();
if (gpsRssi == 0) {
intents.putExtra(Constant.INTENT_BOOLEAN, false);
} else {
@@ -483,7 +484,7 @@ public class BuildingInsideFragment extends BaseDrawerFragment implements View.O
break;
case R.id.tv_combo://自动连拍:
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了自动连拍的按钮 ,");
- LatLng startLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()); //用户当前位置
+ LatLng startLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()); //用户当前位置
double geom = GeometryTools.distanceToDouble(startLng, latLng);
double rearGeom = GeometryTools.distanceToDouble(startLng, rearLatLng);
if (geom > rearGeom) {//用戶在终点开始作业
@@ -503,7 +504,7 @@ public class BuildingInsideFragment extends BaseDrawerFragment implements View.O
intent.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
intent.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
intent.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
- int gpsRss = Constant.currentLocation.getGPSRssi();
+ int gpsRss = LocationLifeCycle.getInstance().getTencentLocation().getGPSRssi();
if (gpsRss == 0) {
intent.putExtra(Constant.INTENT_BOOLEAN, false);
} else {
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java
index e7dc0d9..af32607 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingPileFragment.java
@@ -52,7 +52,6 @@ import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
import com.navinfo.outdoor.util.PhotoUtils;
import com.navinfo.outdoor.util.TimestampUtil;
-import com.navinfo.outdoor.util.ToastUtil;
import com.navinfo.outdoor.util.ToastUtils;
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java
index 5c75fa0..be15c82 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/GatherGetFragment.java
@@ -44,6 +44,7 @@ import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.NaviUtils;
import com.navinfo.outdoor.util.TimestampUtil;
import com.navinfo.outdoor.util.ToastUtils;
@@ -204,12 +205,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
public void selectNaviType(Constant.NAV_TYPE nav_type) {
// 显示导航类型选择的对话框
Constant.currentNaviType = nav_type;
- NaviUtils.getInstance().startNav(getActivity(), new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), new LatLng(Double.parseDouble(poiEntity.getY()), Double.parseDouble(poiEntity.getX())));
+ NaviUtils.getInstance().startNav(getActivity(), new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()), new LatLng(Double.parseDouble(poiEntity.getY()), Double.parseDouble(poiEntity.getX())));
}
});
} else {
// 已选择导航方式
- NaviUtils.getInstance().startNav(getActivity(), new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), new LatLng(Double.parseDouble(poiEntity.getY()), Double.parseDouble(poiEntity.getX())));
+ NaviUtils.getInstance().startNav(getActivity(), new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()), new LatLng(Double.parseDouble(poiEntity.getY()), Double.parseDouble(poiEntity.getX())));
}
}
});
@@ -311,8 +312,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
case R.id.btn_gather://立即采集
gatherGetBuilder.append(TimestampUtil.time()).append(",").append("点击了立即采集的按钮 ,");
if (poiEntity.getTaskStatus() < 2) {
- double latitude = Constant.currentLocation.getLatitude();
- double longitude = Constant.currentLocation.getLongitude();
+ double latitude = LocationLifeCycle.getInstance().getMainLocation().getLatitude();
+ double longitude = LocationLifeCycle.getInstance().getMainLocation().getLongitude();
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
LatLng endLatLng = new LatLng(Double.parseDouble(poiEntity.getY()), Double.parseDouble(poiEntity.getX()));
double geometry = GeometryTools.distanceToDouble(startLatLng, endLatLng);
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/HasSubmitFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/HasSubmitFragment.java
index d92ab6b..b59bf5b 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/HasSubmitFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/HasSubmitFragment.java
@@ -34,7 +34,6 @@ import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.TimestampUtil;
-import com.navinfo.outdoor.util.ToastUtil;
import com.navinfo.outdoor.util.ToastUtils;
import org.greenrobot.eventbus.EventBus;
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/PoiTaskFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/PoiTaskFragment.java
index abc20ff..70681c1 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/PoiTaskFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/PoiTaskFragment.java
@@ -31,6 +31,7 @@ import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.FlushTokenUtil;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.TimestampUtil;
import com.navinfo.outdoor.util.ToastUtils;
import com.umeng.commonsdk.debug.D;
@@ -139,7 +140,7 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
assert getArguments() != null;
type = getArguments().getInt("type", 0);
listBeans = new ArrayList<>();
- if (Constant.currentLocation != null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) {
if (Constant.USHERED != null) {
initWork(type, true);
}
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/PoiVideoFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/PoiVideoFragment.java
index ff070fa..b64bf82 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/PoiVideoFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/PoiVideoFragment.java
@@ -56,6 +56,7 @@ import com.navinfo.outdoor.util.DataSaveUtils;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.PoiSaveUtils;
import com.navinfo.outdoor.util.PreserveUtils;
import com.navinfo.outdoor.util.TimestampUtil;
@@ -438,8 +439,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
break;
case R.id.tv_short://点击拍摄
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了拍摄的按钮 ,");
- double latitude = Constant.currentLocation.getLatitude();
- double longitude = Constant.currentLocation.getLongitude();
+ double latitude = LocationLifeCycle.getInstance().getMainLocation().getLatitude();
+ double longitude = LocationLifeCycle.getInstance().getMainLocation().getLongitude();
LatLng startLatLng = new LatLng(latitude, longitude);// 用户当前位置
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);// 起點 于用戶的距離
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);// 終點于用戶的距離
@@ -460,7 +461,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
intents.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
intents.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
intents.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
- int gpsRssi = Constant.currentLocation.getGPSRssi();
+ int gpsRssi = LocationLifeCycle.getInstance().getTencentLocation().getGPSRssi();
if (gpsRssi == 0) {
intents.putExtra(Constant.INTENT_BOOLEAN, false);
} else {
@@ -470,7 +471,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
break;
case R.id.tv_combo://自动连拍:
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了自动连拍的按钮 ,");
- LatLng startLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()); //用户当前位置
+ LatLng startLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()); //用户当前位置
double geom = GeometryTools.distanceToDouble(startLng, latLng);
double rearGeom = GeometryTools.distanceToDouble(startLng, rearLatLng);
if (geom > rearGeom) {//用戶在终点开始作业
@@ -490,7 +491,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
intent.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
intent.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
intent.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
- int gpsRss = Constant.currentLocation.getGPSRssi();
+ int gpsRss = LocationLifeCycle.getInstance().getTencentLocation().getGPSRssi();
if (gpsRss == 0) {
intent.putExtra(Constant.INTENT_BOOLEAN, false);
} else {
@@ -837,8 +838,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
Calendar calendars = Calendar.getInstance();
calendars.setTimeInMillis(System.currentTimeMillis());
String formats = formatter.format(calendars.getTime());
- String city = Constant.currentLocation.getCity();//返回当前位置的城市.
- String district = Constant.currentLocation.getDistrict();//返回当前位置的区县.
+ String city = LocationLifeCycle.getInstance().getTencentLocation().getCity();//返回当前位置的城市.
+ String district = LocationLifeCycle.getInstance().getTencentLocation().getDistrict();//返回当前位置的区县.
StringBuilder sb = new StringBuilder("poi录像上报");
if (city != null && !"".equals(city)) {
sb.append("-");
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/RoadFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/RoadFragment.java
index 9377cb7..05fb5fb 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/RoadFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/RoadFragment.java
@@ -46,6 +46,7 @@ import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.util.DataSaveUtils;
import com.navinfo.outdoor.util.FlushTokenUtil;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.PoiSaveUtils;
import com.navinfo.outdoor.util.PreserveUtils;
import com.navinfo.outdoor.util.TimestampUtil;
@@ -511,8 +512,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
break;
case R.id.tv_pictures:
roadBuilder.append(TimestampUtil.time()).append(",").append("点击了自动拍照的按钮 ,");
- double latitude = Constant.currentLocation.getLatitude();
- double longitude = Constant.currentLocation.getLongitude();
+ double latitude = LocationLifeCycle.getInstance().getMainLocation().getLatitude();
+ double longitude = LocationLifeCycle.getInstance().getMainLocation().getLongitude();
LatLng startLatLng = new LatLng(latitude, longitude);//用户当前位置
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);
@@ -563,7 +564,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
// intent.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
// intent.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
// intent.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
-// int gpsRssi = Constant.currentLocation.getGPSRssi();
+// int gpsRssi = LocationLifeCycle.getInstance().getMainLocation().getGPSRssi();
// if (gpsRssi == 0) {
// intent.putExtra(Constant.INTENT_BOOLEAN, false);
// } else {
@@ -581,7 +582,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
intent.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
intent.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
intent.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
- int gpsRssi = Constant.currentLocation.getGPSRssi();
+ int gpsRssi = LocationLifeCycle.getInstance().getTencentLocation().getGPSRssi();
if (gpsRssi == 0) {
intent.putExtra(Constant.INTENT_BOOLEAN, false);
} else {
@@ -935,8 +936,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
Calendar calendars = Calendar.getInstance();
calendars.setTimeInMillis(System.currentTimeMillis());
String formats = formatter.format(calendars.getTime());
- String city = Constant.currentLocation.getCity();//返回当前位置的城市.
- String district = Constant.currentLocation.getDistrict();//返回当前位置的区县.
+ String city = LocationLifeCycle.getInstance().getTencentLocation().getCity();//返回当前位置的城市.
+ String district = LocationLifeCycle.getInstance().getTencentLocation().getDistrict();//返回当前位置的区县.
StringBuffer sb = new StringBuffer("道路录像上报");
if (city != null && !"".equals(city)) {
sb.append("-");
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/StaySubmitFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/StaySubmitFragment.java
index 6272f0a..7e3b3c9 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/StaySubmitFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/StaySubmitFragment.java
@@ -40,6 +40,7 @@ import com.navinfo.outdoor.room.PoiDao;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.FlushTokenUtil;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.PoiEntityDeleteUtil;
import com.navinfo.outdoor.util.PoiSaveUtils;
import com.navinfo.outdoor.util.TimestampUtil;
@@ -141,7 +142,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
@Override
public void onResume() {
super.onResume();
- if (Constant.currentLocation != null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) {
if (Constant.USHERED != null) {
cbSelect.setChecked(false);
refreshData();
@@ -180,7 +181,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
public void onEvent(Message data) {
if (data.what == Constant.STAY_SUBMIT_ITEM) {
if ((boolean) data.obj) {
- if (Constant.currentLocation != null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) {
if (Constant.USHERED != null) {
if (cbSelect != null) {
cbSelect.setChecked(false);
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/TrafficHubFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/TrafficHubFragment.java
index b6f6a13..8c66963 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/TrafficHubFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/TrafficHubFragment.java
@@ -56,6 +56,7 @@ import com.navinfo.outdoor.util.DataSaveUtils;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.PoiSaveUtils;
import com.navinfo.outdoor.util.PreserveUtils;
import com.navinfo.outdoor.util.TimestampUtil;
@@ -451,8 +452,8 @@ public class TrafficHubFragment extends BaseDrawerFragment implements View.OnCli
break;
case R.id.tv_short://点击拍摄
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了拍摄的按钮 ,");
- double latitude = Constant.currentLocation.getLatitude();
- double longitude = Constant.currentLocation.getLongitude();
+ double latitude = LocationLifeCycle.getInstance().getMainLocation().getLatitude();
+ double longitude = LocationLifeCycle.getInstance().getMainLocation().getLongitude();
LatLng startLatLng = new LatLng(latitude, longitude);// 用户当前位置
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);// 起點 于用戶的距離
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);// 終點于用戶的距離
@@ -473,7 +474,7 @@ public class TrafficHubFragment extends BaseDrawerFragment implements View.OnCli
intents.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
intents.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
intents.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
- int gpsRssi = Constant.currentLocation.getGPSRssi();
+ int gpsRssi = LocationLifeCycle.getInstance().getTencentLocation().getGPSRssi();
if (gpsRssi == 0) {
intents.putExtra(Constant.INTENT_BOOLEAN, false);
} else {
@@ -483,7 +484,7 @@ public class TrafficHubFragment extends BaseDrawerFragment implements View.OnCli
break;
case R.id.tv_combo://自动连拍:
poiVideoBuilder.append(TimestampUtil.time()).append(",").append("点击了自动连拍的按钮 ,");
- LatLng startLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()); //用户当前位置
+ LatLng startLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()); //用户当前位置
double geom = GeometryTools.distanceToDouble(startLng, latLng);
double rearGeom = GeometryTools.distanceToDouble(startLng, rearLatLng);
if (geom > rearGeom) {//用戶在终点开始作业
@@ -503,7 +504,7 @@ public class TrafficHubFragment extends BaseDrawerFragment implements View.OnCli
intent.putExtra(Constant.INTENT_TYPE, showPoiEntity.getType());
intent.putExtra(Constant.INTENT_GEO_WKT, showPoiEntity.getGeoWkt());
intent.putExtra(Constant.INTENT_DETAIL, showPoiEntity.getDetail());
- int gpsRss = Constant.currentLocation.getGPSRssi();
+ int gpsRss = LocationLifeCycle.getInstance().getTencentLocation().getGPSRssi();
if (gpsRss == 0) {
intent.putExtra(Constant.INTENT_BOOLEAN, false);
} else {
diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java
index 81258ef..402b130 100644
--- a/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java
+++ b/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java
@@ -20,12 +20,15 @@ import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
+import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
@@ -81,6 +84,7 @@ import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
+import com.navinfo.outdoor.util.LocationLifeCycle;
import com.navinfo.outdoor.util.MapManager;
import com.navinfo.outdoor.util.MyTecentLocationSource;
import com.navinfo.outdoor.util.NaviUtils;
@@ -169,6 +173,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private File logFile;
private StringBuilder treasureBuilder;
private Marker gatherMarker;
+ private long lastClickTime = 0;
+ private int settingHookClickCount = 1;
private Handler handler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(@NonNull Message msg) {
@@ -268,11 +274,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
tencentMap.addOnMapLoadedCallback(new TencentMap.OnMapLoadedCallback() {
@Override
public void onMapLoaded() {
- if (Constant.currentLocation != null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) {
// 地图中心点位置设置为当前用户所在位置
CameraUpdate cameraSigma =
CameraUpdateFactory.newCameraPosition(new CameraPosition(
- new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标,地图目标经纬度
+ new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()), //中心点坐标,地图目标经纬度
17, //目标缩放级别
0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
0)); //目标旋转角 0~360° (正北方为0)
@@ -301,7 +307,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
dismissLoadingDialog();
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);
- ToastUtils.Message(getActivity(), "请先开启位置信息,在重新打开程序");
+ ToastUtils.Message(getActivity(), "请先开启位置信息,再重新打开程序");
getActivity().finish();
}
Constant.markerClickListener = markerClickListener;
@@ -377,6 +383,73 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
}
});
+
+ // 内部测试功能
+ ImageView imgViewSettingHook = findViewById(R.id.image_view);
+ imgViewSettingHook.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ View layer = findViewById(R.id.layer_visiable_setting);
+ if (layer.isShown()) {
+ return;
+ }
+ settingHookClickCount++;
+ if(lastClickTime > 0){
+ long secondClickTime = System.currentTimeMillis();//距离上次开机时间
+ long dtime = secondClickTime - lastClickTime;
+ if(dtime <800){
+ if (settingHookClickCount>8) {
+ Toast.makeText(getContext(), "打开设置功能", Toast.LENGTH_SHORT).show();
+ layer.setVisibility(View.VISIBLE);
+ } else {
+ if (settingHookClickCount>3) {
+ Toast.makeText(getContext(), "再点击"+(9-settingHookClickCount)+"下打开设置功能", Toast.LENGTH_SHORT).show();
+ }
+ }
+ } else{
+ lastClickTime = 0;
+ settingHookClickCount = 1;
+ }
+ }
+ lastClickTime = System.currentTimeMillis();
+ }
+ });
+ Spinner spnBaseLocation = findViewById(R.id.spn_main_location);
+ Spinner spnRefrenceLocation = findViewById(R.id.spn_reference_location);
+ ArrayAdapter arrayAdapter = new ArrayAdapter(getActivity(), android.R.layout.simple_spinner_dropdown_item, android.R.id.text1, new String[]{"GPS", "腾讯"});
+ spnBaseLocation.setAdapter(arrayAdapter);
+ spnRefrenceLocation.setAdapter(arrayAdapter);
+ spnBaseLocation.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> adapterView, View view, int i, long l) {
+ if (i == 0) {
+ LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.ORIGIN);
+ } else if (i==1) {
+ LocationLifeCycle.getInstance().setMainLocationFrom(LocationLifeCycle.LOCATION_FROM.TENCENT);
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> adapterView) {
+
+ }
+ });
+
+ spnRefrenceLocation.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> adapterView, View view, int i, long l) {
+ if (i == 0) {
+ LocationLifeCycle.getInstance().setReferenceLocationFrom(LocationLifeCycle.LOCATION_FROM.ORIGIN);
+ } else if (i==1) {
+ LocationLifeCycle.getInstance().setReferenceLocationFrom(LocationLifeCycle.LOCATION_FROM.TENCENT);
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> adapterView) {
+
+ }
+ });
}
/**
@@ -389,7 +462,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
ivNaviDistance.setSelected(false);
return;
}
- Geometry currentGeometry = GeometryTools.createGeometry(new double[]{Constant.currentLocation.getLongitude(), Constant.currentLocation.getLatitude()});
+ Geometry currentGeometry = GeometryTools.createGeometry(new double[]{LocationLifeCycle.getInstance().getMainLocation().getLongitude(), LocationLifeCycle.getInstance().getMainLocation().getLatitude()});
Removable minRemoveable = removables.stream().filter(new Predicate() {
@Override
public boolean test(Removable removable) {
@@ -424,12 +497,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
public void selectNaviType(Constant.NAV_TYPE nav_type) {
// 显示导航类型选择的对话框
Constant.currentNaviType = nav_type;
- NaviUtils.getInstance().startNav(getActivity(), new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), new LatLng(endPoint.getY(), endPoint.getX()));
+ NaviUtils.getInstance().startNav(getActivity(), new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()), new LatLng(endPoint.getY(), endPoint.getX()));
}
});
} else {
// 已选择导航方式
- NaviUtils.getInstance().startNav(getActivity(), new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), new LatLng(endPoint.getY(), endPoint.getX()));
+ NaviUtils.getInstance().startNav(getActivity(), new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()), new LatLng(endPoint.getY(), endPoint.getX()));
}
}
@@ -493,8 +566,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
});
}
- if (Constant.currentLocation != null) { //筛选从服务器获取到的数据
- tencentMarkerUtils.initNetMarkerList(getActivity(), Constant.currentLocation, tencentMap, removables,null, null, removableHashMap, 200, new TencentMarkerUtils.MarkerInitCallback() {
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) { //筛选从服务器获取到的数据
+ tencentMarkerUtils.initNetMarkerList(getActivity(), LocationLifeCycle.getInstance().getMainLocation(), tencentMap, removables,null, null, removableHashMap, 200, new TencentMarkerUtils.MarkerInitCallback() {
@Override
public void onMarkerInit(Map> removableHashMap, List uploadByNet, List listData) {
@@ -602,7 +675,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
/* 得到电话区号,电话位数*/
private void initPhone() {
- String encode = Geohash.getInstance().encode(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
+ String encode = Geohash.getInstance().encode(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude());
if (encode == null) {
ToastUtils.Message(getActivity(), "没有确定经纬度");
return;
@@ -676,7 +749,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
/*上传用户位置*/
private void iniUserLocation() {
- String encode = Geohash.getInstance().encode(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
+ String encode = Geohash.getInstance().encode(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude());
HttpParams httpParams = new HttpParams();
if (encode != null) {
httpParams.put("geom", encode);
@@ -1280,9 +1353,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
break;
case R.id.iv_location://定位:
treasureBuilder.append(TimestampUtil.time()).append(",").append("点击了定位的按钮,");
- if (Constant.currentLocation != null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() != null) {
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
- new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()),//中心点坐标,地图目标经纬度
+ new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude()),//中心点坐标,地图目标经纬度
17,//目标缩放级别
0,//目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
0));//目标旋转角 0~360° (正北方为0)
@@ -1358,11 +1431,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
Bundle bundle = new Bundle();
PoiEntity poiEntity = new PoiEntity();
// 上报时以当前用户位置为准
- if (Constant.currentLocation == null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() == null) {
ToastUtils.Message(getActivity(), "无法获取当前位置,请检查GPS是否打开!");
return;
}
- LatLng newPoiLatLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
+ LatLng newPoiLatLng = new LatLng(LocationLifeCycle.getInstance().getMainLocation().getLatitude(), LocationLifeCycle.getInstance().getMainLocation().getLongitude());
poiEntity.setX(String.valueOf(newPoiLatLng.getLongitude()));
poiEntity.setY(String.valueOf(newPoiLatLng.getLatitude()));
bundle.putSerializable("poiEntity", poiEntity);
diff --git a/app/src/main/java/com/navinfo/outdoor/http/HttpInterface.java b/app/src/main/java/com/navinfo/outdoor/http/HttpInterface.java
index 720779c..e73822a 100644
--- a/app/src/main/java/com/navinfo/outdoor/http/HttpInterface.java
+++ b/app/src/main/java/com/navinfo/outdoor/http/HttpInterface.java
@@ -3,8 +3,8 @@ package com.navinfo.outdoor.http;
public class HttpInterface {
// public static final String IP = "http://172.23.138.133:9999/m4";//测试接口-IP
public static final String IPm = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发接口-外网
- public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试接口-外网
- public static final String IP1 = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
+ public static final String IP1 = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试接口-外网
+ public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
public static final String USER_PATH = "/user/";//我的
public static final String MSG_LIST_PATH = "/msgList/";//发现
public static final String USER_LOGIN_PATH = "/userlogin/";//登录
diff --git a/app/src/main/java/com/navinfo/outdoor/util/LocationLifeCycle.java b/app/src/main/java/com/navinfo/outdoor/util/LocationLifeCycle.java
index f53a361..fb6f02a 100644
--- a/app/src/main/java/com/navinfo/outdoor/util/LocationLifeCycle.java
+++ b/app/src/main/java/com/navinfo/outdoor/util/LocationLifeCycle.java
@@ -159,6 +159,10 @@ public class LocationLifeCycle implements DefaultLifecycleObserver {
ORIGIN, TENCENT, BAIDU, AMAP
}
+ public TencentLocation getTencentLocation() {
+ return tencentLocation;
+ }
+
private boolean checkInit() throws Exception {
if (this.mContext == null) {
throw new Exception("LocationLifeCycle 没有初始化!");
diff --git a/app/src/main/java/com/navinfo/outdoor/util/NaviUtils.java b/app/src/main/java/com/navinfo/outdoor/util/NaviUtils.java
index f5af4b4..8f5ce35 100644
--- a/app/src/main/java/com/navinfo/outdoor/util/NaviUtils.java
+++ b/app/src/main/java/com/navinfo/outdoor/util/NaviUtils.java
@@ -654,7 +654,7 @@ public class NaviUtils {
* 开始路径规划
* */
public void startNav(Activity mContext, LatLng startLatlng, LatLng endLatlng) {
- if (Constant.currentLocation == null) {
+ if (LocationLifeCycle.getInstance().getMainLocation() == null) {
ToastUtils.Message(mContext, "无法获取当前位置,请检查是否授权应用获取位置权限!");
return;
}
diff --git a/app/src/main/java/com/navinfo/outdoor/util/TencentMarkerUtils.java b/app/src/main/java/com/navinfo/outdoor/util/TencentMarkerUtils.java
index 7227eaa..5ab6018 100644
--- a/app/src/main/java/com/navinfo/outdoor/util/TencentMarkerUtils.java
+++ b/app/src/main/java/com/navinfo/outdoor/util/TencentMarkerUtils.java
@@ -3,6 +3,7 @@ package com.navinfo.outdoor.util;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
+import android.location.Location;
import android.os.Message;
import android.util.Log;
@@ -52,7 +53,7 @@ public class TencentMarkerUtils {
*
* @param tencentLocation location 用户当前位置
*/
- public void initNetMarkerList(Activity mContext, TencentLocation tencentLocation, TencentMap tencentMap, List removables, String taskTypeStr, String taskStatusStr, Map> removableHashMap, int pageSize, MarkerInitCallback callback) {
+ public void initNetMarkerList(Activity mContext, Location tencentLocation, TencentMap tencentMap, List removables, String taskTypeStr, String taskStatusStr, Map> removableHashMap, int pageSize, MarkerInitCallback callback) {
int task_type = Constant.TASK_TYPE;
if (taskTypeStr != null) {
task_type = Integer.parseInt(taskTypeStr);
diff --git a/app/src/main/res/layout/treasure_fragment.xml b/app/src/main/res/layout/treasure_fragment.xml
index ab62c6c..3e77eb6 100644
--- a/app/src/main/res/layout/treasure_fragment.xml
+++ b/app/src/main/res/layout/treasure_fragment.xml
@@ -40,7 +40,7 @@
android:background="@drawable/iv_message"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
-
+
+
+
+
+
+
+
+
diff --git a/build.gradle b/build.gradle
index 823b054..9d90b9e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,10 +3,15 @@ buildscript {
ext.anko_version = '0.10.1'//扩展库版本
ext.kotlin_version = '1.5.10'
repositories {
- maven { url "https://jitpack.io" }
- maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
//友盟 检测bug
maven { url 'https://repo1.maven.org/maven2/' }
+ maven{ url 'https://maven.aliyun.com/repository/google'}
+ maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
+ maven{ url 'https://maven.aliyun.com/repository/public'}
+ maven{ url 'https://maven.aliyun.com/repository/jcenter'}
+ maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
+ maven { url "https://jitpack.io" }
+ maven { url "https://repo.spring.io/libs-release/" }
//腾讯地图
maven{
url "https://oss.sonatype.org/content/groups/public"
@@ -30,10 +35,15 @@ buildscript {
allprojects {
repositories {
- maven { url "https://jitpack.io" }
- maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
//友盟 检测bug
maven { url 'https://repo1.maven.org/maven2/' }
+ maven{ url 'https://maven.aliyun.com/repository/google'}
+ maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
+ maven{ url 'https://maven.aliyun.com/repository/public'}
+ maven{ url 'https://maven.aliyun.com/repository/jcenter'}
+ maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
+ maven { url "https://jitpack.io" }
+ maven { url "https://repo.spring.io/libs-release/" }
//腾讯地图
maven{
url "https://oss.sonatype.org/content/groups/public"
diff --git a/xrecyclerview/src/androidTest/java/com/jcodecraeer/xrecyclerview/ApplicationTest.java b/xrecyclerview/src/androidTest/java/com/jcodecraeer/xrecyclerview/ApplicationTest.java
deleted file mode 100644
index fc11153..0000000
--- a/xrecyclerview/src/androidTest/java/com/jcodecraeer/xrecyclerview/ApplicationTest.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.jcodecraeer.xrecyclerview;
-
-import android.app.Application;
-import android.test.ApplicationTestCase;
-
-/**
- * Testing Fundamentals
- */
-public class ApplicationTest extends ApplicationTestCase {
- public ApplicationTest() {
- super(Application.class);
- }
-}
\ No newline at end of file