Move uptime display into stop button
This commit is contained in:
@@ -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,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user