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.
Start the end space again from none when the list changes
jesse-agent-232d18725382cca
diff --git a/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt b/app/src/main/java/app/tellyscope/ui/DeviceTabs.ktindex 72eafd7..3697cf5 100644--- a/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt+++ b/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt@@ -65,6 +65,7 @@ import androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableIntStateOfimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.remember+import androidx.compose.runtime.rememberUpdatedStateimport androidx.compose.runtime.saveable.rememberSaveableimport androidx.compose.runtime.setValueimport androidx.compose.runtime.snapshotFlow@@ -78,6 +79,7 @@ import androidx.compose.ui.graphics.lerpimport androidx.compose.ui.graphics.vector.ImageVectorimport androidx.compose.ui.graphics.vector.PathParserimport androidx.compose.ui.platform.LocalDensity+import androidx.compose.ui.platform.testTagimport androidx.compose.ui.text.SpanStyleimport androidx.compose.ui.text.buildAnnotatedStringimport androidx.compose.ui.text.font.FontWeight@@ -142,10 +144,15 @@ fun DeviceTabsScreen(val collapse by remember { derivedStateOf { collapsedFraction(list.firstVisibleItemIndex, list.firstVisibleItemScrollOffset, heroHeight) } }val barTitle by remember { derivedStateOf { titleAlpha(collapse) > 0f } }// A tab shorter than the screen gets blank space at its end, so its hero can still fold fully into the bar.- // Measured only while the hero and the space are both in view; kept as it was while scrolled.+ // Measured only while the hero and the space are both in view, and kept while scrolled; a different list+ // (another tab, sub-tab or folder, or items coming and going) starts again from none.var tail by remember { mutableIntStateOf(0) }+ var measuredFor by remember { mutableStateOf<List<Any>>(emptyList()) }+ val folder by rememberUpdatedState(ui.files.folder)LaunchedEffect(list) {snapshotFlow { list.layoutInfo }.collect { info ->+ val content = listOf(tab, appsTab, folder, info.totalItemsCount)+ if (content != measuredFor) { measuredFor = content; tail = 0 }val items = info.visibleItemsInfoval hero = items.firstOrNull { it.key == "hero" } ?: return@collectval end = items.firstOrNull { it.key == "tail" } ?: return@collect@@ -331,7 +338,7 @@ fun DeviceTabsScreen(}}}- item(key = "tail") { Spacer(Modifier.height(with(LocalDensity.current) { tail.toDp() })) }+ item(key = "tail") { Spacer(Modifier.height(with(LocalDensity.current) { tail.toDp() }).testTag("tail")) }}if (!offline) ui.request?.let { RequestDialog(it, ui.busy == ANSWERING, actions.answerRequest, actions.dismissRequest) }ui.sideload?.let { SideloadDialog(it, actions) }diff --git a/app/src/test/java/app/tellyscope/ScreenshotTest.kt b/app/src/test/java/app/tellyscope/ScreenshotTest.ktindex 18ed86e..222c01b 100644--- a/app/src/test/java/app/tellyscope/ScreenshotTest.kt+++ b/app/src/test/java/app/tellyscope/ScreenshotTest.kt@@ -27,6 +27,8 @@ import androidx.compose.ui.test.performScrollToNodeimport androidx.compose.ui.test.performScrollToIndeximport androidx.compose.ui.test.hasScrollActionimport androidx.compose.ui.test.hasText+import androidx.compose.ui.test.hasTestTag+import androidx.compose.ui.test.onNodeWithTagimport app.tellyscope.adb.ApkInfoimport app.tellyscope.adb.ConnectionRequestimport app.tellyscope.adb.InstallRefusal@@ -92,6 +94,7 @@ import java.nio.file.Filesimport kotlin.random.Randomimport kotlinx.coroutines.runBlockingimport org.junit.Assert.assertEquals+import org.junit.Assert.assertTrueimport org.junit.Ruleimport org.junit.Testimport org.junit.runner.RunWith@@ -290,6 +293,18 @@ class ScreenshotTest {TvFile("holiday-2025.mp4", 812_000_000, now - 3 * 86_400_000L),TvFile("family-trip-2025.mp4", 486_000_000, now - 9 * 86_400_000L),)))) }+ // The end space is Files' own: Apps, long after it, ends with none.+ @Test fun longTabAfterShortOneHasNoEndSpace() {+ compose.mainClock.autoAdvance = false+ compose.setContent { TellyscopeTheme(dynamic = false) { DeviceTabsScreen(md3State(), DeviceActions(), startTab = TvTab.Files) } }+ compose.mainClock.advanceTimeBy(1_000)+ assertTrue(compose.onNodeWithTag("tail").fetchSemanticsNode().size.height > 0)+ compose.onNodeWithText("Apps").performClick()+ compose.mainClock.advanceTimeBy(1_000)+ compose.onNode(hasScrollAction()).performScrollToNode(hasTestTag("tail"))+ compose.mainClock.advanceTimeBy(1_000)+ assertEquals(0, compose.onNodeWithTag("tail").fetchSemanticsNode().size.height)+ }@Test fun md3_files_movies() { shot("73_md3_files_movies") { DeviceTabsScreen(moviesState(), DeviceActions(), startTab = TvTab.Files) } }@Test fun md3_files_movies_dark() { shot("73_md3_files_movies", dark = true) { DeviceTabsScreen(moviesState(), DeviceActions(), startTab = TvTab.Files) } }@Test fun md3_files_offline() {