feat(settings): add save button and persist settings; refactor for recoder name; update UI texts
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#Fri Mar 06 18:59:47 CST 2026
|
#Fri Mar 06 19:06:55 CST 2026
|
||||||
path.4=14/classes.dex
|
path.4=14/classes.dex
|
||||||
path.3=12/classes.dex
|
path.3=12/classes.dex
|
||||||
path.2=10/classes.dex
|
path.2=10/classes.dex
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
|||||||
27
|
28
|
||||||
0
|
0
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
ëXè¾ú¹Ñ~Ì>Ň
|
ëXè¾ú¹Ñ~Ì>Ňôï`
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,6 +5,7 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
|
import android.media.MediaActionSound
|
||||||
import android.graphics.BitmapFactory
|
import android.graphics.BitmapFactory
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
@@ -76,6 +77,7 @@ import com.inspection.camera.util.LocationHelper
|
|||||||
import com.inspection.camera.util.PermissionManager
|
import com.inspection.camera.util.PermissionManager
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import kotlinx.coroutines.withTimeoutOrNull
|
import kotlinx.coroutines.withTimeoutOrNull
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -105,6 +107,11 @@ fun CameraScreen(
|
|||||||
|
|
||||||
val capturedImages = remember { mutableStateListOf<Uri>() }
|
val capturedImages = remember { mutableStateListOf<Uri>() }
|
||||||
val locationHelper = remember { LocationHelper(context) }
|
val locationHelper = remember { LocationHelper(context) }
|
||||||
|
val shutterSound = remember { MediaActionSound() }
|
||||||
|
var flashVisible by remember { mutableStateOf(false) }
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
shutterSound.load(MediaActionSound.SHUTTER_CLICK)
|
||||||
|
}
|
||||||
|
|
||||||
// 权限状态
|
// 权限状态
|
||||||
val permissionsState = rememberMultiplePermissionsState(
|
val permissionsState = rememberMultiplePermissionsState(
|
||||||
@@ -192,7 +199,14 @@ fun CameraScreen(
|
|||||||
isLocationLoading = false
|
isLocationLoading = false
|
||||||
}
|
}
|
||||||
|
|
||||||
Box(modifier = Modifier.fillMaxSize()) {
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
|
// 闪屏效果覆盖层(拍照成功时显示)
|
||||||
|
if (flashVisible) {
|
||||||
|
Box(modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.background(Color.White.copy(alpha = 0.9f))
|
||||||
|
)
|
||||||
|
}
|
||||||
if (permissionsState.allPermissionsGranted) {
|
if (permissionsState.allPermissionsGranted) {
|
||||||
CameraContent(
|
CameraContent(
|
||||||
flashMode = flashMode,
|
flashMode = flashMode,
|
||||||
@@ -211,9 +225,15 @@ fun CameraScreen(
|
|||||||
onComplete = { uri ->
|
onComplete = { uri ->
|
||||||
capturedImages.add(uri)
|
capturedImages.add(uri)
|
||||||
isCapturing = false
|
isCapturing = false
|
||||||
|
|
||||||
},
|
},
|
||||||
onError = {
|
onError = {
|
||||||
isCapturing = false
|
isCapturing = false
|
||||||
|
},
|
||||||
|
onFeedback = {
|
||||||
|
shutterSound.play(MediaActionSound.SHUTTER_CLICK)
|
||||||
|
flashVisible = true
|
||||||
|
scope.launch { delay(150); flashVisible = false }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -506,7 +526,8 @@ private fun capturePhoto(
|
|||||||
imageQuality: ImageQuality,
|
imageQuality: ImageQuality,
|
||||||
locationText: String,
|
locationText: String,
|
||||||
onComplete: (Uri) -> Unit,
|
onComplete: (Uri) -> Unit,
|
||||||
onError: () -> Unit = {}
|
onError: () -> Unit = {},
|
||||||
|
onFeedback: (() -> Unit)? = null
|
||||||
) {
|
) {
|
||||||
Log.d("CameraScreen", "capturePhoto called, locationText=$locationText")
|
Log.d("CameraScreen", "capturePhoto called, locationText=$locationText")
|
||||||
val photoFile = File(
|
val photoFile = File(
|
||||||
@@ -530,8 +551,9 @@ private fun capturePhoto(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val timeText = ImageProcessor.getCurrentTimeText()
|
onFeedback?.invoke()
|
||||||
|
val timeText = ImageProcessor.getCurrentTimeText()
|
||||||
Log.d("CameraScreen", "Adding watermark: timeText=$timeText, locationText=$locationText")
|
Log.d("CameraScreen", "Adding watermark: timeText=$timeText, locationText=$locationText")
|
||||||
val watermarkedBitmap = ImageProcessor.addWatermark(
|
val watermarkedBitmap = ImageProcessor.addWatermark(
|
||||||
bitmap,
|
bitmap,
|
||||||
|
|||||||
Reference in New Issue
Block a user