From fbae5f3ea74727ccadc48314a864a1ea0099a945 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 17 十月 2025 17:36:17 +0800
Subject: [PATCH] 2025.10.17 1、新增巡查时,修改工地施工阶段功能(待完成)

---
 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