From 32e17591ca41ba7b79514f0cb2e2ef6eb3e5a384 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期六, 10 十月 2020 16:45:11 +0800
Subject: [PATCH] 20201010
---
app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuCameraActivity.kt | 1
app/src/main/AndroidManifest.xml | 23 +++++++----
app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt | 64 +++++++++++++++++++------------
app/src/main/java/cn/flightfeather/thirdapp/adapter/PhotoListAdapter.java | 13 +++++-
4 files changed, 65 insertions(+), 36 deletions(-)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3791057..bc6cabe 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -42,7 +42,7 @@
android:networkSecurityConfig="@xml/network_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
- android:theme="@style/AppTheme"
+ android:theme="@style/AppTheme.NoActionBar"
tools:ignore="GoogleAppIndexingWarning, LockedOrientationActivity"
tools:targetApi="n">
<!-- 璋冭瘯鐗堥珮寰峰湴鍥綤ey锛屾牴鎹紑鍙戠數鑴戜笉鍚屽彲鑳芥湁鎵�鏀瑰彉 -->
@@ -101,10 +101,12 @@
android:theme="@style/AppFullScreenTheme" />
<activity
android:name=".activity.ProblemDetailActivity"
- android:screenOrientation="portrait" />
+ android:screenOrientation="portrait"
+ android:theme="@style/AppTheme"/>
<activity
android:name=".activity.UploadMediaFilesActivity"
- android:screenOrientation="portrait" />
+ android:screenOrientation="portrait"
+ android:theme="@style/AppTheme"/>
<activity
android:name=".activity.ScenseMapActivity"
android:screenOrientation="portrait"
@@ -123,10 +125,12 @@
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".activity.GitDetailActivity"
- android:screenOrientation="portrait" />
+ android:screenOrientation="portrait"
+ android:theme="@style/AppTheme"/>
<activity
android:name=".activity.GradeActivity"
- android:screenOrientation="portrait" />
+ android:screenOrientation="portrait"
+ android:theme="@style/AppTheme"/>
<activity
android:name=".activity.TaskDetailActivity"
android:screenOrientation="portrait"
@@ -141,14 +145,16 @@
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".activity.SubTaskMapActivity"
- android:screenOrientation="portrait" />
+ android:screenOrientation="portrait"
+ android:theme="@style/AppTheme"/>
<activity
android:name=".activity.MapActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".activity.DebugTransSiteLatlngActivity"
- android:screenOrientation="portrait" />
+ android:screenOrientation="portrait"
+ android:theme="@style/AppTheme"/>
<activity
android:name=".activity.MOVMapActivity"
android:screenOrientation="portrait"
@@ -186,7 +192,8 @@
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".module.inspection.MenuGradeActivity"
- android:screenOrientation="portrait" />
+ android:screenOrientation="portrait"
+ android:theme="@style/AppTheme"/>
<activity
android:name=".module.inspection.InspectionDetailActivity"
android:theme="@style/AppTheme.NoActionBar" />
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/adapter/PhotoListAdapter.java b/app/src/main/java/cn/flightfeather/thirdapp/adapter/PhotoListAdapter.java
index 1b1555f..9676ee4 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/adapter/PhotoListAdapter.java
+++ b/app/src/main/java/cn/flightfeather/thirdapp/adapter/PhotoListAdapter.java
@@ -9,13 +9,14 @@
import android.view.ViewGroup;
import android.widget.ImageView;
+import com.bumptech.glide.Glide;
+
import java.io.File;
import java.util.List;
import cn.flightfeather.thirdapp.R;
import cn.flightfeather.thirdapp.bean.Mediafile;
import cn.flightfeather.thirdapp.task.DownloadAndSetImageTask;
-import cn.flightfeather.thirdapp.task.SetImageTask;
/**
* Created by note_ff_1602 on 2018/1/30.
@@ -46,8 +47,14 @@
File file = new File(Environment.getExternalStorageDirectory(),mediafile.getPath()+mediafile.getDescription());
if (file.exists()){
- SetImageTask task = new SetImageTask(file,holder.iv_photo);
- task.execute();
+// SetImageTask task = new SetImageTask(file,holder.iv_photo);
+// task.execute();
+// String url = CommonApplication.getInstance().ROOT_URL_RELEASE_IMAGE + mediafile.getExtension1() + mediafile.getGuid() + ".jpg";
+ Glide.with(context)
+ .load(file)
+ .placeholder(R.drawable.icon_add_photo_waite)
+ .override(100,100)
+ .into(holder.iv_photo);
}else {
DownloadAndSetImageTask task = new DownloadAndSetImageTask(mediafile,holder.iv_photo,context);
task.execute();
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt
index 8eeb114..dbf4b7d 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailActivity.kt
@@ -13,6 +13,7 @@
import android.view.View
import android.view.animation.AnimationUtils
import android.widget.LinearLayout
+import cn.flightfeather.thirdapp.CommonApplication
import cn.flightfeather.thirdapp.R
import cn.flightfeather.thirdapp.activity.GradeActivity
import cn.flightfeather.thirdapp.activity.MapActivity
@@ -140,25 +141,6 @@
viewModel.inspection.observe(this, Observer {
it?.apply {
- if (extension1 != null) {
- val list = extension1.split(";").map{str ->
- str.split(",").map {str2 ->
- str2.toDoubleOrNull() ?: 0.0
- }.takeIf { l-> l.size == 2 }.let {latLng->
- LatLng(latLng?.get(1) ?: 0.0, latLng?.get(0) ?: 0.0)
- }
- }
- drawPolyline(list)
- list.firstOrNull()?.let {p->
- myLatLngList.add(
- MyLatLng(
- p,
- drawableId = R.drawable.icon_mark_start_blue,
- selected = true
- )
- )
- }
- }
onDataLoaded(0)
}
})
@@ -331,6 +313,34 @@
if (result) {
showMenu()
refreshMenuStatus(taskStatus)
+
+ viewModel.inspection.value?.extension1?.let{
+ val list = it.split(";").map{str ->
+ str.split(",").map {str2 ->
+ str2.toDoubleOrNull() ?: 0.0
+ }.takeIf { l-> l.size == 2 }.let {latLng->
+ LatLng(latLng?.get(1) ?: 0.0, latLng?.get(0) ?: 0.0)
+ }
+ }
+ //閬撹矾鐩戞祴鐐瑰拰閬撹矾绫诲瀷鐨勫満鏅紝鐩存帴灞曠ず杞ㄨ抗锛涘叾浣欏満鏅彧鏈夌鐞嗗憳鍜屾斂搴滈儴闂ㄥ彲浠ユ煡鐪�
+ if (
+ (viewModel.scene.value?.typeid?.toString() == Constant.SCENE_TYPE9 || viewModel.scene.value?.typeid?.toString() == Constant.SCENE_TYPE10)
+ || (CommonApplication.getInstance().currentUser.usertypeid == 0.toByte() || CommonApplication.getInstance().currentUser.usertypeid == 2.toByte())
+ ) {
+ drawPolyline(list)
+ }
+
+ list.firstOrNull()?.let {p->
+ myLatLngList.add(
+ MyLatLng(
+ p,
+ drawableId = R.drawable.icon_mark_start_blue,
+ selected = true
+ )
+ )
+ }
+ }
+
} else {
toast("璇风瓑寰呮暟鎹姞杞藉畬鎴�")
}
@@ -573,14 +583,12 @@
private fun startTracking() {
if (
-// viewModel.scene.value?.typeid?.toString() != Constant.SCENE_TYPE9 ||
+ viewModel.subTask.value == null ||
viewModel.subTask.value?.status != Domain.TASK_STATUS_RUNNING
) return
//褰撶户缁墽琛屾鍦ㄨ繘琛屼腑鐨勪换鍔℃椂锛屾牴鎹槸鍚︽湁鍘嗗彶杞ㄨ抗璁板綍鏉ュ垽鏂槸鍚﹀紑鍚�
- if (viewModel.inspection.value?.extension1 != null) {
- needTracking = true
- }
+ needTracking = true
if (!needTracking || timerTaskRunning) return
@@ -618,7 +626,13 @@
val distance = AMapUtils.calculateLineDistance(l1, l2)
if (distance >= 5) {
extension1 = "${extension1};${lng},${lat}"
- drawPolyline(LatLng(lat, lng))
+ //閬撹矾鐩戞祴鐐瑰拰閬撹矾绫诲瀷鐨勫満鏅紝鐩存帴灞曠ず杞ㄨ抗锛涘叾浣欏満鏅彧鏈夌鐞嗗憳鍜屾斂搴滈儴闂ㄥ彲浠ユ煡鐪�
+ if (
+ (viewModel.scene.value?.typeid?.toString() == Constant.SCENE_TYPE9 || viewModel.scene.value?.typeid?.toString() == Constant.SCENE_TYPE10)
+ || (CommonApplication.getInstance().currentUser.usertypeid == 0.toByte() || CommonApplication.getInstance().currentUser.usertypeid == 2.toByte())
+ ) {
+ drawPolyline(LatLng(lat, lng))
+ }
}
}
}
@@ -628,7 +642,7 @@
}
private fun trackingDone() {
- if (!needTracking || !timerTaskRunning) return
+ if (!timerTaskRunning) return
aMap.moveCamera(CameraUpdateFactory.zoomTo(zoomLevel))
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuCameraActivity.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuCameraActivity.kt
index cc3dbd4..c802e61 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuCameraActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuCameraActivity.kt
@@ -37,6 +37,7 @@
class MenuCameraActivity : BaseActivity() {
override fun getLayoutId(): Int = R.layout.dialog_camera
+
lateinit var viewModel: MenuCameraViewModel
var subTask: Subtask? = null
--
Gitblit v1.9.3