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.

Put Download and Movies in tabs under the TV, and let short tabs fold fully

jesse-agent-232c85ef643b216
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 537d47d..7e2e393 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ until this file has a section for its version.
- **Improved:** Debloat finds your TV's list itself, or its maker's, or lets you pick. [#70](../../pull/70)
- **Improved:** The TV tops every tab and folds into the bar as you scroll. [#71](../../pull/71)
- **Improved:** Apps splits into Running, Installed and Built-in tabs, with the apps the TV needs folded under System. [#72](../../pull/72)
+- **Improved:** Files puts Download and Movies in tabs under the TV, and short tabs now fold the TV fully into the bar. [#74](../../pull/74)
- **Fixed:** Welcome and pairing buttons no longer hide under the phone's navigation buttons. [#69](../../pull/69)
## 0.5.0 — 2026-10-24
diff --git a/README.md b/README.md
index b89d4fa..2810e05 100644
--- a/README.md
+++ b/README.md
@@ -91,7 +91,7 @@ Tellyscope is a phone app that talks to your Android TV, Google TV or Fire TV ov
- **Install apps.** Pick an APK, several split APKs or an `.apks`/`.xapk`/`.apkm` bundle on your phone. Before installing, Tellyscope shows the app's name, version and size and says whether it's new, an update, a reinstall or an older version. It won't install an older version over a newer one unless you tick the box. If the TV refuses, you get the reason in plain words.
- **TV tweaks.** **Block ads with Private DNS** sends the TV's address lookups to an ad-blocking DNS provider (AdGuard by default, or any other you type in). Tellyscope then checks the TV can still look addresses up, and puts the old setting back if not. It needs Android 9 or newer. **Faster animations** makes menus move at twice the speed. Both land in History with an Undo. **Clear caches** frees space by clearing every app's temporary files; app data and sign-ins stay. **Take screenshot** saves what the TV shows to your phone.
- **Connection requests.** When another device asks to debug the TV, Tellyscope shows the TV's "Allow debugging?" prompt on your phone, with the device's key fingerprint, so you can **Allow** or **Deny** it without the remote. **Always allow this device** appears when the TV's own prompt offers it.
-- **Files.** Send a file from your phone into the TV's Download or Movies folder, or save one from there to your phone. A file with the same name gets a " (1)" instead of being overwritten, and a cancelled copy leaves nothing half-written behind.
+- **Files.** Send a file from your phone into the TV's Download or Movies folder, or save one from there to your phone. The two folders are tabs under the TV, and stay pinned under the bar as you scroll. A file with the same name gets a " (1)" instead of being overwritten, and a cancelled copy leaves nothing half-written behind.
## Setting up your TV
diff --git a/app/src/main/java/app/tellyscope/ui/AppsTabs.kt b/app/src/main/java/app/tellyscope/ui/AppsTabs.kt
index de22b72..9e0285c 100644
--- a/app/src/main/java/app/tellyscope/ui/AppsTabs.kt
+++ b/app/src/main/java/app/tellyscope/ui/AppsTabs.kt
@@ -12,16 +12,11 @@ import androidx.compose.material.icons.filled.KeyboardArrowDown
import androidx.compose.material.icons.filled.KeyboardArrowUp
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.PrimaryTabRow
-import androidx.compose.material3.Tab
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
-import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.layout.layout
-import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import app.tellyscope.data.AppInfo
import app.tellyscope.data.Proc
@@ -53,24 +48,6 @@ internal fun splitApps(apps: List<AppInfo>, procs: List<Proc>, tab: AppsTab): Ap
return AppsSplit(rest, system)
}
-/** The three tabs, edge to edge across the list's side padding, pinned under the bar once the hero has folded. */
-@Composable
-internal fun AppsTabRow(tab: AppsTab, color: Color, inset: Dp, onTab: (AppsTab) -> Unit) {
- PrimaryTabRow(
- selectedTabIndex = tab.ordinal,
- containerColor = color,
- modifier = Modifier.layout { m, c ->
- val side = inset.roundToPx()
- val p = m.measure(c.copy(minWidth = c.maxWidth + 2 * side, maxWidth = c.maxWidth + 2 * side))
- layout(c.maxWidth, p.height) { p.place(-side, 0) }
- },
- ) {
- AppsTab.entries.forEach { t ->
- Tab(selected = tab == t, onClick = { onTab(t) }, text = { Text(t.label) })
- }
- }
-}
-
/** "System (N)" over the apps the TV needs; tapping it folds the list away or opens it again. */
@Composable
internal fun SystemHeader(count: Int, folded: Boolean, onFold: (Boolean) -> Unit) {
diff --git a/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt b/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt
index 219c240..72eafd7 100644
--- a/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt
+++ b/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt
@@ -10,8 +10,10 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
@@ -65,6 +67,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
+import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
@@ -74,11 +77,13 @@ import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.graphics.lerp
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.PathParser
+import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.unit.dp
+import app.tellyscope.adb.TvFolder
import app.tellyscope.data.Action
import app.tellyscope.data.AppInfo
import app.tellyscope.data.DeviceState
@@ -136,6 +141,17 @@ fun DeviceTabsScreen(
var heroHeight by remember { mutableIntStateOf(0) }
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.
+ var tail by remember { mutableIntStateOf(0) }
+ LaunchedEffect(list) {
+ snapshotFlow { list.layoutInfo }.collect { info ->
+ val items = info.visibleItemsInfo
+ val hero = items.firstOrNull { it.key == "hero" } ?: return@collect
+ val end = items.firstOrNull { it.key == "tail" } ?: return@collect
+ tail = tailSpace(hero.size, info.mainAxisItemSpacing, end.offset - hero.offset, info.afterContentPadding, info.viewportSize.height)
+ }
+ }
// The tabs share one list, so each opens at the top with its hero, not where the last one was left.
// "See changes" lands on Tweaks scrolled to Recent changes, the list's third item, after the hero.
var toChanges by remember { mutableStateOf(false) }
@@ -278,7 +294,7 @@ fun DeviceTabsScreen(
} else {
// Pinned under the bar once the hero has folded into it.
stickyHeader(key = "appsTabs") {
- AppsTabRow(appsTab, lerp(MaterialTheme.colorScheme.surface, MaterialTheme.colorScheme.surfaceContainer, collapse), inset = 16.dp) { appsTab = it }
+ PinnedTabRow(AppsTab.entries.map { it.label }, appsTab.ordinal, lerp(MaterialTheme.colorScheme.surface, MaterialTheme.colorScheme.surfaceContainer, collapse), inset = 16.dp) { appsTab = AppsTab.entries[it] }
}
val split = splitApps(ui.apps, procs, appsTab)
if (split.apps.isEmpty() && split.system.isEmpty()) item {
@@ -294,6 +310,12 @@ fun DeviceTabsScreen(
}
}
TvTab.Files -> {
+ // Pinned under the bar once the hero has folded into it, like the Apps tabs.
+ stickyHeader(key = "folders") {
+ PinnedTabRow(TvFolder.entries.map(Copy::folder), ui.files.folder.ordinal, lerp(MaterialTheme.colorScheme.surface, MaterialTheme.colorScheme.surfaceContainer, collapse), inset = 16.dp) {
+ if (!offline) actions.folder(TvFolder.entries[it])
+ }
+ }
if (offline) item { Muted("Connect to the TV to see its files.") }
else {
item { FilesBlock(ui.files, state.now, actions) }
@@ -309,6 +331,7 @@ fun DeviceTabsScreen(
}
}
}
+ item(key = "tail") { Spacer(Modifier.height(with(LocalDensity.current) { tail.toDp() })) }
}
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/main/java/app/tellyscope/ui/Transfers.kt b/app/src/main/java/app/tellyscope/ui/Transfers.kt
index 1c9b7e8..a6c2bde 100644
--- a/app/src/main/java/app/tellyscope/ui/Transfers.kt
+++ b/app/src/main/java/app/tellyscope/ui/Transfers.kt
@@ -29,9 +29,6 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.LinearWavyProgressIndicator
import androidx.compose.material3.LoadingIndicator
import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.SegmentedButton
-import androidx.compose.material3.SegmentedButtonDefaults
-import androidx.compose.material3.SingleChoiceSegmentedButtonRow
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
@@ -143,19 +140,9 @@ internal val Broom = ImageVector.Builder("Broom", 24.dp, 24.dp, 24f, 24f)
)
.build()
-/** Body of the Files section: the folder switch, then the folder's files, each one tap from the phone. */
+/** Body of the Files tab, under its folder tabs: the folder's files, each one tap from the phone. */
@Composable
fun FilesBlock(files: FilesUi, now: Long, actions: DeviceActions) {
- SingleChoiceSegmentedButtonRow(Modifier.fillMaxWidth()) {
- TvFolder.entries.forEachIndexed { i, f ->
- SegmentedButton(
- selected = files.folder == f,
- onClick = { actions.folder(f) },
- shape = SegmentedButtonDefaults.itemShape(i, TvFolder.entries.size),
- ) { Text(Copy.folder(f)) }
- }
- }
- Spacer(Modifier.size(4.dp))
val list = files.list
when {
list == null -> Row(Modifier.fillMaxWidth().padding(8.dp), horizontalArrangement = Arrangement.Center) {
diff --git a/app/src/main/java/app/tellyscope/ui/TvHeader.kt b/app/src/main/java/app/tellyscope/ui/TvHeader.kt
index 8a31115..ab6c819 100644
--- a/app/src/main/java/app/tellyscope/ui/TvHeader.kt
+++ b/app/src/main/java/app/tellyscope/ui/TvHeader.kt
@@ -26,7 +26,9 @@ import androidx.compose.material3.FilterChip
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialShapes
import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.PrimaryTabRow
import androidx.compose.material3.Surface
+import androidx.compose.material3.Tab
import androidx.compose.material3.Text
import androidx.compose.material3.toShape
import androidx.compose.runtime.Composable
@@ -34,8 +36,10 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
+import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.TransformOrigin
import androidx.compose.ui.graphics.graphicsLayer
+import androidx.compose.ui.layout.layout
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
@@ -66,6 +70,15 @@ internal fun detailAlpha(f: Float) = (1f - 2f * f).coerceIn(0f, 1f)
/** The bar title comes in over the last third, as the hero's name passes under the bar. */
internal fun titleAlpha(f: Float) = ((f - 0.67f) / 0.33f).coerceIn(0f, 1f)
+/**
+ * The blank space a tab needs after its last item so the hero can scroll fully under the bar,
+ * 0 when the tab is long enough already. From the list laid out with the hero and the space both
+ * in view: [heroSize] and [spacing] are the hero item and the gap after it, [contentEnd] where the
+ * space starts measured from the hero's top, [afterPadding] the list's end padding.
+ */
+internal fun tailSpace(heroSize: Int, spacing: Int, contentEnd: Int, afterPadding: Int, viewport: Int): Int =
+ (heroSize + spacing - (contentEnd + afterPadding - viewport)).coerceAtLeast(0)
+
/** The TV's cookie tile: primary while it's connected, grey when it isn't. */
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
@@ -177,3 +190,21 @@ private fun TvChips(state: UiState, actions: DeviceActions) {
AssistChip(onClick = actions.addDevice, label = { Text("Device") }, leadingIcon = { Icon(Icons.Default.Add, contentDescription = "Add a", Modifier.size(18.dp)) })
}
}
+
+/** A tab's own tabs, edge to edge across the list's side [inset], pinned under the bar once the hero has folded. */
+@Composable
+internal fun PinnedTabRow(labels: List<String>, selected: Int, color: Color, inset: Dp, onSelect: (Int) -> Unit) {
+ PrimaryTabRow(
+ selectedTabIndex = selected,
+ containerColor = color,
+ modifier = Modifier.layout { m, c ->
+ val side = inset.roundToPx()
+ val p = m.measure(c.copy(minWidth = c.maxWidth + 2 * side, maxWidth = c.maxWidth + 2 * side))
+ layout(c.maxWidth, p.height) { p.place(-side, 0) }
+ },
+ ) {
+ labels.forEachIndexed { i, label ->
+ Tab(selected = selected == i, onClick = { onSelect(i) }, text = { Text(label) })
+ }
+ }
+}
diff --git a/app/src/test/java/app/tellyscope/ScreenshotTest.kt b/app/src/test/java/app/tellyscope/ScreenshotTest.kt
index 6bd4d33..18ed86e 100644
--- a/app/src/test/java/app/tellyscope/ScreenshotTest.kt
+++ b/app/src/test/java/app/tellyscope/ScreenshotTest.kt
@@ -12,6 +12,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.test.junit4.v2.createComposeRule
+import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsEnabled
import androidx.compose.ui.test.assertIsNotDisplayed
import androidx.compose.ui.test.assertIsNotEnabled
@@ -279,7 +280,50 @@ class ScreenshotTest {
@Test fun md3_apps_collapsed_dark() = collapsed("64_md3_apps_collapsed", true, "Connected", TvTab.Apps)
@Config(qualifiers = "w411dp-h640dp-xxhdpi")
@Test fun md3_files_collapsed() = collapsed("65_md3_files_collapsed", false, "Connected", TvTab.Files)
+ @Config(qualifiers = "w411dp-h640dp-xxhdpi")
+ @Test fun md3_files_collapsed_dark() = collapsed("65_md3_files_collapsed", true, "Connected", TvTab.Files)
+ // On a tall screen the short tabs still fold the hero fully into the bar: the end space makes the room.
+ @Test fun md3_files_foldsOnTallScreen() = collapsed("65_md3_files_collapsed_tall", false, "Connected", TvTab.Files)
+ @Test fun md3_tweaks_foldsOnTallScreen() = collapsed("66_md3_tweaks_collapsed_tall", false, "Connected", TvTab.Tweaks)
+ // Download and Movies are tabs under the hero now, like Apps.
+ private fun moviesState() = md3State().let { it.copy(device = it.device.copy(files = FilesUi(TvFolder.MOVIES, listOf(
+ 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),
+ )))) }
+ @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() {
+ shot("74_md3_files_offline") { DeviceTabsScreen(offlineMd3(), DeviceActions(), startTab = TvTab.Files) }
+ compose.onNodeWithText("Movies").assertExists()
+ compose.onNodeWithText("Connect to the TV to see its files.").assertExists()
+ }
+ @Test fun md3_files_offline_dark() { shot("74_md3_files_offline", dark = true) { DeviceTabsScreen(offlineMd3(), DeviceActions(), startTab = TvTab.Files) } }
+ @Test fun filesTabsPickTheFolder() {
+ val picked = mutableListOf<TvFolder>()
+ compose.mainClock.autoAdvance = false
+ compose.setContent { TellyscopeTheme(dynamic = false) { DeviceTabsScreen(md3State(), DeviceActions(folder = { picked += it }), startTab = TvTab.Files) } }
+ compose.mainClock.advanceTimeBy(1_000)
+ compose.onNodeWithText("Movies").performClick()
+ compose.mainClock.advanceTimeBy(1_000)
+ assertEquals(listOf(TvFolder.MOVIES), picked)
+ }
@Test fun md3_tweaks() { shot("66_md3_tweaks") { DeviceTabsScreen(md3State(), DeviceActions(), startTab = TvTab.Tweaks) } }
+ @Test fun md3_tweaks_dark() { shot("66_md3_tweaks", dark = true) { DeviceTabsScreen(md3State(), DeviceActions(), startTab = TvTab.Tweaks) } }
+ @Test fun md3_tweaks_offline() { shot("75_md3_tweaks_offline") { DeviceTabsScreen(offlineMd3(), DeviceActions(), startTab = TvTab.Tweaks) } }
+ @Test fun md3_tweaks_offline_dark() { shot("75_md3_tweaks_offline", dark = true) { DeviceTabsScreen(offlineMd3(), DeviceActions(), startTab = TvTab.Tweaks) } }
+ @Config(qualifiers = "w411dp-h640dp-xxhdpi")
+ @Test fun md3_tweaks_collapsed_dark() = collapsed("66_md3_tweaks_collapsed", true, "Connected", TvTab.Tweaks)
+ // "See changes" on Overview still lands on Tweaks at Recent changes, the end space notwithstanding.
+ @Test fun seeChangesLandsOnRecentChanges() {
+ compose.mainClock.autoAdvance = false
+ compose.setContent { TellyscopeTheme(dynamic = false) { DeviceTabsScreen(md3State(), DeviceActions()) } }
+ compose.mainClock.advanceTimeBy(1_000)
+ compose.onNode(hasScrollAction()).performScrollToNode(hasText("See changes"))
+ compose.onNodeWithText("See changes").performClick()
+ compose.mainClock.advanceTimeBy(1_000)
+ compose.onNodeWithText("Recent changes").assertIsDisplayed()
+ compose.onAllNodesWithText("Connected").onFirst().assertExists() // folded into the bar
+ }
@Config(qualifiers = "w411dp-h640dp-xxhdpi")
@Test fun md3_tweaks_collapsed() = collapsed("66_md3_tweaks_collapsed", false, "Connected", TvTab.Tweaks)
diff --git a/app/src/test/java/app/tellyscope/TvHeaderTest.kt b/app/src/test/java/app/tellyscope/TvHeaderTest.kt
index f0312a4..4bfa702 100644
--- a/app/src/test/java/app/tellyscope/TvHeaderTest.kt
+++ b/app/src/test/java/app/tellyscope/TvHeaderTest.kt
@@ -4,6 +4,7 @@ package app.tellyscope
import app.tellyscope.ui.collapsedFraction
import app.tellyscope.ui.detailAlpha
+import app.tellyscope.ui.tailSpace
import app.tellyscope.ui.titleAlpha
import org.junit.Assert.assertEquals
import org.junit.Test
@@ -26,4 +27,14 @@ class TvHeaderTest {
// Never both out of sight with nothing in the bar: the title starts once the details are gone.
assertEquals(0f, detailAlpha(0.67f), 0.001f)
}
+
+ @Test fun aShortTabGetsJustEnoughSpaceToFoldTheHero() {
+ // Hero 600 + 36 gap; the rest ends 900 below the hero's top, then 288 of end padding, on a 1800 screen:
+ // it can't scroll at all (900 + 288 < 1800, 612 short), so it needs 612 + 636 = 1248.
+ assertEquals(1248, tailSpace(heroSize = 600, spacing = 36, contentEnd = 900, afterPadding = 288, viewport = 1800))
+ // Already scrolls 3000 + 288 - 1800 = 1488, past the hero: nothing added.
+ assertEquals(0, tailSpace(600, 36, 3000, 288, 1800))
+ // Exactly long enough: still nothing.
+ assertEquals(0, tailSpace(600, 36, 2148, 288, 1800))
+ }
}
diff --git a/docs/screenshots/files.png b/docs/screenshots/files.png
index 2309f6a..93d2e73 100644
Binary files a/docs/screenshots/files.png and b/docs/screenshots/files.png differ
diff --git a/docs/screenshots/history.png b/docs/screenshots/history.png
index f31aabd..3057e74 100644
Binary files a/docs/screenshots/history.png and b/docs/screenshots/history.png differ