From e234a15b428267997c903a4ed42536c5d9f14a1f Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 10 十一月 2025 13:10:42 +0800
Subject: [PATCH] 2025.11.10 1. 新增巡查场景历史详情相关数据逻辑; 2. 新增工地施工阶段修改界面;

---
 app/src/main/java/cn/flightfeather/thirdappmodule/module/base/BaseTakePicActivity.kt |   33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/app/src/main/java/cn/flightfeather/thirdappmodule/module/base/BaseTakePicActivity.kt b/app/src/main/java/cn/flightfeather/thirdappmodule/module/base/BaseTakePicActivity.kt
index eabeb8c..0fb46f8 100644
--- a/app/src/main/java/cn/flightfeather/thirdappmodule/module/base/BaseTakePicActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdappmodule/module/base/BaseTakePicActivity.kt
@@ -56,10 +56,11 @@
                 //鏌ョ湅涓存椂鎷嶆憚鍥剧墖鍙互鍒犻櫎
                 data?.getIntExtra("position", -1)?.let {
                     if (it > -1) {
-                        if (pathTempList[it].first.exists()) {
-                            pathTempList[it].first.delete()
-                        }
+                        val file = pathTempList[it].first
                         pathTempList.removeAt(it)
+                        if (file.exists()) {
+                            file.delete()
+                        }
                         refreshImageView()
                     }
                 }
@@ -68,16 +69,20 @@
                 val paths = data?.getStringArrayListExtra(EXTRA_SELECT_IMAGES)
                 paths?.forEach {
                     val oldFile = File(it)
-                    val newFile = File(Environment.getExternalStorageDirectory(), "FlightFeather/Temp/" + UUIDGenerator.generateUUID(4) + ".jpg")
-                    if (!newFile.parentFile.exists()) {
-                        newFile.parentFile.mkdirs()
-                    }
-                    try {
-                        FileUtil.copyFile(oldFile, newFile)
-                        pathTempList.add(Pair(newFile, true))
-                    } catch (e: IOException) {
-                        e.printStackTrace()
-                        application.toast("澶嶅埗鏂囦欢澶辫触")
+                    if (it.contains("FlightFeather/Temp")) {
+                        pathTempList.add(Pair(oldFile, true))
+                    } else {
+                        val newFile = File(Environment.getExternalStorageDirectory(), "FlightFeather/Temp/" + UUIDGenerator.generateUUID(4) + ".jpg")
+                        try {
+                            if (!newFile.parentFile.exists()) {
+                                newFile.parentFile.mkdirs()
+                            }
+                            FileUtil.copyFile(oldFile, newFile)
+                            pathTempList.add(Pair(newFile, true))
+                        } catch (e: IOException) {
+                            e.printStackTrace()
+                            application.toast("澶嶅埗鏂囦欢澶辫触")
+                        }
                     }
                 }
                 refreshImageView()
@@ -132,7 +137,7 @@
         return View.OnClickListener {
             val t = imageViewList.size - pathTempList.size
             val picNum = if (t >= 0) t else 0
-            PhotoUtil.pickPhoto2(this, TAKE_PHOTO, picNum)
+            PhotoUtil.pickPhoto(this, TAKE_PHOTO, picNum)
         }
     }
 

--
Gitblit v1.9.3