UX: UI 정리 — 단위 배치, 버튼 텍스트, LED OFF, Delete Pairing
도넛차트: - InfoCard: ml/% 단위를 숫자 오른쪽에 배치 (기존 아래 → 옆) - Void/Catheterize: 글자 크기 통일 (11+13sp → 12sp 균일) - Disconnect → "Delete Pairing" 텍스트 변경 Placement: - 화면 벗어날 때 LED OFF (DisposableEffect onDispose → sendLedMode(0)) - LATERAL 디버그 로그 추가 (CH4/CH5 len + symmetry) - 대칭 기준 0.7 유지 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+13
-8
@@ -772,8 +772,8 @@ fun PiezoMonitoringView(appState: AppState) {
|
|||||||
colors = ButtonDefaults.buttonColors(containerColor = MlPrimary.copy(alpha = 0.1f))
|
colors = ButtonDefaults.buttonColors(containerColor = MlPrimary.copy(alpha = 0.1f))
|
||||||
) {
|
) {
|
||||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
||||||
Text("Void /", fontSize = 11.sp, color = MlPrimary)
|
Text("Void /", fontSize = 12.sp, fontWeight = FontWeight.SemiBold, color = MlPrimary)
|
||||||
Text("Catheterize", fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = MlPrimary)
|
Text("Catheterize", fontSize = 12.sp, fontWeight = FontWeight.SemiBold, color = MlPrimary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1011,18 +1011,18 @@ fun PiezoMonitoringView(appState: AppState) {
|
|||||||
) {
|
) {
|
||||||
Icon(Icons.Default.LinkOff, null, tint = Color.Red, modifier = Modifier.size(16.dp))
|
Icon(Icons.Default.LinkOff, null, tint = Color.Red, modifier = Modifier.size(16.dp))
|
||||||
Spacer(modifier = Modifier.width(6.dp))
|
Spacer(modifier = Modifier.width(6.dp))
|
||||||
Text("Disconnect", fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = Color.Red)
|
Text("Delete Pairing", fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = Color.Red)
|
||||||
}
|
}
|
||||||
if (showDisconnectConfirm) {
|
if (showDisconnectConfirm) {
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
onDismissRequest = { showDisconnectConfirm = false },
|
onDismissRequest = { showDisconnectConfirm = false },
|
||||||
title = { Text("Disconnect Device") },
|
title = { Text("Delete Pairing") },
|
||||||
text = { Text("기기 연결을 해제하고 페어링 정보를 삭제합니다.") },
|
text = { Text("기기 연결을 해제하고 페어링 정보를 삭제합니다.") },
|
||||||
confirmButton = {
|
confirmButton = {
|
||||||
TextButton(onClick = {
|
TextButton(onClick = {
|
||||||
showDisconnectConfirm = false; showSettings = false
|
showDisconnectConfirm = false; showSettings = false
|
||||||
bleManager.disconnectAndUnbond(); appState.goHome()
|
bleManager.disconnectAndUnbond(); appState.goHome()
|
||||||
}) { Text("Disconnect", color = Color.Red) }
|
}) { Text("Delete", color = Color.Red) }
|
||||||
},
|
},
|
||||||
dismissButton = { TextButton(onClick = { showDisconnectConfirm = false }) { Text("Cancel") } }
|
dismissButton = { TextButton(onClick = { showDisconnectConfirm = false }) { Text("Cancel") } }
|
||||||
)
|
)
|
||||||
@@ -1469,10 +1469,15 @@ private fun InfoCard(title: String, value: String, unit: String, color: Color, m
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(vertical = 14.dp).fillMaxWidth(),
|
modifier = Modifier.padding(vertical = 14.dp).fillMaxWidth(),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
verticalArrangement = Arrangement.spacedBy(6.dp)
|
verticalArrangement = Arrangement.spacedBy(4.dp)
|
||||||
) {
|
) {
|
||||||
Text(value, fontSize = 20.sp, fontWeight = FontWeight.Bold, color = Color(0xFF1C1B1F))
|
Row(verticalAlignment = Alignment.Bottom) {
|
||||||
Text(unit.ifEmpty { " " }, fontSize = 11.sp, color = MlSecondaryText)
|
Text(value, fontSize = 20.sp, fontWeight = FontWeight.Bold, color = Color(0xFF1C1B1F))
|
||||||
|
if (unit.isNotEmpty()) {
|
||||||
|
Spacer(modifier = Modifier.width(3.dp))
|
||||||
|
Text(unit, fontSize = 12.sp, color = MlSecondaryText, modifier = Modifier.padding(bottom = 2.dp))
|
||||||
|
}
|
||||||
|
}
|
||||||
Text(title, fontSize = 11.sp, fontWeight = FontWeight.SemiBold, color = MlSecondaryText)
|
Text(title, fontSize = 11.sp, fontWeight = FontWeight.SemiBold, color = MlSecondaryText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -87,6 +87,11 @@ fun PlacementGuideView(appState: AppState) {
|
|||||||
for (i in 0 until 6) { channelDetected[i] = false; channelUrineLen[i] = 0 }
|
for (i in 0 until 6) { channelDetected[i] = false; channelUrineLen[i] = 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 화면 벗어날 때 LED OFF
|
||||||
|
androidx.compose.runtime.DisposableEffect(Unit) {
|
||||||
|
onDispose { bleManager.sendLedMode(0) }
|
||||||
|
}
|
||||||
|
|
||||||
val detectedCount = channelDetected.count { it }
|
val detectedCount = channelDetected.count { it }
|
||||||
|
|
||||||
val isGreenZone = isLocked || placementScore >= 70
|
val isGreenZone = isLocked || placementScore >= 70
|
||||||
@@ -990,6 +995,7 @@ private fun computePlacementGuide(
|
|||||||
|
|
||||||
val lrMax = maxOf(len4, len5, 1)
|
val lrMax = maxOf(len4, len5, 1)
|
||||||
val lrSymmetry = 1.0 - kotlin.math.abs(len4 - len5).toDouble() / lrMax
|
val lrSymmetry = 1.0 - kotlin.math.abs(len4 - len5).toDouble() / lrMax
|
||||||
|
android.util.Log.d("PlacementGuide", "LATERAL ch4=$ch4(len=$len4) ch5=$ch5(len=$len5) sym=${"%.2f".format(lrSymmetry)}")
|
||||||
|
|
||||||
if (lrSymmetry >= 0.7) {
|
if (lrSymmetry >= 0.7) {
|
||||||
return PlacementGuideResult(
|
return PlacementGuideResult(
|
||||||
|
|||||||
Reference in New Issue
Block a user