Move uptime display into stop button

This commit is contained in:
世界
2026-01-01 16:59:59 +08:00
parent 932775a002
commit cb9ee66251

View File

@@ -136,11 +136,6 @@ fun ServiceStatusBar(
} }
} }
// Uptime
if (startTime != null) {
UptimeDisplay(startTime = startTime)
}
// Stop button // Stop button
Row( Row(
modifier = modifier =
@@ -152,6 +147,10 @@ fun ServiceStatusBar(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center, horizontalArrangement = Arrangement.Center,
) { ) {
if (startTime != null) {
UptimeText(startTime = startTime)
Spacer(modifier = Modifier.width(4.dp))
}
Icon( Icon(
imageVector = Icons.Default.Stop, imageVector = Icons.Default.Stop,
contentDescription = stringResource(R.string.stop), contentDescription = stringResource(R.string.stop),
@@ -179,7 +178,7 @@ private fun StatusItem(
} }
@Composable @Composable
private fun UptimeDisplay( private fun UptimeText(
startTime: Long, startTime: Long,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
@@ -208,7 +207,7 @@ private fun UptimeDisplay(
text = formattedTime, text = formattedTime,
style = MaterialTheme.typography.labelLarge, style = MaterialTheme.typography.labelLarge,
fontWeight = FontWeight.Medium, fontWeight = FontWeight.Medium,
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onPrimaryContainer,
modifier = modifier, modifier = modifier,
) )
} }