mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-07-02 17:35:36 -04:00
fix(discovery): show disabled reason below Start Analysis button (#6027)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -365,13 +365,23 @@ private fun ScanButton(
|
||||
val disabledDescription = stringResource(Res.string.discovery_start_scan_disabled, disabledReason)
|
||||
val buttonModifier =
|
||||
if (!isEnabled) {
|
||||
modifier.fillMaxWidth().semantics { contentDescription = disabledDescription }
|
||||
Modifier.fillMaxWidth().semantics { contentDescription = disabledDescription }
|
||||
} else {
|
||||
modifier.fillMaxWidth()
|
||||
Modifier.fillMaxWidth()
|
||||
}
|
||||
Column(modifier = modifier) {
|
||||
Button(onClick = onStart, enabled = isEnabled, modifier = buttonModifier) {
|
||||
Icon(imageVector = MeshtasticIcons.PlayArrow, contentDescription = null)
|
||||
Text(stringResource(Res.string.discovery_start_scan), modifier = Modifier.padding(start = 8.dp))
|
||||
}
|
||||
if (!isEnabled && disabledReason.isNotEmpty()) {
|
||||
Text(
|
||||
text = disabledReason,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.padding(top = 4.dp),
|
||||
)
|
||||
}
|
||||
Button(onClick = onStart, enabled = isEnabled, modifier = buttonModifier) {
|
||||
Icon(imageVector = MeshtasticIcons.PlayArrow, contentDescription = null)
|
||||
Text(stringResource(Res.string.discovery_start_scan), modifier = Modifier.padding(start = 8.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user