Skip to content

Debloat your Android TV, install apps, browse and transfer files on it, all from your phone. Just 3 MB, no tracking, no root, no PC.

Remote: the hidden restart says Not back yet once it's overdue

jesse-agent-23218ab11b0781e
diff --git a/app/src/main/java/app/tellyscope/ui/Copy.kt b/app/src/main/java/app/tellyscope/ui/Copy.kt
index 364906f..e7acb6d 100644
--- a/app/src/main/java/app/tellyscope/ui/Copy.kt
+++ b/app/src/main/java/app/tellyscope/ui/Copy.kt
@@ -337,6 +337,7 @@ object Copy {
const val RESTARTING_TITLE = "Restarting…"
const val RESTARTING_TEXT = "The TV is restarting. Tellyscope will reconnect by itself."
const val RESTART_LATE_TITLE = "The TV hasn't come back yet"
+ const val RESTART_LATE_STATUS = "Not back yet"
const val RESTART_LATE_TEXT = "It's been a minute. Some TVs take longer to start; Retry waits another minute."
const val RESTART_LOST_TEXT = "Use the TV's own remote to turn it on, then tap Retry."
diff --git a/app/src/main/java/app/tellyscope/ui/RemoteScreen.kt b/app/src/main/java/app/tellyscope/ui/RemoteScreen.kt
index 3e46dfb..b6c7be7 100644
--- a/app/src/main/java/app/tellyscope/ui/RemoteScreen.kt
+++ b/app/src/main/java/app/tellyscope/ui/RemoteScreen.kt
@@ -184,7 +184,7 @@ fun RemoteScreen(
snackbarHost = { SnackbarHost(snackbar) },
topBar = {
TopAppBar(
- title = { if (restart != null && hidden == stage) RestartStatus(onClick = { hidden = null }) else Text("Remote") },
+ title = { if (restart != null && hidden == stage) RestartStatus(late = restart.phase(state.now) != Restart.Phase.Waiting, onClick = { hidden = null }) else Text("Remote") },
navigationIcon = {
IconButton(onClick = actions.back) { Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Back to the TV's page") }
},
@@ -438,17 +438,21 @@ private fun StatusShape(icon: ImageVector, container: Color, content: Color) {
}
}
-/** The top bar's title while a hidden restart runs; a tap brings its dialog back. */
+/** The top bar's title while a hidden restart runs, overdue once [late]; a tap brings its dialog back. */
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
-private fun RestartStatus(onClick: () -> Unit) {
+private fun RestartStatus(late: Boolean, onClick: () -> Unit) {
Row(
Modifier.clip(MaterialTheme.shapes.small).clickable(onClickLabel = "Show the restart", onClick = onClick).padding(4.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
- LoadingIndicator(Modifier.size(28.dp))
- Text(Copy.RESTARTING_TITLE)
+ if (late) {
+ Icon(RemoteIcons.HourglassTop, contentDescription = null, tint = MaterialTheme.colorScheme.secondary, modifier = Modifier.size(28.dp))
+ } else {
+ LoadingIndicator(Modifier.size(28.dp))
+ }
+ Text(if (late) Copy.RESTART_LATE_STATUS else Copy.RESTARTING_TITLE)
Icon(Icons.Default.KeyboardArrowRight, contentDescription = null, tint = MaterialTheme.colorScheme.onSurfaceVariant)
}
}