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.

Top bar: search only on the Apps tab

jesse-agent-362289cbe61dad0
diff --git a/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt b/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt
index e70bac8..c0aaed2 100644
--- a/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt
+++ b/app/src/main/java/app/tellyscope/ui/DeviceTabs.kt
@@ -151,8 +151,11 @@ fun DeviceTabsScreen(
title = { TvTitle(state, actions) },
actions = {
if (REMOTE_ENABLED) TextButton(onClick = actions.remote, enabled = !offline) { Text("Remote") }
- IconButton(onClick = { searching = true; tab = TvTab.Apps }, enabled = !offline) {
- Icon(Icons.Default.Search, contentDescription = "Search apps")
+ // 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)
},
@@ -164,7 +167,11 @@ fun DeviceTabsScreen(
TvTab.entries.forEach { t ->
ShortNavigationBarItem(
selected = tab == t,
- onClick = { 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) },
)
diff --git a/app/src/test/java/app/tellyscope/ScreenshotTest.kt b/app/src/test/java/app/tellyscope/ScreenshotTest.kt
index 20f1aad..a424654 100644
--- a/app/src/test/java/app/tellyscope/ScreenshotTest.kt
+++ b/app/src/test/java/app/tellyscope/ScreenshotTest.kt
@@ -219,24 +219,51 @@ class ScreenshotTest {
@Test fun tabs_files_dark() = shot("42_tabs_files", dark = true) { DeviceTabsScreen(tabsState(), DeviceActions(), startTab = TvTab.Files) }
@Test fun tabs_tweaks_dark() = shot("43_tabs_tweaks", dark = true) { DeviceTabsScreen(tabsState(), DeviceActions(), startTab = TvTab.Tweaks) }
- @Test fun tabs_tvMenu() {
+ @Test fun tabs_tvMenu() = tvMenu(dark = false)
+ @Test fun tabs_tvMenu_dark() = tvMenu(dark = true)
+
+ private fun tvMenu(dark: Boolean) {
val open = {
compose.onNodeWithContentDescription("Switch TV").performClick()
compose.mainClock.advanceTimeBy(1_000)
compose.onNodeWithText("Add a TV").assertExists()
Unit
}
- shot("44_tabs_tv_menu", screen = true, before = open) { DeviceTabsScreen(tabsState().copy(showOffline = true), DeviceActions()) }
+ shot("44_tabs_tv_menu", dark, screen = true, before = open) { DeviceTabsScreen(tabsState().copy(showOffline = true), DeviceActions()) }
+ }
+
+ @Test fun tabs_appMenu() = appMenu(dark = false)
+ @Test fun tabs_appMenu_dark() = appMenu(dark = true)
+
+ @Test fun tabs_searchOnlyOnApps() {
+ val queries = mutableListOf<String>()
+ compose.mainClock.autoAdvance = false // as in shot(): expressive indicators never idle
+ compose.setContent {
+ TellyscopeTheme(dark = false, dynamic = false) {
+ DeviceTabsScreen(tabsState(), DeviceActions(query = { queries += it }), startTab = TvTab.Apps)
+ }
+ }
+ compose.onNodeWithContentDescription("Search apps").performClick()
+ compose.mainClock.advanceTimeBy(1_000)
+ compose.onNodeWithText("Overview").performClick()
+ compose.mainClock.advanceTimeBy(1_000)
+ // Leaving Apps closed the search and cleared its query; the icon is gone with it.
+ assertEquals(listOf(""), queries)
+ compose.onNodeWithContentDescription("Search apps").assertDoesNotExist()
+ compose.onNodeWithContentDescription("Close search").assertDoesNotExist()
+ compose.onNodeWithText("Apps").performClick()
+ compose.mainClock.advanceTimeBy(1_000)
+ compose.onNodeWithContentDescription("Search apps").assertExists()
}
- @Test fun tabs_appMenu() {
+ private fun appMenu(dark: Boolean) {
val open = {
compose.onNodeWithContentDescription("More options").performClick()
compose.mainClock.advanceTimeBy(1_000)
compose.onNodeWithText("About & licences").assertExists()
Unit
}
- shot("45_tabs_app_menu", screen = true, before = open) { DeviceTabsScreen(tabsState(), DeviceActions()) }
+ shot("45_tabs_app_menu", dark, screen = true, before = open) { DeviceTabsScreen(tabsState(), DeviceActions()) }
}
@Test fun device_overview() {
diff --git a/docs/screenshots/files.png b/docs/screenshots/files.png
index 7445bdd..426dff5 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 f5a4add..5b048d2 100644
Binary files a/docs/screenshots/history.png and b/docs/screenshots/history.png differ
diff --git a/docs/screenshots/install.png b/docs/screenshots/install.png
index 9d16fe3..fb89285 100644
Binary files a/docs/screenshots/install.png and b/docs/screenshots/install.png differ
diff --git a/docs/screenshots/request.png b/docs/screenshots/request.png
index 6520714..5ad0cf2 100644
Binary files a/docs/screenshots/request.png and b/docs/screenshots/request.png differ
diff --git a/docs/screenshots/send.png b/docs/screenshots/send.png
index 01448dc..6ce1416 100644
Binary files a/docs/screenshots/send.png and b/docs/screenshots/send.png differ
diff --git a/docs/screenshots/tv-page.png b/docs/screenshots/tv-page.png
index 70242bd..c0073b0 100644
Binary files a/docs/screenshots/tv-page.png and b/docs/screenshots/tv-page.png differ
diff --git a/docs/screenshots/tweaks.png b/docs/screenshots/tweaks.png
index 87669cb..5a2b932 100644
Binary files a/docs/screenshots/tweaks.png and b/docs/screenshots/tweaks.png differ