From 3013b813e5df6977c0be921928f73b1a3adde290 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 02 七月 2025 15:52:04 +0800
Subject: [PATCH] ### 一、巡查模块相关
---
app/src/main/java/cn/flightfeather/thirdappmodule/module/base/BaseTakePicActivity.kt | 30 ++++++++++++++++--------------
1 files changed, 16 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..ea86d12 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,17 @@
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 {
+ FileUtil.copyFile(oldFile, newFile)
+ pathTempList.add(Pair(newFile, true))
+ } catch (e: IOException) {
+ e.printStackTrace()
+ application.toast("澶嶅埗鏂囦欢澶辫触")
+ }
}
}
refreshImageView()
@@ -132,7 +134,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