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.
Carry the TV into the bar, and use buttons and empty pages on Apps and Files
jesse-agent-232d9133a09576f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7e2e393..128a8ed 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -15,7 +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)+- **Improved:** The TV's icon and name glide into the bar, Apps and Files pin their buttons, and empty pages say so. [#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-24diff --git a/NOTICE b/NOTICEindex a7b28ab..d822099 100644--- a/NOTICE+++ b/NOTICE@@ -24,8 +24,9 @@ License: Apache License 2.0The TV and HDMI (streaming stick) device icons use the path data of the"tv" and "settings_input_hdmi" icons, the Debloat button that of"cleaning_services", the off-Wi-Fi screen that of "wifi_off", and the-Apps, Files and Tweaks tabs those of "apps", "folder" and "tune", and the-Upload files button that of "upload".+Apps, Files and Tweaks tabs those of "apps", "folder" and "tune", the+Upload files button that of "upload", and the empty Movies folder that of+"movie".--------------------------------------------------------------------------------cleanyourtv — https://github.com/Gathin23/cleanyourtvdiff --git a/README.md b/README.mdindex 2810e05..efc99b4 100644--- a/README.md+++ b/README.md@@ -81,17 +81,17 @@ Tellyscope is a phone app that talks to your Android TV, Google TV or Fire TV ov- **Find and connect.** It looks for TVs on your Wi-Fi, or you add one by IP address. Classic network debugging (port 5555) and Android 11+ wireless debugging with a 6-digit pairing code both work. **Add your TV** walks through turning debugging on one step at a time, with the menu names for Google TV, Android TV, Fire TV, Xiaomi or XGIMI, then lists the TVs it found. Each TV opens its own screen: the pairing code, or the Allow box with this phone's key to check against the one the TV shows. The first launch opens a short welcome with the three setup steps, and on Android 17 or newer asks for the local-network permission it needs to reach the TV.- **Remembers your TVs.** They reconnect on their own after a restart of the app or the TV. You can rename a TV (the name stays on your phone) or forget it.-- **How it's doing.** Every tab of a TV's page opens with the TV itself: its name, maker and model, and a one-line summary such as "Running fine" or "Storage almost full". Scroll, and it folds into the top bar as a small icon, the name and a Connected or Offline badge. On Overview, below that is a chip per TV to switch between them, then a **+ Device** chip. Then comes free space as a bar, with CPU, RAM, temperature and network speed. When a TV is offline, it shows the storage from the last time Tellyscope saw it. Its address and how long it's been on are under Advanced.+- **How it's doing.** Every tab of a TV's page opens with the TV itself: its name, maker and model, and a one-line summary such as "Running fine" or "Storage almost full". Scroll, and its icon and name shrink and slide up into the top bar, where a Connected or Offline badge joins them. On Overview, below that is a chip per TV to switch between them, then a **+ Device** chip. Then comes free space as a bar, with CPU, RAM, temperature and network speed. When a TV is offline, it shows the storage from the last time Tellyscope saw it. Its address and how long it's been on are under Advanced.- **The main jobs up front.** Big **Install app**, **Debloat** and **Send file** tiles sit right under the vitals. Debloat shows a count while the TV's list still has apps on, or while apps Tellyscope turned off are back on, often after a TV update. When there's nothing left, it opens Apps instead. Under **Suggested for this TV**, one line says how many of the list's apps are off. If any came back on, a red line says so. Below that are the TV's Android version, when it last updated, and **Check for updates**, which opens the TV's own update screen. The Apps tab has an **Install app** button, and Files has **Upload files**.- **Advanced.** Every number in one place: memory, storage, CPU, temperature, uptime and screen state, CPU and RAM by app, processes, network and data used, and the TV's address.-- **Apps.** Every app on the TV with its real name and icon, in three tabs: **Running** (what's using memory now), **Installed** (only the apps you put on the TV) and **Built-in** (what came with it). Stop, disable or turn back on any app that isn't protected; each button says what it will do and asks first. Apps you installed yourself also offer **Uninstall**, which asks in a dialog that names the app and says it can't be undone. On Running and Built-in, the protected apps sit last under **System**, which folds away with a tap and stays folded until you open it again. Search looks through every app.+- **Apps.** Every app on the TV with its real name and icon, under three buttons: **Running** (what's using memory now), **Installed** (only the apps you put on the TV) and **Built-in** (what came with it). The buttons stay pinned under the bar as you scroll. Stop, disable or turn back on any app that isn't protected; each button says what it will do and asks first. Apps you installed yourself also offer **Uninstall**, which asks in a dialog that names the app and says it can't be undone. On Running and Built-in, the protected apps sit last under **System**, which folds away with a tap and stays folded until you open it again. Search looks through every app.- **Another home screen.** With a second launcher such as Projectivy installed, its row in Apps offers **Set as default launcher**. Tellyscope makes it Home, checks that Home really opens it, and only then disables the old launcher, so the TV can't switch back by itself. One Undo in History turns the old launcher back on and makes it Home again. On Google TV, the Apps row and the Live tab are part of the old launcher and go with it.- **Debloat.** It finds your TV among 230+ tested clean-up lists (adapted from [cleanyourtv](https://github.com/Gathin23/cleanyourtv)) and opens on every app it will turn off, with the model on top. With no list for the model, it shows apps from the maker's other lists, none ticked. With none for the maker either, you tick the TV's own apps by hand; the ones it needs aren't shown. **Not this TV?** searches every list. Your pick is remembered, and the TV's page then says how many of the list's apps are still on. Apps are pre-ticked only when the TV runs the Android version the list was tested on; untick anything you use, and you confirm before anything is disabled. If you'd rather not trust our lists, point the app at your own fork of them in Settings (see [CONTRIBUTING](CONTRIBUTING.md#using-your-own-lists)).- **History.** Every change is listed with an Undo, and **Restore everything** turns back on what Tellyscope turned off. Undoing a **Turn on** asks first, since it disables the app again. History is kept per TV, across restarts.- **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. 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.+- **Files.** Send a file from your phone into the TV's Download or Movies folder, or save one from there to your phone. Two buttons under the TV pick the folder, and stay pinned under the bar as you scroll. An empty folder says so in the middle of the page. 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 TVdiff --git a/app/src/main/java/app/tellyscope/ui/Copy.kt b/app/src/main/java/app/tellyscope/ui/Copy.ktindex 5a6f06b..3bdf30b 100644--- a/app/src/main/java/app/tellyscope/ui/Copy.kt+++ b/app/src/main/java/app/tellyscope/ui/Copy.kt@@ -153,6 +153,7 @@ object Copy {const val SYSTEM_WHY = "Needed by the TV · can't be changed"/** Running, with no word from the TV. */+ const val TV_OFFLINE = "TV offline"const val RUNNING_OFFLINE = "Running apps show here once the TV is connected."const val ANDROID_SYSTEM = AppNames.SYSTEMdiff --git a/app/src/main/java/app/tellyscope/ui/DeviceScreen.kt b/app/src/main/java/app/tellyscope/ui/DeviceScreen.ktindex b559996..133d309 100644--- a/app/src/main/java/app/tellyscope/ui/DeviceScreen.kt+++ b/app/src/main/java/app/tellyscope/ui/DeviceScreen.kt@@ -22,7 +22,6 @@ import androidx.compose.material.icons.Iconsimport androidx.compose.material.icons.filled.Checkimport androidx.compose.material.icons.filled.CheckCircleimport androidx.compose.material.icons.filled.Info-import androidx.compose.material.icons.filled.Lockimport androidx.compose.material.icons.filled.Warningimport androidx.compose.material3.AlertDialogimport androidx.compose.material3.Button@@ -400,9 +399,6 @@ internal fun AppRow(color = MaterialTheme.colorScheme.onSurfaceVariant,)}- if (app.protectedReason != null) {- Icon(Icons.Default.Lock, contentDescription = "Protected", Modifier.size(20.dp), tint = MaterialTheme.colorScheme.onSurfaceVariant)- }if (busy) androidx.compose.material3.LoadingIndicator(Modifier.size(32.dp))}val proposed = pending?.takeIf { it.first == app.packageName }?.seconddiff --git a/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt b/app/src/main/java/app/tellyscope/ui/DeviceTabs.ktindex 3697cf5..25b3e31 100644--- a/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt+++ b/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-3.0-only-// Apps, Files and Tweaks icons are the Material Icons "apps", "folder" and "tune", and Upload is-// "upload" (Apache-2.0), see NOTICE.+// Apps, Files and Tweaks icons are the Material Icons "apps", "folder" and "tune", Upload is+// "upload" and Movie is "movie" (Apache-2.0), see NOTICE.package app.tellyscope.ui@@ -74,7 +74,6 @@ import androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.graphics.PathFillTypeimport androidx.compose.ui.graphics.SolidColor-import androidx.compose.ui.graphics.graphicsLayerimport androidx.compose.ui.graphics.lerpimport androidx.compose.ui.graphics.vector.ImageVectorimport androidx.compose.ui.graphics.vector.PathParser@@ -142,7 +141,7 @@ fun DeviceTabsScreen(// The hero tops every tab and collapses into the bar as the tab scrolls.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 } }+ val morph = remember { HeroMorph() }// 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, and kept while scrolled; a different list// (another tab, sub-tab or folder, or items coming and going) starts again from none.@@ -170,179 +169,191 @@ fun DeviceTabsScreen(toChanges = false}- Scaffold(- snackbarHost = { SnackbarHost(snackbar) },- // Each tab's main action as Material's extended FAB: install on Apps, upload on Files.- floatingActionButton = {- if (!offline) when (tab) {- TvTab.Apps -> ExtendedFloatingActionButton(onClick = actions.pickApp, icon = { Icon(Icons.Default.Add, null) }, text = { Text("Install app") })- TvTab.Files -> ExtendedFloatingActionButton(onClick = { actions.pickFile(ui.files.folder) }, icon = { Icon(TileIcons.Upload, null) }, text = { Text("Upload files") })- else -> {}- }- },- topBar = {- if (searching) {- TopAppBar(- title = {- TextField(- value = state.query,- onValueChange = actions.query,- placeholder = { Text("Search apps") },- singleLine = true,- colors = TextFieldDefaults.colors(- focusedContainerColor = Color.Transparent,- unfocusedContainerColor = Color.Transparent,- ),- modifier = Modifier.fillMaxWidth(),- )- },- actions = {- IconButton(onClick = { searching = false; actions.query("") }) {- Icon(Icons.Default.Close, contentDescription = "Close search")- }- },- )- } else {- TopAppBar(- // Each tab shows the TV big below, and in the bar once it has scrolled under it.- title = { if (barTitle) TvBarTitle(device, Modifier.graphicsLayer { alpha = titleAlpha(collapse) }) },- colors = TopAppBarDefaults.topAppBarColors(- containerColor = lerp(MaterialTheme.colorScheme.surface, MaterialTheme.colorScheme.surfaceContainer, collapse),- ),- actions = {- if (REMOTE_ENABLED) TextButton(onClick = actions.remote, enabled = !offline) { Text("Remote") }- // Search only looks through apps, so it only shows on the Apps tab.- if (tab == TvTab.Apps) {- IconButton(onClick = { searching = true }, enabled = !offline) {- Icon(Icons.Default.Search, contentDescription = "Search apps")+ Box {+ Scaffold(+ snackbarHost = { SnackbarHost(snackbar) },+ // Each tab's main action as Material's extended FAB: install on Apps, upload on Files.+ floatingActionButton = {+ if (!offline) when (tab) {+ TvTab.Apps -> ExtendedFloatingActionButton(onClick = actions.pickApp, icon = { Icon(Icons.Default.Add, null) }, text = { Text("Install app") })+ TvTab.Files -> ExtendedFloatingActionButton(onClick = { actions.pickFile(ui.files.folder) }, icon = { Icon(TileIcons.Upload, null) }, text = { Text("Upload files") })+ else -> {}+ }+ },+ topBar = {+ if (searching) {+ TopAppBar(+ title = {+ TextField(+ value = state.query,+ onValueChange = actions.query,+ placeholder = { Text("Search apps") },+ singleLine = true,+ colors = TextFieldDefaults.colors(+ focusedContainerColor = Color.Transparent,+ unfocusedContainerColor = Color.Transparent,+ ),+ modifier = Modifier.fillMaxWidth(),+ )+ },+ actions = {+ IconButton(onClick = { searching = false; actions.query("") }) {+ Icon(Icons.Default.Close, contentDescription = "Close search")}- }- AppMenu(state, actions)- },- )- }- },- bottomBar = {- ShortNavigationBar {- TvTab.entries.forEach { t ->- ShortNavigationBarItem(- selected = tab == t,- onClick = {- // Leaving Apps closes the search, so the list isn't still filtered on return.- if (t != TvTab.Apps && searching) { searching = false; actions.query("") }- tab = t},- icon = { Icon(t.icon(), contentDescription = null) },- label = { Text(t.label) },+ )+ } else {+ TopAppBar(+ // Each tab shows the TV big below, and in the bar once it has scrolled under it.+ title = { TvBarTitle(device, collapse = { collapse }, morph = morph) },+ colors = TopAppBarDefaults.topAppBarColors(+ containerColor = lerp(MaterialTheme.colorScheme.surface, MaterialTheme.colorScheme.surfaceContainer, collapse),+ ),+ actions = {+ if (REMOTE_ENABLED) TextButton(onClick = actions.remote, enabled = !offline) { Text("Remote") }+ // Search only looks through apps, so it only shows on the Apps tab.+ if (tab == TvTab.Apps) {+ IconButton(onClick = { searching = true }, enabled = !offline) {+ Icon(Icons.Default.Search, contentDescription = "Search apps")+ }+ }+ AppMenu(state, actions)+ },)}- }- },- ) { pad ->- LazyColumn(- Modifier.fillMaxSize().padding(pad),- state = list,- // No top padding: the Apps tabs pin at the list's top edge, flush under the bar; the hero carries the 4dp.- contentPadding = PaddingValues(start = 16.dp, end = 16.dp, bottom = 96.dp),- verticalArrangement = Arrangement.spacedBy(12.dp),- ) {- val snap = ui.snapshot- val live = snap?.takeIf { !offline }- item(key = "hero") { Box(Modifier.padding(top = 4.dp)) { TvHero(state, live, actions, chips = tab == TvTab.Overview, collapse = { collapse }, onHeight = { heroHeight = it }) } }- when (tab) {- TvTab.Overview -> {- val restart = state.restarting[device.id]- if (restart != null) {- item { RestartingCard(restart, state.now) }- } else if (device.state == DeviceState.NotAllowed) {- item { NotAllowedCard(actions.reconnect) }- } else if (offline) {- item { OfflineCard(device, state.now, actions.reconnect) }- }- // Away, storage is the last one seen, this session's or the saved one after a restart.- val used = snap?.storageUsedGb ?: device.lastKnown?.storageUsedGb- val total = snap?.storageTotalGb ?: device.lastKnown?.storageTotalGb- if (live != null) {- item { SystemWidget(live) }- } else if (offline && used != null && total != null) {- item { SystemWidget(used, total, null, asOf = device.lastSeen?.let { Copy.ago(it, state.now) } ?: "the last visit") }- } else if (offline) {- item { Muted(Copy.noStats(device.state)) }- }- val debloat = debloatState(ui)- if (!offline) {- item {- ActionTiles(- actions,- count = debloat.count,- todo = debloat.todo,- disabling = ui.busy == DISABLING,- // With nothing left on the list, Debloat leads to the apps for one-off changes.- onDebloat = if (debloat.todo) actions.debloat else ({ tab = TvTab.Apps }),- )- }+ },+ bottomBar = {+ ShortNavigationBar {+ TvTab.entries.forEach { t ->+ ShortNavigationBarItem(+ selected = tab == t,+ onClick = {+ // Leaving Apps closes the search, so the list isn't still filtered on return.+ if (t != TvTab.Apps && searching) { searching = false; actions.query("") }+ tab = t+ },+ icon = { Icon(t.icon(), contentDescription = null) },+ label = { Text(t.label) },+ )}- item { SectionTitle("Suggested for this TV") }- item { SuggestedCard(ui.lists, debloat, offline, onChanges = { toChanges = true; tab = TvTab.Tweaks }) }- item { AndroidCard(state, snap, offline, onUpdates = actions.checkUpdates) }}- TvTab.Apps -> {- val procs = snap?.procs.orEmpty()- fun rows(apps: List<AppInfo>) = items(apps, key = { it.packageName }) { app ->- AppRow(app, procs, ui.pending, ui.busy == app.packageName, actions, homeLabel(ui.apps, app))- }- if (q.isNotEmpty()) {- // A search looks through every app, whichever tab it's on.- val found = ui.apps- .filter { it.label.lowercase().contains(q) || it.packageName.contains(q) }- .sortedWith(compareBy({ !it.enabled }, { it.system }, { it.label }))- if (found.isEmpty()) item { EmptyLine(q) }- rows(found)- } else {- // Pinned under the bar once the hero has folded into it.- stickyHeader(key = "appsTabs") {- PinnedTabRow(AppsTab.entries.map { it.label }, appsTab.ordinal, lerp(MaterialTheme.colorScheme.surface, MaterialTheme.colorScheme.surfaceContainer, collapse), inset = 16.dp) { appsTab = AppsTab.entries[it] }+ },+ ) { pad ->+ LazyColumn(+ Modifier.fillMaxSize().padding(pad),+ state = list,+ // No top padding: the Apps tabs pin at the list's top edge, flush under the bar; the hero carries the 4dp.+ contentPadding = PaddingValues(start = 16.dp, end = 16.dp, bottom = 96.dp),+ verticalArrangement = Arrangement.spacedBy(12.dp),+ ) {+ val snap = ui.snapshot+ val live = snap?.takeIf { !offline }+ item(key = "hero") { Box(Modifier.padding(top = 4.dp)) { TvHero(state, live, actions, chips = tab == TvTab.Overview, collapse = { collapse }, morph = morph, onHeight = { heroHeight = it }) } }+ when (tab) {+ TvTab.Overview -> {+ val restart = state.restarting[device.id]+ if (restart != null) {+ item { RestartingCard(restart, state.now) }+ } else if (device.state == DeviceState.NotAllowed) {+ item { NotAllowedCard(actions.reconnect) }+ } else if (offline) {+ item { OfflineCard(device, state.now, actions.reconnect) }}- val split = splitApps(ui.apps, procs, appsTab)- if (split.apps.isEmpty() && split.system.isEmpty()) item {- // Away, the TV can't say what's running, rather than nothing is.- if (appsTab == AppsTab.Running && live == null) Muted(Copy.RUNNING_OFFLINE) else EmptyLine(q)+ // Away, storage is the last one seen, this session's or the saved one after a restart.+ val used = snap?.storageUsedGb ?: device.lastKnown?.storageUsedGb+ val total = snap?.storageTotalGb ?: device.lastKnown?.storageTotalGb+ if (live != null) {+ item { SystemWidget(live) }+ } else if (offline && used != null && total != null) {+ item { SystemWidget(used, total, null, asOf = device.lastSeen?.let { Copy.ago(it, state.now) } ?: "the last visit") }+ } else if (offline) {+ item { Muted(Copy.noStats(device.state)) }}- rows(split.apps)- if (split.system.isNotEmpty()) {- val folded = appsTab in state.foldedSystem- item(key = "system") { SystemHeader(split.system.size, folded) { actions.foldSystem(appsTab, it) } }- if (!folded) rows(split.system)+ val debloat = debloatState(ui)+ if (!offline) {+ item {+ ActionTiles(+ actions,+ count = debloat.count,+ todo = debloat.todo,+ disabling = ui.busy == DISABLING,+ // With nothing left on the list, Debloat leads to the apps for one-off changes.+ onDebloat = if (debloat.todo) actions.debloat else ({ tab = TvTab.Apps }),+ )+ }}+ item { SectionTitle("Suggested for this TV") }+ item { SuggestedCard(ui.lists, debloat, offline, onChanges = { toChanges = true; tab = TvTab.Tweaks }) }+ item { AndroidCard(state, snap, offline, onUpdates = actions.checkUpdates) }}- }- 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])+ TvTab.Apps -> {+ val procs = snap?.procs.orEmpty()+ fun rows(apps: List<AppInfo>) = items(apps, key = { it.packageName }) { app ->+ AppRow(app, procs, ui.pending, ui.busy == app.packageName, actions, homeLabel(ui.apps, app))+ }+ if (q.isNotEmpty()) {+ // A search looks through every app, whichever tab it's on.+ val found = ui.apps+ .filter { it.label.lowercase().contains(q) || it.packageName.contains(q) }+ .sortedWith(compareBy({ !it.enabled }, { it.system }, { it.label }))+ if (found.isEmpty()) item { EmptyLine(q) }+ rows(found)+ } else {+ // Pinned under the bar once the hero has folded into it.+ stickyHeader(key = "appsTabs") {+ PinnedSegments(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 {+ // Away, the TV can't say what's running, rather than nothing is.+ if (appsTab == AppsTab.Running && live == null) EmptyState(DeviceIcons.Tv, Copy.TV_OFFLINE, Copy.RUNNING_OFFLINE) else EmptyLine(q)+ }+ rows(split.apps)+ if (split.system.isNotEmpty()) {+ val folded = appsTab in state.foldedSystem+ item(key = "system") { SystemHeader(split.system.size, folded) { actions.foldSystem(appsTab, it) } }+ if (!folded) rows(split.system)+ }}}- if (offline) item { Muted("Connect to the TV to see its files.") }- else {- item { FilesBlock(ui.files, state.now, actions) }+ TvTab.Files -> {+ // Pinned under the bar once the hero has folded into it, like the Apps tabs.+ stickyHeader(key = "folders") {+ PinnedSegments(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])+ }+ }+ val folder = ui.files.folder+ when {+ offline -> item { EmptyState(DeviceIcons.Tv, Copy.TV_OFFLINE, "Connect to the TV to see its files.") }+ ui.files.error == null && ui.files.list?.isEmpty() == true -> item {+ EmptyState(+ if (folder == TvFolder.MOVIES) TileIcons.Movie else TabIcons.Folder,+ "Nothing in ${Copy.folder(folder)} yet",+ "Files you send land here.",+ )+ }+ else -> item { FilesBlock(ui.files, state.now, actions) }+ }}- }- TvTab.Tweaks -> {- if (offline) item { Muted("Connect to the TV to change its settings.") }- else item { Panel(Copy.TWEAKS) { TweaksBlock(ui, actions) } }- item {- Panel("Recent changes") {- HistoryList(ui.history, state.now, actions.undo, restoring = ui.busy == RESTORING, onRestoreAll = actions.restoreAll)+ TvTab.Tweaks -> {+ if (offline) item { Muted("Connect to the TV to change its settings.") }+ else item { Panel(Copy.TWEAKS) { TweaksBlock(ui, actions) } }+ item {+ Panel("Recent changes") {+ HistoryList(ui.history, state.now, actions.undo, restoring = ui.busy == RESTORING, onRestoreAll = actions.restoreAll)+ }}}}+ item(key = "tail") { Spacer(Modifier.height(with(LocalDensity.current) { tail.toDp() }).testTag("tail")) }}- 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) }+ ui.transfer?.let { TransferDialog(it, actions.cancelTransfer) }}- if (!offline) ui.request?.let { RequestDialog(it, ui.busy == ANSWERING, actions.answerRequest, actions.dismissRequest) }- ui.sideload?.let { SideloadDialog(it, actions) }- ui.transfer?.let { TransferDialog(it, actions.cancelTransfer) }+ // Over everything, so the cookie and name can pass from the list into the bar.+ if (!searching) HeroMorphOverlay(device, morph) { collapse }}}@@ -507,7 +518,9 @@ private fun StatusRow(icon: ImageVector, title: String, sub: String?, button: Stprivate object TileIcons {- val Upload = icon("Upload", "M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z")+ // Absolute commands only: Compose's path parser misplaces a relative move after a close.+ val Upload = icon("Upload", "M9 16H15V10H19L12 3L5 10H9ZM5 18H19V20H5Z")+ val Movie = icon("Movie", "M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z")private fun icon(name: String, path: String) = ImageVector.Builder(name, 24.dp, 24.dp, 24f, 24f).addPath(PathParser().parsePathString(path).toNodes(), pathFillType = PathFillType.NonZero, fill = SolidColor(Color.Black))diff --git a/app/src/main/java/app/tellyscope/ui/Transfers.kt b/app/src/main/java/app/tellyscope/ui/Transfers.ktindex a6c2bde..bf9eb0f 100644--- a/app/src/main/java/app/tellyscope/ui/Transfers.kt+++ b/app/src/main/java/app/tellyscope/ui/Transfers.kt@@ -150,10 +150,12 @@ fun FilesBlock(files: FilesUi, now: Long, actions: DeviceActions) {LoadingIndicator(Modifier.size(32.dp))}files.error != null -> Muted(files.error)- list.isEmpty() -> Muted("Nothing in ${Copy.folder(files.folder)} yet. Files you send land here.")- else -> list.forEach { f -> FileRow(f, now) { actions.saveFile(f) } }+ else -> {+ list.forEach { f -> FileRow(f, now) { actions.saveFile(f) } }+ // Only with files to tap; an empty folder shows its own page instead.+ if (list.isNotEmpty()) Muted("Tap a file to save a copy on your phone.")+ }}- Muted("Tap a file to save a copy on your phone.")}@Composablediff --git a/app/src/main/java/app/tellyscope/ui/TvHeader.kt b/app/src/main/java/app/tellyscope/ui/TvHeader.ktindex ab6c819..7daff95 100644--- a/app/src/main/java/app/tellyscope/ui/TvHeader.kt+++ b/app/src/main/java/app/tellyscope/ui/TvHeader.kt@@ -9,7 +9,9 @@ import androidx.compose.foundation.layout.Columnimport androidx.compose.foundation.layout.FlowRowimport androidx.compose.foundation.layout.Rowimport androidx.compose.foundation.layout.Spacer+import androidx.compose.foundation.layout.fillMaxSizeimport androidx.compose.foundation.layout.fillMaxWidth+import androidx.compose.foundation.layout.heightimport androidx.compose.foundation.layout.offsetimport androidx.compose.foundation.layout.paddingimport androidx.compose.foundation.layout.size@@ -26,24 +28,44 @@ import androidx.compose.material3.FilterChipimport androidx.compose.material3.Iconimport androidx.compose.material3.MaterialShapesimport androidx.compose.material3.MaterialTheme-import androidx.compose.material3.PrimaryTabRow+import androidx.compose.material3.SegmentedButton+import androidx.compose.material3.SegmentedButtonDefaults+import androidx.compose.material3.SingleChoiceSegmentedButtonRowimport androidx.compose.material3.Surface-import androidx.compose.material3.Tabimport androidx.compose.material3.Textimport androidx.compose.material3.toShapeimport androidx.compose.runtime.Composable+import androidx.compose.runtime.DisposableEffect+import androidx.compose.runtime.Stable+import androidx.compose.runtime.derivedStateOf+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableStateOf+import androidx.compose.runtime.remember+import androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.draw.alphaimport androidx.compose.ui.draw.clip+import androidx.compose.ui.geometry.Offset+import androidx.compose.ui.geometry.Rectimport androidx.compose.ui.graphics.Color+import androidx.compose.ui.graphics.GraphicsLayerScopeimport androidx.compose.ui.graphics.TransformOriginimport androidx.compose.ui.graphics.graphicsLayer+import androidx.compose.ui.graphics.vector.ImageVector+import androidx.compose.ui.layout.LayoutCoordinatesimport androidx.compose.ui.layout.layout+import androidx.compose.ui.layout.onGloballyPositionedimport androidx.compose.ui.layout.onSizeChanged+import androidx.compose.ui.layout.positionInRoot+import androidx.compose.ui.semantics.clearAndSetSemantics+import androidx.compose.ui.text.style.TextAlignimport androidx.compose.ui.text.style.TextOverflow+import androidx.compose.ui.unit.Constraintsimport androidx.compose.ui.unit.Dpimport androidx.compose.ui.unit.dp+import androidx.compose.ui.unit.toSize+import androidx.compose.ui.util.lerpimport app.tellyscope.data.Deviceimport app.tellyscope.data.DeviceStateimport app.tellyscope.data.Snapshot@@ -51,7 +73,8 @@ import app.tellyscope.data.deviceKind/** The TV's header, shared by the tabs that lead with the TV: the big hero, which collapses as the- * page scrolls, and the bar title it collapses into. The TV chips, on Overview, scroll away with the page.+ * page scrolls, and the bar title it collapses into. The TV's cookie and name travel from one to the+ * other as one piece ([HeroMorph]). The TV chips, on Overview, scroll away with the page.*//**@@ -79,6 +102,21 @@ internal fun titleAlpha(f: Float) = ((f - 0.67f) / 0.33f).coerceIn(0f, 1f)internal fun tailSpace(heroSize: Int, spacing: Int, contentEnd: Int, afterPadding: Int, viewport: Int): Int =(heroSize + spacing - (contentEnd + afterPadding - viewport)).coerceAtLeast(0)+/**+ * Where the TV's cookie and name sit in the hero and in the bar, in root coordinates, so that+ * [HeroMorphOverlay] can carry them from one to the other. Positions are read while drawing only.+ */+@Stable+class HeroMorph {+ var heroCookie by mutableStateOf<Rect?>(null)+ var heroName by mutableStateOf<Rect?>(null)+ var barCookie by mutableStateOf<Rect?>(null)+ var barName by mutableStateOf<Rect?>(null)+}++/** The node's whole bounds in the root, unlike boundsInRoot, which a scrolling list clips. */+private fun LayoutCoordinates.rectInRoot() = Rect(positionInRoot(), size.toSize())+/** The TV's cookie tile: primary while it's connected, grey when it isn't. */@OptIn(ExperimentalMaterial3ExpressiveApi::class)@Composable@@ -102,26 +140,26 @@ private fun Cookie(device: Device, size: Dp) {*/@OptIn(ExperimentalMaterial3ExpressiveApi::class)@Composable-fun TvHero(state: UiState, live: Snapshot?, actions: DeviceActions, chips: Boolean = true, collapse: () -> Float = { 0f }, onHeight: (Int) -> Unit = {}) {+fun TvHero(state: UiState, live: Snapshot?, actions: DeviceActions, chips: Boolean = true, collapse: () -> Float = { 0f }, morph: HeroMorph = remember { HeroMorph() }, onHeight: (Int) -> Unit = {}) {val device = state.selected ?: returnval c = MaterialTheme.colorSchemeColumn(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(8.dp)) {// No gap between the two parts: the maker line sits right under the name, as before the collapse.Column(Modifier.fillMaxWidth().onSizeChanged { onHeight(it.height) }, horizontalAlignment = Alignment.CenterHorizontally) {- // Toward the top left, where the bar's small cookie and name take over.+ // Once the page scrolls, the overlay carries the cookie and name to the bar; with no bar to go to, they stay.Column(- Modifier.graphicsLayer {- val f = collapse()- scaleX = 1f - 0.4f * f- scaleY = scaleX- alpha = 1f - f- transformOrigin = TransformOrigin(0.5f, 0f)- },+ Modifier.graphicsLayer { alpha = if (collapse() == 0f || morph.barCookie == null) 1f else 0f },horizontalAlignment = Alignment.CenterHorizontally,verticalArrangement = Arrangement.spacedBy(8.dp),) {- Cookie(device, 80.dp)- Text(name(device), style = MaterialTheme.typography.headlineMediumEmphasized, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.padding(horizontal = 16.dp))+ Box(Modifier.onGloballyPositioned { morph.heroCookie = it.rectInRoot() }) { Cookie(device, 80.dp) }+ Text(+ name(device),+ style = MaterialTheme.typography.headlineMediumEmphasized,+ maxLines = 1,+ overflow = TextOverflow.Ellipsis,+ modifier = Modifier.padding(horizontal = 16.dp).onGloballyPositioned { morph.heroName = it.rectInRoot() },+ )}Column(Modifier.graphicsLayer { alpha = detailAlpha(collapse()) }, horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(8.dp)) {// Under a model-name title, the model would only say it twice.@@ -144,17 +182,30 @@ fun TvHero(state: UiState, live: Snapshot?, actions: DeviceActions, chips: Boole}}-/** The collapsed hero, in the bar: small cookie, the TV's name, and whether it's connected. */+/**+ * The collapsed hero, in the bar: small cookie, the TV's name, and whether it's connected. It's+ * laid out from the start, so the cookie and name have somewhere to travel to, and shows them+ * itself only once the hero has fully folded; the pill comes in over the last third.+ */@Composable-fun TvBarTitle(device: Device, modifier: Modifier = Modifier) {+fun TvBarTitle(device: Device, collapse: () -> Float, morph: HeroMorph, modifier: Modifier = Modifier) {val c = MaterialTheme.colorSchemeval on = device.state == DeviceState.Online- Row(modifier, verticalAlignment = Alignment.CenterVertically) {- Cookie(device, 32.dp)+ val folded by remember { derivedStateOf { collapse() >= 1f } }+ DisposableEffect(morph) { onDispose { morph.barCookie = null; morph.barName = null } }+ val landed = Modifier.graphicsLayer { alpha = if (collapse() >= 1f) 1f else 0f }+ Row(if (folded) modifier else modifier.clearAndSetSemantics {}, verticalAlignment = Alignment.CenterVertically) {+ Box(landed.onGloballyPositioned { morph.barCookie = it.rectInRoot() }) { Cookie(device, 32.dp) }Spacer(Modifier.width(12.dp))- Text(name(device), style = MaterialTheme.typography.titleLarge, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f, fill = false))+ Text(+ name(device),+ style = MaterialTheme.typography.titleLarge,+ maxLines = 1,+ overflow = TextOverflow.Ellipsis,+ modifier = Modifier.weight(1f, fill = false).then(landed).onGloballyPositioned { morph.barName = it.rectInRoot() },+ )Spacer(Modifier.width(12.dp))- Surface(shape = CircleShape, color = if (on) c.primaryContainer else c.surfaceContainerHighest, contentColor = if (on) c.onPrimaryContainer else c.onSurfaceVariant) {+ Surface(modifier = Modifier.graphicsLayer { alpha = titleAlpha(collapse()) }, shape = CircleShape, color = if (on) c.primaryContainer else c.surfaceContainerHighest, contentColor = if (on) c.onPrimaryContainer else c.onSurfaceVariant) {Row(Modifier.padding(horizontal = 8.dp, vertical = 2.dp), verticalAlignment = Alignment.CenterVertically) {StateDot(device.state)Spacer(Modifier.width(6.dp))@@ -164,6 +215,44 @@ fun TvBarTitle(device: Device, modifier: Modifier = Modifier) {}}+/**+ * The TV's cookie and name on their way from the hero to the bar, drawn over the whole screen+ * while the hero is part folded. Each moves and shrinks from where it sits in the hero to where+ * it sits in the bar; at either end the hero or the bar draws its own.+ */+@Composable+internal fun HeroMorphOverlay(device: Device, morph: HeroMorph, collapse: () -> Float) {+ var origin by remember { mutableStateOf(Offset.Zero) }+ fun GraphicsLayerScope.travel(from: Rect?, to: Rect?) {+ val f = collapse()+ if (from == null || to == null || f <= 0f || f >= 1f) { alpha = 0f; return }+ alpha = 1f+ transformOrigin = TransformOrigin(0f, 0f)+ scaleX = lerp(1f, to.height / from.height, f)+ scaleY = scaleX+ translationX = lerp(from.left, to.left, f) - origin.x+ translationY = lerp(from.top, to.top, f) - origin.y+ }+ Box(Modifier.fillMaxSize().onGloballyPositioned { origin = it.positionInRoot() }.clearAndSetSemantics {}) {+ Box(Modifier.graphicsLayer { travel(morph.heroCookie, morph.barCookie) }) { Cookie(device, 80.dp) }+ Text(+ name(device),+ style = MaterialTheme.typography.headlineMediumEmphasized,+ color = MaterialTheme.colorScheme.onSurface,+ maxLines = 1,+ overflow = TextOverflow.Ellipsis,+ // As wide as the hero's name, so it cuts off where that one does.+ modifier = Modifier+ .layout { m, c ->+ val w = morph.heroName?.width?.toInt() ?: 0+ val p = m.measure(if (w > 0) Constraints.fixedWidth(w) else c)+ layout(p.width, p.height) { p.place(0, 0) }+ }+ .graphicsLayer { travel(morph.heroName, morph.barName) },+ )+ }+}+/** One chip per TV to switch, offline ones dimmed, then "+ Device" as the last chip. */@Composableprivate fun TvChips(state: UiState, actions: DeviceActions) {@@ -191,20 +280,48 @@ private fun TvChips(state: UiState, actions: DeviceActions) {}}-/** A tab's own tabs, edge to edge across the list's side [inset], pinned under the bar once the hero has folded. */+/**+ * A tab's own tabs, as connected buttons with a check on the chosen one. The strip runs edge to+ * edge across the list's side [inset], in [color], so it pins cleanly 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) }- },+internal fun PinnedSegments(labels: List<String>, selected: Int, color: Color, inset: Dp, onSelect: (Int) -> Unit) {+ Box(+ 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) }+ }+ .background(color)+ .padding(horizontal = inset, vertical = 8.dp),) {- labels.forEachIndexed { i, label ->- Tab(selected = selected == i, onClick = { onSelect(i) }, text = { Text(label) })+ SingleChoiceSegmentedButtonRow(Modifier.fillMaxWidth()) {+ labels.forEachIndexed { i, label ->+ SegmentedButton(+ selected = selected == i,+ onClick = { onSelect(i) },+ shape = SegmentedButtonDefaults.itemShape(i, labels.size),+ ) { Text(label) }+ }+ }+ }+}++/**+ * What a list shows when it has nothing to show: a soft circle with an [icon], a [title], and+ * one [line] under it, in the middle of the page.+ */+@Composable+internal fun EmptyState(icon: ImageVector, title: String, line: String) {+ val c = MaterialTheme.colorScheme+ Column(Modifier.fillMaxWidth().padding(top = 96.dp, bottom = 24.dp), horizontalAlignment = Alignment.CenterHorizontally) {+ Box(Modifier.size(56.dp).clip(CircleShape).background(c.surfaceContainerHighest), contentAlignment = Alignment.Center) {+ Icon(icon, contentDescription = null, Modifier.size(28.dp), tint = c.onSurfaceVariant)}+ Spacer(Modifier.height(16.dp))+ Text(title, style = MaterialTheme.typography.titleSmall, textAlign = TextAlign.Center)+ Spacer(Modifier.height(4.dp))+ Text(line, style = MaterialTheme.typography.bodyMedium, color = c.onSurfaceVariant, textAlign = TextAlign.Center)}}diff --git a/app/src/test/java/app/tellyscope/ScreenshotTest.kt b/app/src/test/java/app/tellyscope/ScreenshotTest.ktindex 222c01b..66848fe 100644--- a/app/src/test/java/app/tellyscope/ScreenshotTest.kt+++ b/app/src/test/java/app/tellyscope/ScreenshotTest.kt@@ -25,9 +25,11 @@ import androidx.compose.ui.test.onRootimport androidx.compose.ui.test.performClickimport androidx.compose.ui.test.performScrollToNodeimport androidx.compose.ui.test.performScrollToIndex+import androidx.compose.ui.test.performSemanticsAction+import androidx.compose.ui.semantics.SemanticsActions+import androidx.compose.ui.test.performScrollToKeyimport androidx.compose.ui.test.hasScrollActionimport androidx.compose.ui.test.hasText-import androidx.compose.ui.test.hasTestTagimport androidx.compose.ui.test.onNodeWithTagimport app.tellyscope.adb.ApkInfoimport app.tellyscope.adb.ConnectionRequest@@ -293,18 +295,36 @@ 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.+ // The end space is Files' own: Overview, long after it on a phone-height screen, ends with none.+ @Config(qualifiers = "w411dp-h640dp-xxhdpi")@Test fun longTabAfterShortOneHasNoEndSpace() {compose.mainClock.autoAdvance = falsecompose.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.onNodeWithText("Overview").performClick()compose.mainClock.advanceTimeBy(1_000)- compose.onNode(hasScrollAction()).performScrollToNode(hasTestTag("tail"))+ // By key: a space of no height never counts as displayed, so scrolling to the node would never stop.+ compose.onNode(hasScrollAction()).performScrollToKey("tail")compose.mainClock.advanceTimeBy(1_000)assertEquals(0, compose.onNodeWithTag("tail").fetchSemanticsNode().size.height)}+ private fun emptyFiles() = md3State().let { it.copy(device = it.device.copy(files = FilesUi(TvFolder.DOWNLOAD, emptyList()))) }+ @Test fun md3_files_empty() {+ shot("76_md3_files_empty") { DeviceTabsScreen(emptyFiles(), DeviceActions(), startTab = TvTab.Files) }+ compose.onNodeWithText("Nothing in Download yet").assertIsDisplayed()+ // The save hint is only for files there are.+ compose.onNodeWithText("Tap a file to save a copy on your phone.").assertDoesNotExist()+ }+ @Test fun md3_files_empty_dark() { shot("76_md3_files_empty", dark = true) { DeviceTabsScreen(emptyFiles(), DeviceActions(), startTab = TvTab.Files) } }+ // Part way through the fold: the cookie and name on their way to the bar, drawn once, over both.+ @Config(qualifiers = "w411dp-h640dp-xxhdpi")+ @Test fun md3_apps_folding() {+ val part = { compose.onNode(hasScrollAction()).performSemanticsAction(SemanticsActions.ScrollBy) { it(0f, 150f) }; Unit }+ shot("77_md3_apps_folding", before = part) { DeviceTabsScreen(md3State(), DeviceActions(), startTab = TvTab.Apps) }+ // The bar's own title stays out of the tree until the hero has fully folded.+ compose.onNodeWithText("Connected").assertDoesNotExist()+ }@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() {diff --git a/docs/screenshots/files.png b/docs/screenshots/files.pngindex 93d2e73..86805ca 100644Binary files a/docs/screenshots/files.png and b/docs/screenshots/files.png differdiff --git a/docs/screenshots/home.png b/docs/screenshots/home.pngindex 5866d7f..342c825 100644Binary files a/docs/screenshots/home.png and b/docs/screenshots/home.png differ