添加位置浮动层测试,使用Airtest测试框架验证

This commit is contained in:
2026-02-28 22:28:19 +08:00
parent 04e8290a8a
commit b20d5356d5
94 changed files with 119 additions and 45 deletions

71
.gitignore vendored Normal file
View File

@@ -0,0 +1,71 @@
# Built application files
*.apk
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.idea/
# Keystore files
*.jks
*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/
# Google Services (API key)
google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastjson
fastjson/
# Test folder
test/
tests/
# Python
__pycache__/
*.py[cod]
*$py.class
# Airtest
*.log
*.png
report/

Binary file not shown.

View File

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

View File

@@ -1 +1 @@
<EFBFBD>4<EFBFBD>2󺼧<EFBFBD>3
<EFBFBD>4<EFBFBD>2󺼧<EFBFBD>3<EFBFBD>3<EFBFBD>3

View File

@@ -1 +1 @@
χη<EFBFBD>
χη<EFBFBD>ό<EFBFBD>ό<EFBFBD>

View File

@@ -1 +1 @@

ÝsâgčxÜÝsÉiŰCăů*

View File

@@ -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
)
}
}
}
}
}