添加位置浮动层测试,使用Airtest测试框架验证
This commit is contained in:
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
#Sat Feb 28 18:21:19 CST 2026
|
||||
#Sat Feb 28 19:32:01 CST 2026
|
||||
path.4=14/classes.dex
|
||||
path.3=12/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.
@@ -1 +1 @@
|
||||
<EFBFBD>4<EFBFBD>2<EFBFBD>3
|
||||
<EFBFBD>4<EFBFBD>2<EFBFBD>3<EFBFBD>3<EFBFBD>3
|
||||
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.
@@ -1 +1 @@
|
||||
χ‘η<EFBFBD>
|
||||
χ‘η<EFBFBD>ό<EFBFBD>ό<EFBFBD>
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
20
|
||||
22
|
||||
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 @@
|
||||
輘鈍鑨軗輘
|
||||
ÝsâgčxÜ“ÝsÉiŰCă’ů*
|
||||
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.
@@ -147,6 +147,9 @@ fun CameraScreen(
|
||||
Log.d("CameraScreen", "Getting location...")
|
||||
locationText = locationHelper.getLocationInfo()
|
||||
Log.d("CameraScreen", "Location result: $locationText")
|
||||
if (locationText.isEmpty()) {
|
||||
locationText = "定位失败"
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e("CameraScreen", "Location error", e)
|
||||
locationText = "定位失败"
|
||||
@@ -154,7 +157,7 @@ fun CameraScreen(
|
||||
} else if (manualAddress.isNotBlank()) {
|
||||
locationText = manualAddress
|
||||
} else {
|
||||
locationText = ""
|
||||
locationText = "请授予定位权限"
|
||||
}
|
||||
isLocationLoading = false
|
||||
}
|
||||
@@ -198,6 +201,44 @@ fun CameraScreen(
|
||||
onDismissDialog = { showPermissionDeniedDialog = false }
|
||||
)
|
||||
}
|
||||
|
||||
// 位置信息浮动层(在外层显示,不受权限影响)
|
||||
if (isLocationLoading || locationText.isNotBlank()) {
|
||||
Card(
|
||||
modifier = Modifier
|
||||
.align(Alignment.BottomCenter)
|
||||
.padding(bottom = 120.dp, start = 16.dp, end = 16.dp),
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = Color.Black.copy(alpha = 0.6f)
|
||||
)
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
if (isLocationLoading) {
|
||||
CircularProgressIndicator(
|
||||
modifier = Modifier.size(16.dp),
|
||||
color = Color.White,
|
||||
strokeWidth = 2.dp
|
||||
)
|
||||
} else {
|
||||
Icon(
|
||||
imageVector = Icons.Default.LocationOn,
|
||||
contentDescription = null,
|
||||
tint = Color.White,
|
||||
modifier = Modifier.size(16.dp)
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Text(
|
||||
text = if (isLocationLoading) "正在定位..." else locationText,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = Color.White
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,44 +326,6 @@ private fun CameraContent(
|
||||
isCapturing = isCapturing,
|
||||
modifier = Modifier.align(Alignment.BottomCenter)
|
||||
)
|
||||
|
||||
// 位置信息浮动层
|
||||
if (isLocationLoading || locationText.isNotBlank()) {
|
||||
Card(
|
||||
modifier = Modifier
|
||||
.align(Alignment.BottomCenter)
|
||||
.padding(bottom = 120.dp, start = 16.dp, end = 16.dp),
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = Color.Black.copy(alpha = 0.6f)
|
||||
)
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
if (isLocationLoading) {
|
||||
CircularProgressIndicator(
|
||||
modifier = Modifier.size(16.dp),
|
||||
color = Color.White,
|
||||
strokeWidth = 2.dp
|
||||
)
|
||||
} else {
|
||||
Icon(
|
||||
imageVector = Icons.Default.LocationOn,
|
||||
contentDescription = null,
|
||||
tint = Color.White,
|
||||
modifier = Modifier.size(16.dp)
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Text(
|
||||
text = if (isLocationLoading) "正在定位..." else locationText,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = Color.White
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user