mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-22 21:35:23 +00:00
feat(android): tighten settings fidelity
This commit is contained in:
@@ -755,20 +755,19 @@ private fun V2SettingsShellScreen(viewModel: MainViewModel) {
|
||||
val displayName by viewModel.displayName.collectAsState()
|
||||
val isConnected by viewModel.isConnected.collectAsState()
|
||||
val statusText by viewModel.statusText.collectAsState()
|
||||
val remoteAddress by viewModel.remoteAddress.collectAsState()
|
||||
val cameraEnabled by viewModel.cameraEnabled.collectAsState()
|
||||
val notificationForwardingEnabled by viewModel.notificationForwardingEnabled.collectAsState()
|
||||
val speakerEnabled by viewModel.speakerEnabled.collectAsState()
|
||||
|
||||
ClawScaffold(contentPadding = PaddingValues(start = 20.dp, top = 18.dp, end = 20.dp, bottom = 24.dp)) {
|
||||
LazyColumn(verticalArrangement = Arrangement.spacedBy(18.dp)) {
|
||||
ClawScaffold(contentPadding = PaddingValues(start = 20.dp, top = 14.dp, end = 20.dp, bottom = 20.dp)) {
|
||||
LazyColumn(verticalArrangement = Arrangement.spacedBy(13.dp)) {
|
||||
item {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(9.dp),
|
||||
) {
|
||||
Text(text = "Settings", style = ClawTheme.type.title.copy(fontSize = 18.sp, lineHeight = 22.sp), color = ClawTheme.colors.text, modifier = Modifier.weight(1f))
|
||||
Text(text = "Settings", style = ClawTheme.type.title.copy(fontSize = 16.sp, lineHeight = 20.sp), color = ClawTheme.colors.text, modifier = Modifier.weight(1f))
|
||||
V2SettingsSearchButton(onClick = {})
|
||||
}
|
||||
}
|
||||
@@ -787,7 +786,7 @@ private fun V2SettingsShellScreen(viewModel: MainViewModel) {
|
||||
V2SettingsRow("Privacy", if (cameraEnabled) "Camera enabled" else "Locked", Icons.Default.Lock, status = !cameraEnabled),
|
||||
V2SettingsRow("Gateway", gatewaySummary(statusText, isConnected), Icons.Default.Cloud, status = isConnected),
|
||||
V2SettingsRow("Appearance", "Dark", Icons.Default.Palette),
|
||||
V2SettingsRow("Advanced", remoteAddress?.takeIf { it.isNotBlank() } ?: "Diagnostics", Icons.Default.Settings),
|
||||
V2SettingsRow("Advanced", "Diagnostics", Icons.Default.Settings),
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -798,18 +797,18 @@ private fun V2SettingsShellScreen(viewModel: MainViewModel) {
|
||||
|
||||
item {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 20.dp),
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 14.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(3.dp),
|
||||
) {
|
||||
Text(text = "OpenClaw ${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})", style = ClawTheme.type.caption, color = ClawTheme.colors.textMuted)
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(6.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(text = "OpenClaw ${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})", style = ClawTheme.type.caption.copy(fontSize = 8.2.sp, lineHeight = 10.5.sp), color = ClawTheme.colors.textMuted)
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(5.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
text = if (isConnected) "All systems operational" else "Gateway not connected",
|
||||
style = ClawTheme.type.caption,
|
||||
style = ClawTheme.type.caption.copy(fontSize = 8.2.sp, lineHeight = 10.5.sp),
|
||||
color = ClawTheme.colors.textSubtle,
|
||||
)
|
||||
Box(modifier = Modifier.size(6.dp).clip(CircleShape).background(if (isConnected) ClawTheme.colors.success else ClawTheme.colors.textSubtle))
|
||||
Box(modifier = Modifier.size(4.5.dp).clip(CircleShape).background(if (isConnected) ClawTheme.colors.success else ClawTheme.colors.textSubtle))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -826,14 +825,14 @@ private data class V2SettingsRow(
|
||||
|
||||
@Composable
|
||||
private fun V2ProfilePanel(displayName: String) {
|
||||
ClawPanel(contentPadding = PaddingValues(horizontal = 11.dp, vertical = 10.dp)) {
|
||||
ClawPanel(contentPadding = PaddingValues(horizontal = 10.dp, vertical = 8.dp)) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
Surface(
|
||||
modifier = Modifier.size(38.dp),
|
||||
modifier = Modifier.size(32.dp),
|
||||
shape = CircleShape,
|
||||
color = ClawTheme.colors.surfacePressed,
|
||||
border = BorderStroke(1.dp, ClawTheme.colors.borderStrong),
|
||||
@@ -841,20 +840,20 @@ private fun V2ProfilePanel(displayName: String) {
|
||||
Box(contentAlignment = Alignment.Center) {
|
||||
Text(
|
||||
text = displayName.firstOrNull()?.uppercase() ?: "O",
|
||||
style = ClawTheme.type.title,
|
||||
style = ClawTheme.type.title.copy(fontSize = 14.sp, lineHeight = 17.sp),
|
||||
color = ClawTheme.colors.text,
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
}
|
||||
}
|
||||
Column(modifier = Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(3.dp)) {
|
||||
Text(text = displayName, style = ClawTheme.type.section.copy(fontSize = 12.3.sp, lineHeight = 15.sp), color = ClawTheme.colors.text, maxLines = 1)
|
||||
Text(text = "OpenClaw mobile", style = ClawTheme.type.caption.copy(fontSize = 9.3.sp, lineHeight = 12.sp), color = ClawTheme.colors.textMuted, maxLines = 1)
|
||||
Column(modifier = Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||
Text(text = displayName, style = ClawTheme.type.section.copy(fontSize = 10.8.sp, lineHeight = 13.5.sp), color = ClawTheme.colors.text, maxLines = 1)
|
||||
Text(text = "OpenClaw mobile", style = ClawTheme.type.caption.copy(fontSize = 8.2.sp, lineHeight = 10.5.sp), color = ClawTheme.colors.textMuted, maxLines = 1)
|
||||
}
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,
|
||||
contentDescription = "Open profile",
|
||||
modifier = Modifier.size(19.dp),
|
||||
modifier = Modifier.size(15.dp),
|
||||
tint = ClawTheme.colors.text,
|
||||
)
|
||||
}
|
||||
@@ -878,21 +877,21 @@ private fun V2SettingsGroup(rows: List<V2SettingsRow>) {
|
||||
@Composable
|
||||
private fun V2SettingsListRow(row: V2SettingsRow) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp, vertical = 7.dp),
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 10.dp, vertical = 5.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
) {
|
||||
Icon(imageVector = row.icon, contentDescription = null, modifier = Modifier.size(18.dp), tint = ClawTheme.colors.text)
|
||||
Text(text = row.title, style = ClawTheme.type.body.copy(fontSize = 10.8.sp, lineHeight = 14.sp), color = ClawTheme.colors.text, modifier = Modifier.weight(1f), maxLines = 1)
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
Text(text = row.value, style = ClawTheme.type.caption.copy(fontSize = 9.4.sp, lineHeight = 12.sp), color = ClawTheme.colors.textMuted, maxLines = 1)
|
||||
Icon(imageVector = row.icon, contentDescription = null, modifier = Modifier.size(15.dp), tint = ClawTheme.colors.text)
|
||||
Text(text = row.title, style = ClawTheme.type.body.copy(fontSize = 9.6.sp, lineHeight = 12.sp), color = ClawTheme.colors.text, modifier = Modifier.weight(1f), maxLines = 1)
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp)) {
|
||||
Text(text = row.value, style = ClawTheme.type.caption.copy(fontSize = 8.2.sp, lineHeight = 10.5.sp), color = ClawTheme.colors.textMuted, maxLines = 1)
|
||||
row.status?.let { active ->
|
||||
Box(modifier = Modifier.size(5.dp).clip(CircleShape).background(if (active) ClawTheme.colors.success else ClawTheme.colors.textSubtle))
|
||||
Box(modifier = Modifier.size(4.5.dp).clip(CircleShape).background(if (active) ClawTheme.colors.success else ClawTheme.colors.textSubtle))
|
||||
}
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight,
|
||||
contentDescription = "Open ${row.title}",
|
||||
modifier = Modifier.size(17.dp),
|
||||
modifier = Modifier.size(14.dp),
|
||||
tint = ClawTheme.colors.text,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user