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.
Add Settings › What's new, built from the bundled CHANGELOG
jesse-agent-232a2d68729e70e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex eadb7fc..7df83bc 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,6 +13,7 @@ until this file has a section for its version.## Unreleased- **New:** Spanish, Chinese, Japanese and Russian translations, machine-made; corrections welcome. [#272](../../pull/272)+- **New:** Settings › What's new shows what changed in each version, offline. [#000](../../pull/000)- **Improved:** Tweaks shows the same TV-offline screen as Files. [#273](../../pull/273)- **Fixed:** With the TV away, app rows grey out and won't open. [#273](../../pull/273)- **Fixed:** Connect says when the phone has dropped off Wi-Fi, and Try again waits for Wi-Fi instead of failing at once. [#274](../../pull/274)diff --git a/NOTICE b/NOTICEindex 9a04331..17f1803 100644--- a/NOTICE+++ b/NOTICE@@ -26,7 +26,8 @@ The TV and HDMI (streaming stick) device icons use the path data of the"cleaning_services", the off-Wi-Fi screen that of "wifi_off", and theApps, Files and Tweaks tabs those of "apps", "folder" and "tune", theUpload files button that of "upload", the empty Movies folder that of-"movie", the links in Settings that of "open_in_new", and the Remote's+"movie", the links in Settings that of "open_in_new", Settings' What's new+row that of the Material Symbols "new_releases", and the Remote'srestart, waiting and can't-reach icons and the Remote buttons sheet's draghandle those of "restart_alt", "hourglass_top", "link_off" and"drag_handle".diff --git a/app/src/main/java/app/tellyscope/MainActivity.kt b/app/src/main/java/app/tellyscope/MainActivity.ktindex d53eb07..ab5c59c 100644--- a/app/src/main/java/app/tellyscope/MainActivity.kt+++ b/app/src/main/java/app/tellyscope/MainActivity.kt@@ -79,6 +79,8 @@ import app.tellyscope.ui.ReportScreenimport app.tellyscope.ui.RowStateimport app.tellyscope.ui.ScanScreenimport app.tellyscope.ui.SettingsScreen+import app.tellyscope.ui.WhatsNewScreen+import app.tellyscope.ui.rememberChangelogimport app.tellyscope.ui.TellyscopeViewModelimport app.tellyscope.ui.TvTabimport app.tellyscope.ui.UpdateDialog@@ -208,6 +210,7 @@ fun TellyscopeApp(vm: TellyscopeViewModel) {var tvTab by rememberSaveable { mutableStateOf(TvTab.Overview) }var debloat by rememberSaveable { mutableStateOf(false) }var settings by rememberSaveable { mutableStateOf(false) }+ var whatsNew by rememberSaveable { mutableStateOf(false) }var access by rememberSaveable { mutableStateOf(false) }// Connect again from the logged-out page: which TV, and since when, for its Allow screen.var rejoinId by rememberSaveable { mutableStateOf<String?>(null) }@@ -233,10 +236,10 @@ fun TellyscopeApp(vm: TellyscopeViewModel) {LoggedOutSnackbars(snackbar, { state.devices }, { state.selectedId }, onView = vm::select)// A newly connected TV becomes the selection; leave the add flow then, not on tap.- LaunchedEffect(state.selectedId) { adding = false; remote = false; advanced = false; history = false; resetting = false; debloat = false; settings = false; access = false; rejoinId = null }+ LaunchedEffect(state.selectedId) { adding = false; remote = false; advanced = false; history = false; resetting = false; debloat = false; settings = false; whatsNew = false; access = false; rejoinId = null }// Logged out mid-screen: the page takes over, and the TV comes back on Overview once allowed again.val loggedOutAt = state.selected?.loggedOutAt- LaunchedEffect(loggedOutAt) { if (loggedOutAt != null) { remote = false; advanced = false; history = false; resetting = false; debloat = false; settings = false; access = false } }+ LaunchedEffect(loggedOutAt) { if (loggedOutAt != null) { remote = false; advanced = false; history = false; resetting = false; debloat = false; settings = false; whatsNew = false; access = false } }// The Allow screen while the TV is asked; allowed lands on Overview, a Deny there is a plain refusal (its card).val rejoining = state.selected?.takeIf { it.id == rejoinId && it.state == DeviceState.Waiting }LaunchedEffect(state.selected?.state, loggedOutAt) {@@ -321,6 +324,9 @@ fun TellyscopeApp(vm: TellyscopeViewModel) {// A removal started from the warning opens this screen too, and back steps out of it first.BackHandler { if (state.device.removal != null) vm.closeRemoval() else access = false }AccessScreen(state, accessActions(vm) { access = false }, snackbar = snackbar)+ } else if (whatsNew) {+ BackHandler { whatsNew = false }+ WhatsNewScreen(rememberChangelog(), back = { whatsNew = false })} else if (settings) {BackHandler { settings = false }SettingsScreen(@@ -332,6 +338,7 @@ fun TellyscopeApp(vm: TellyscopeViewModel) {keyHaptics = state.keyHaptics,onKeyHaptics = vm::setKeyHaptics,onReport = { vm.openReport(ReportKind.Problem) },+ onWhatsNew = { whatsNew = true },back = { settings = false },snackbar = snackbar,)diff --git a/app/src/main/java/app/tellyscope/data/Changelog.kt b/app/src/main/java/app/tellyscope/data/Changelog.ktindex 0b52a9b..fb797d9 100644--- a/app/src/main/java/app/tellyscope/data/Changelog.kt+++ b/app/src/main/java/app/tellyscope/data/Changelog.kt@@ -15,7 +15,7 @@ object Changelog {*/fun pullUrl(pr: Int) = RELEASES.removeSuffix("/releases") + "/pull/$pr"- enum class Kind(val label: String) { New("New"), Improved("Improved"), Fixed("Fixed") }+ enum class Kind { New, Improved, Fixed }/** One change. [pr] is the pull request it links to, if any; [details] are its indented points. */data class Change(val kind: Kind?, val text: String, val pr: Int?, val details: List<String> = emptyList())diff --git a/app/src/main/java/app/tellyscope/ui/ListsCard.kt b/app/src/main/java/app/tellyscope/ui/ListsCard.ktindex b8a7485..60ba3b6 100644--- a/app/src/main/java/app/tellyscope/ui/ListsCard.kt+++ b/app/src/main/java/app/tellyscope/ui/ListsCard.kt@@ -496,7 +496,7 @@ private fun AboutLink(label: String, url: String, open: (String) -> Unit) {}@Composable-private fun installedVersion(): String {+internal fun installedVersion(): String {val context = LocalContext.current@Suppress("DEPRECATION") // the flags overload is API 33+return remember { context.packageManager.getPackageInfo(context.packageName, 0).versionName.orEmpty() }diff --git a/app/src/main/java/app/tellyscope/ui/SettingsScreen.kt b/app/src/main/java/app/tellyscope/ui/SettingsScreen.ktindex b6d6f3f..24bb345 100644--- a/app/src/main/java/app/tellyscope/ui/SettingsScreen.kt+++ b/app/src/main/java/app/tellyscope/ui/SettingsScreen.kt@@ -82,8 +82,8 @@ internal fun shareTellyscope(context: Context) {}/**- * App-wide choices, not tied to one TV: update checks, Report a problem and Share Tellyscope first, then a folded- * Advanced with where the debloat lists come from and how to use your own.+ * App-wide choices, not tied to one TV: update checks, What's new, Report a problem and Share Tellyscope first,+ * then a folded Advanced with where the debloat lists come from and how to use your own.*/@OptIn(ExperimentalMaterial3Api::class)@Composable@@ -100,6 +100,7 @@ fun SettingsScreen(keyHaptics: Boolean = true,onKeyHaptics: (Boolean) -> Unit = {},onReport: () -> Unit = {},+ onWhatsNew: () -> Unit = {},snackbar: SnackbarHostState = remember { SnackbarHostState() },) {var editing by rememberSaveable { mutableStateOf(false) }@@ -157,6 +158,17 @@ fun SettingsScreen(Switch(checked = keyHaptics, onCheckedChange = null)}HorizontalDivider(color = MaterialTheme.colorScheme.surface)+ Row(Modifier.fillMaxWidth().clickable(onClick = onWhatsNew).padding(16.dp), verticalAlignment = Alignment.CenterVertically) {+ Icon(NewReleases, contentDescription = null, tint = MaterialTheme.colorScheme.onSurfaceVariant)+ Spacer(Modifier.width(16.dp))+ Column(Modifier.weight(1f)) {+ Text(stringResource(R.string.settings_whats_new), style = MaterialTheme.typography.titleSmall)+ Text(stringResource(R.string.settings_whats_new_text), style = MaterialTheme.typography.bodyMedium)+ }+ Spacer(Modifier.width(16.dp))+ Icon(Icons.AutoMirrored.Filled.KeyboardArrowRight, contentDescription = null)+ }+ HorizontalDivider(color = MaterialTheme.colorScheme.surface)Row(Modifier.fillMaxWidth().clickable(onClick = onReport).padding(16.dp), verticalAlignment = Alignment.CenterVertically) {Icon(BugReport, contentDescription = null, tint = MaterialTheme.colorScheme.onSurfaceVariant)Spacer(Modifier.width(16.dp))diff --git a/app/src/main/java/app/tellyscope/ui/WhatsNewScreen.kt b/app/src/main/java/app/tellyscope/ui/WhatsNewScreen.ktnew file mode 100644index 0000000..3f876a0--- /dev/null+++ b/app/src/main/java/app/tellyscope/ui/WhatsNewScreen.kt@@ -0,0 +1,217 @@+// SPDX-License-Identifier: GPL-3.0-only+// The What's new icon is the Material Symbols "new_releases" (Apache-2.0), see NOTICE.++package app.tellyscope.ui++import androidx.compose.foundation.clickable+import androidx.compose.foundation.layout.Arrangement+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.offset+import androidx.compose.foundation.layout.padding+import androidx.compose.foundation.layout.size+import androidx.compose.foundation.layout.width+import androidx.compose.foundation.lazy.LazyColumn+import androidx.compose.foundation.lazy.items+import androidx.compose.foundation.shape.RoundedCornerShape+import androidx.compose.material.icons.Icons+import androidx.compose.material.icons.automirrored.filled.ArrowBack+import androidx.compose.material3.Card+import androidx.compose.material3.CardDefaults+import androidx.compose.material3.ExperimentalMaterial3Api+import androidx.compose.material3.HorizontalDivider+import androidx.compose.material3.Icon+import androidx.compose.material3.IconButton+import androidx.compose.material3.MaterialTheme+import androidx.compose.material3.Scaffold+import androidx.compose.material3.Surface+import androidx.compose.material3.Text+import androidx.compose.material3.TopAppBar+import androidx.compose.runtime.Composable+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableStateOf+import androidx.compose.runtime.remember+import androidx.compose.runtime.setValue+import androidx.compose.ui.Alignment+import androidx.compose.ui.Modifier+import androidx.compose.ui.graphics.Color+import androidx.compose.ui.graphics.PathFillType+import androidx.compose.ui.graphics.SolidColor+import androidx.compose.ui.graphics.vector.ImageVector+import androidx.compose.ui.graphics.vector.PathParser+import androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.platform.LocalDensity+import androidx.compose.ui.platform.LocalUriHandler+import androidx.compose.ui.res.stringResource+import androidx.compose.ui.semantics.Role+import androidx.compose.ui.text.SpanStyle+import androidx.compose.ui.text.TextLayoutResult+import androidx.compose.ui.text.buildAnnotatedString+import androidx.compose.ui.text.withStyle+import androidx.compose.ui.unit.Dp+import androidx.compose.ui.unit.IntOffset+import androidx.compose.ui.unit.dp+import app.tellyscope.R+import app.tellyscope.data.Changelog+import app.tellyscope.data.Changelog.Change+import app.tellyscope.data.Changelog.Kind+import app.tellyscope.data.Changelog.Release+import java.time.LocalDate+import java.time.format.DateTimeFormatter+import java.util.Locale+import kotlin.math.roundToInt++/** The bundled CHANGELOG.md's released sections; empty if the asset is missing. */+@Composable+fun rememberChangelog(): List<Release> {+ val context = LocalContext.current+ return remember { runCatching { context.assets.open(Changelog.ASSET).bufferedReader().use { Changelog.parse(it.readText()) } }.getOrDefault(emptyList()) }+}++/**+ * Settings › What's new: every release in the bundled CHANGELOG.md, newest first, one card each.+ * Inside a card the changes keep the file's order, which is New, then Improved, then Fixed, so a+ * heading goes in wherever the kind changes. [installed] is the running versionName; its release+ * gets an Installed chip whether or not this is an alpha.+ */+@OptIn(ExperimentalMaterial3Api::class)+@Composable+fun WhatsNewScreen(releases: List<Release>, back: () -> Unit, installed: String = installedVersion()) {+ val browser = LocalUriHandler.current+ val openPr = { pr: Int -> runCatching { browser.openUri(Changelog.pullUrl(pr)) }; Unit }+ Scaffold(+ topBar = {+ TopAppBar(+ title = { Text(stringResource(R.string.settings_whats_new)) },+ navigationIcon = {+ IconButton(onClick = back) { Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(R.string.whats_new_back)) }+ },+ )+ },+ ) { pad ->+ LazyColumn(+ Modifier.fillMaxSize().padding(pad),+ contentPadding = PaddingValues(start = 16.dp, end = 16.dp, bottom = 32.dp),+ verticalArrangement = Arrangement.spacedBy(12.dp),+ ) {+ items(releases, key = { it.version }) { r ->+ Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {+ VersionHeading(r, isInstalled = r.version == installed.substringBefore('-'))+ Card(colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceContainer)) {+ r.changes.forEachIndexed { i, c ->+ val kindChanged = i == 0 || r.changes[i - 1].kind != c.kind+ if (i > 0) HorizontalDivider(color = MaterialTheme.colorScheme.surface)+ if (kindChanged && c.kind != null) KindHeading(c.kind)+ ChangeItem(c, openPr, topPadding = if (kindChanged && c.kind != null) 4.dp else 16.dp)+ }+ }+ }+ }+ }+ }+}++@Composable+private fun VersionHeading(r: Release, isInstalled: Boolean) {+ Row(Modifier.fillMaxWidth().padding(top = 8.dp, start = 4.dp), verticalAlignment = Alignment.CenterVertically) {+ Text(r.version, style = MaterialTheme.typography.titleLarge)+ r.date?.let {+ Spacer(Modifier.width(8.dp))+ Text(shortDate(it), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)+ }+ Spacer(Modifier.weight(1f))+ if (isInstalled) Surface(shape = RoundedCornerShape(8.dp), color = MaterialTheme.colorScheme.secondaryContainer) {+ Text(+ stringResource(R.string.whats_new_installed),+ Modifier.padding(horizontal = 8.dp, vertical = 2.dp),+ style = MaterialTheme.typography.labelMedium,+ color = MaterialTheme.colorScheme.onSecondaryContainer,+ )+ }+ }+}++/** "29 Oct 2026" from the heading's ISO date; the date as written if it isn't one. */+private fun shortDate(iso: String): String =+ runCatching { LocalDate.parse(iso).format(DateTimeFormatter.ofPattern("d MMM yyyy", Locale.getDefault())) }.getOrDefault(iso)++@Composable+private fun KindHeading(kind: Kind) {+ Text(+ stringResource(+ when (kind) {+ Kind.New -> R.string.whats_new_new+ Kind.Improved -> R.string.whats_new_improved+ Kind.Fixed -> R.string.whats_new_fixed+ },+ ).uppercase(),+ Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp),+ style = MaterialTheme.typography.labelMedium,+ color = MaterialTheme.colorScheme.primary,+ )+}++/**+ * One change and its indented points. Its #PR opens the pull request on the main repo. The link's tap+ * target is 48 dp tall and runs to the end of its line, so it overlaps plain text but never another+ * link; it stays inside this item's 16 dp padding.+ */+@Composable+private fun ChangeItem(c: Change, openPr: (Int) -> Unit, topPadding: Dp) {+ val link = MaterialTheme.colorScheme.primary+ val text = remember(c, link) {+ buildAnnotatedString {+ append(c.text)+ if (c.pr != null) {+ append(' ')+ withStyle(SpanStyle(color = link)) { append("#${c.pr}") }+ }+ }+ }+ var layout by remember { mutableStateOf<TextLayoutResult?>(null) }+ val density = LocalDensity.current+ Box(Modifier.fillMaxWidth()) {+ Column(Modifier.fillMaxWidth().padding(start = 16.dp, end = 16.dp, top = topPadding, bottom = 16.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) {+ Text(text, Modifier.fillMaxWidth(), style = MaterialTheme.typography.bodyLarge, onTextLayout = { layout = it })+ c.details.forEach { d ->+ Row(Modifier.padding(start = 8.dp)) {+ Text("•", style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)+ Spacer(Modifier.width(8.dp))+ Text(d, style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)+ }+ }+ }+ val l = layout+ if (c.pr != null && l != null) {+ val start = text.length - "#${c.pr}".length+ val line = l.getLineForOffset(start)+ val left = l.getHorizontalPosition(start, usePrimaryDirection = true)+ val middle = (l.getLineTop(line) + l.getLineBottom(line)) / 2+ with(density) {+ val target = 48.dp.toPx()+ Box(+ Modifier+ .offset { IntOffset((16.dp.toPx() + left).roundToInt(), (topPadding.toPx() + middle - target / 2).roundToInt().coerceAtLeast(0)) }+ .size(width = (l.size.width - left).toDp(), height = 48.dp)+ .clickable(role = Role.Button, onClickLabel = "#${c.pr}") { openPr(c.pr) },+ )+ }+ }+ }+}++internal val NewReleases = ImageVector.Builder("NewReleases", 24.dp, 24.dp, 960f, 960f)+ .addGroup(translationY = 960f)+ .addPath(+ PathParser().parsePathString(+ "m344-60-76-128-144-32 14-148-98-112 98-112-14-148 144-32 76-128 136 58 136-58 76 128 144 32-14 148 98 112-98 112 14 148-144 32-76 128-136-58-136 58Zm34-102 102-44 104 44 56-96 110-26-10-112 74-84-74-86 10-112-110-24-58-96-102 44-104-44-56 96-110 24 10 112-74 86 74 84-10 114 110 24 58 96Zm102-318Zm-42 142 226-226-56-58-170 170-86-84-56 56 142 142Z",+ ).toNodes(),+ pathFillType = PathFillType.NonZero, fill = SolidColor(Color.Black),+ )+ .clearGroup()+ .build()diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xmlindex 37d7d3f..ba51418 100644--- a/app/src/main/res/values/strings.xml+++ b/app/src/main/res/values/strings.xml@@ -1179,6 +1179,13 @@<string name="settings_report">Report a problem</string><string name="settings_report_text">Opens an issue on Tellyscope’s GitHub. You see the text first.</string><string name="settings_share_hint">Send someone the link to Tellyscope’s GitHub page.</string>+ <string name="settings_whats_new">What’s new</string>+ <string name="settings_whats_new_text">What changed in this version and the ones before it.</string>+ <string name="whats_new_back">Back to Settings</string>+ <string name="whats_new_installed">Installed</string>+ <string name="whats_new_new">New</string>+ <string name="whats_new_improved">Improved</string>+ <string name="whats_new_fixed">Fixed</string><string name="settings_advanced">Advanced</string><!-- Heading: how to change where the debloat lists come from --><string name="settings_change">Change</string>diff --git a/app/src/test/java/app/tellyscope/ScreenshotTest.kt b/app/src/test/java/app/tellyscope/ScreenshotTest.ktindex 838461a..60c2689 100644--- a/app/src/test/java/app/tellyscope/ScreenshotTest.kt+++ b/app/src/test/java/app/tellyscope/ScreenshotTest.kt@@ -20,6 +20,8 @@ import androidx.compose.ui.test.assertIsNotDisplayedimport androidx.compose.ui.test.assertIsNotEnabledimport androidx.compose.ui.test.onNodeWithContentDescriptionimport androidx.compose.ui.test.onNodeWithText+import androidx.compose.ui.test.SemanticsMatcher+import androidx.compose.ui.semantics.getOrNullimport androidx.compose.ui.test.onAllNodesWithTextimport androidx.activity.OnBackPressedDispatcherimport androidx.activity.compose.LocalOnBackPressedDispatcherOwner@@ -119,6 +121,8 @@ import app.tellyscope.ui.ReportKindimport app.tellyscope.ui.ReportScreenimport app.tellyscope.ui.ReportUiimport app.tellyscope.ui.SettingsScreen+import app.tellyscope.ui.WhatsNewScreen+import app.tellyscope.data.Changelogimport app.tellyscope.ui.SHARE_TEXTimport app.tellyscope.data.RELEASESimport androidx.compose.ui.platform.UriHandler@@ -673,6 +677,38 @@ class ScreenshotTest {@Test fun settings_advanced() = shot("82_settings_advanced", before = { compose.onNodeWithText("Advanced").performClick(); Unit }) { settings()() }@Test fun settings_advanced_dark() = shot("82_settings_advanced", dark = true, before = { compose.onNodeWithText("Advanced").performClick(); Unit }) { settings()() }+ @Test fun settings_whatsNewOpens() {+ var opened = 0+ compose.setContent {+ TellyscopeTheme(dark = false, dynamic = false) {+ SettingsScreen(null, onListSource = {}, checkUpdates = true, alphaBuild = false, onCheckUpdates = {}, back = {}, onWhatsNew = { opened++ })+ }+ }+ compose.onNodeWithText("What’s new").performClick()+ assertEquals(1, opened)+ }++ /** The repo's own CHANGELOG.md, as bundled, with the newest release installed as an alpha. */+ private fun whatsNew(opened: MutableList<String> = mutableListOf()) = @Composable {+ val file = generateSequence(File("").absoluteFile) { it.parentFile }.map { File(it, Changelog.ASSET) }.first { it.exists() }+ val releases = Changelog.parse(file.readText())+ val links = object : UriHandler { override fun openUri(uri: String) { opened += uri } }+ CompositionLocalProvider(LocalUriHandler provides links) {+ WhatsNewScreen(releases, back = {}, installed = releases.first().version + "-alpha.1")+ }+ }++ @Test fun whatsNew_installedAndLinks() {+ val opened = mutableListOf<String>()+ shot("96_whats_new") { whatsNew(opened)() }+ compose.onNodeWithText("Installed").assertExists()+ compose.onAllNodesWithText("NEW")[0].assertExists()+ compose.onAllNodes(SemanticsMatcher("opens #231") { it.config.getOrNull(SemanticsActions.OnClick)?.label == "#231" })[0].performClick()+ assertEquals(listOf(Changelog.pullUrl(231)), opened)+ }++ @Test fun whatsNew_dark() = shot("96_whats_new", dark = true) { whatsNew()() }+private fun appMenu(dark: Boolean) {val open = {compose.onNodeWithContentDescription("More options").performClick()