Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.
Python adbadblockandroid-tvandroid-tv-launcherapple-tvbloatware-removalclaude-codedebloatfire-tvgoogle-tvlauncherprivacysmart-tvsony-braviatclvibe-codingxiaomi
launcher: compact top bar, opt-in (icon_only_buttons, wifi_label_width, library_button)
Cristian Rojas2e00943e1c0a
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/Config.java b/launcher/app/src/main/java/com/gathin/tvhome/Config.javaindex 8f41173e3..b570974c9 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java@@ -70,6 +70,12 @@ final class Config {final boolean dockRow;/** Reorder button in the top bar (config.xml reorder_button); the Settings long-press menu offers it either way. */final boolean reorderButton;+ /** Wi-Fi and Settings pills as round icon buttons, Inputs keeps its label (config.xml icon_only_buttons). */+ final boolean iconOnlyButtons;+ /** App library as a round button in the top bar (config.xml library_button); needs app_library. */+ final boolean libraryButton;+ /** With icon_only_buttons, the Wi-Fi pill keeps the network name up to this width in dp (0: icon only). */+ final int wifiLabelWidth;final String vpnApp;final boolean showHomeSettingsShortcut;/** One line under the clock: CPU, free memory, free storage. Off unless config or a theme turns it on. */@@ -109,7 +115,7 @@ final class Config {String liveTvAction, Map<String, String> launchActions, Map<String, String> appLabels,Map<String, String> appBanners, String sourcePanelService, String sourcePanelAction, String inputAction,int columns, int rowsBelowDock, boolean animations, boolean advancedEffects,- boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean dockTitle, boolean dockRow, boolean reorderButton, String vpnApp,+ boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean dockTitle, boolean dockRow, boolean reorderButton, boolean iconOnlyButtons, boolean libraryButton, int wifiLabelWidth, String vpnApp,boolean showHomeSettingsShortcut, boolean showStats, boolean appLibrary, int backgroundColor, int skyIntensity,int[] settingsKeycodes, boolean settingsKeyPanel, boolean wallpaperEnabled, File wallpaper, List<File> wallpapers,int wallpaperRotationMinutes, int wallpaperDim, boolean overlayApplied,@@ -139,6 +145,9 @@ final class Config {this.dockTitle = dockTitle;this.dockRow = dockRow;this.reorderButton = reorderButton;+ this.iconOnlyButtons = iconOnlyButtons;+ this.libraryButton = libraryButton;+ this.wifiLabelWidth = wifiLabelWidth;this.vpnApp = vpnApp;this.showHomeSettingsShortcut = showHomeSettingsShortcut;this.showStats = showStats;@@ -187,6 +196,9 @@ final class Config {boolean dockTitle = res.getBoolean(R.bool.dock_title);boolean dockRow = res.getBoolean(R.bool.dock_row);boolean reorderButton = res.getBoolean(R.bool.reorder_button);+ boolean iconOnlyButtons = res.getBoolean(R.bool.icon_only_buttons);+ boolean libraryButton = res.getBoolean(R.bool.library_button);+ int wifiLabelWidth = res.getInteger(R.integer.wifi_label_width);String vpn = res.getString(R.string.vpn_app).trim();boolean homeSettings = res.getBoolean(R.bool.show_home_settings_shortcut);boolean showStats = res.getBoolean(R.bool.show_stats);@@ -227,6 +239,9 @@ final class Config {dockTitle = bool(json, "dock_title", dockTitle);dockRow = bool(json, "dock_row", dockRow);reorderButton = bool(json, "reorder_button", reorderButton);+ iconOnlyButtons = bool(json, "icon_only_buttons", iconOnlyButtons);+ libraryButton = bool(json, "library_button", libraryButton);+ wifiLabelWidth = integer(json, "wifi_label_width", wifiLabelWidth, 0, 300);vpn = string(json, "vpn_app", vpn);homeSettings = bool(json, "show_home_settings_shortcut", homeSettings);showStats = bool(json, "show_stats", showStats);@@ -288,7 +303,7 @@ final class Config {packageMap(appBanners), panelService,panelAction, inputAction,Math.max(1, columns), Math.max(0, rowsBelow), animations, advancedEffects,- shamsi, greetingName, moduleCards, reducedMotion, dockTitle, dockRow, reorderButton, vpn, homeSettings, showStats, library, background,+ shamsi, greetingName, moduleCards, reducedMotion, dockTitle, dockRow, reorderButton, iconOnlyButtons, libraryButton, wifiLabelWidth, vpn, homeSettings, showStats, library, background,Math.max(0, Math.min(100, skyIntensity)), settingsKeycodes, settingsKeyPanel, wallpaperEnabled, wallpaper,wallpapers, rotationMinutes, wallpaperDim, applied,festival, inputKeycodes, appKeys, json == null ? Collections.emptyList() : raceCalendar(json), cinematic);diff --git a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.javaindex 7597e0e60..0b1bd7981 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java@@ -501,6 +501,19 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {btnReorder = findViewById(R.id.btnReorder);btnReorder.setOnClickListener(v -> toggleReorder());btnReorder.setVisibility(cfg.reorderButton ? View.VISIBLE : View.GONE);+ btnLibraryTop = findViewById(R.id.btnLibraryTop);+ btnLibraryTop.setOnClickListener(v -> {+ onLibraryRequested();+ libraryFromTopBar = true; // closing it goes back to this button, not to the pill after the last row+ });+ btnLibraryTop.setVisibility(cfg.libraryButton && cfg.appLibrary ? View.VISIBLE : View.GONE);+ iconOnlyButtons = cfg.iconOnlyButtons;+ wifiIconOnly = iconOnlyButtons && cfg.wifiLabelWidth <= 0;+ if (iconOnlyButtons) {+ if (cfg.wifiLabelWidth > 0) btnWifi.setMaxWidth(Math.round(cfg.wifiLabelWidth * density));+ else makeIconOnly(btnWifi);+ makeIconOnly((TextView) btnSettings);+ }btnSettings.setOnLongClickListener(v -> {showSettingsMenu();return true;@@ -527,8 +540,9 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {btnWifi.setOnKeyListener(pillKeys);btnSettings.setOnKeyListener(pillKeys);btnReorder.setOnKeyListener(pillKeys);+ btnLibraryTop.setOnKeyListener(pillKeys);if (advancedEffects) {- for (View button : new View[]{btnInputs, btnWifi, btnReorder, btnSettings}) {+ for (View button : new View[]{btnInputs, btnWifi, btnReorder, btnLibraryTop, btnSettings}) {button.setOnFocusChangeListener((view, focused) -> view.animate().scaleX(focused ? 1.04f : 1f).scaleY(focused ? 1.04f : 1f).setDuration(160).start());@@ -1054,9 +1068,15 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {if (appLibrary != null) appLibrary.close();if (openPopup != null) openPopup.dismiss();libraryFocusPending = false;+ libraryFromTopBar = false;appLibrary = new AppLibraryDialog(this, animations, reducedMotion, adapter::containsPackage, () -> reloadApps(false), () -> {appLibrary = null;openPopup = null;+ if (libraryFromTopBar) {+ libraryFromTopBar = false;+ btnLibraryTop.requestFocus();+ return;+ }libraryFocusPending = true;grid.post(() -> {if (libraryFocusPending && appLibrary == null && hasWindowFocus() && !isFinishing()) focusLibrary();@@ -1940,6 +1960,10 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {} else {btnWifi.setText(text);}+ if (wifiIconOnly) {+ btnWifi.setContentDescription(btnWifi.getText());+ btnWifi.setText(null);+ }if (festive && diya != null) {if (online && flame == 0) flame = 3; // online some other way (cellular, USB tethering)diya.setSteady(steady);@@ -1949,6 +1973,26 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {}}+ /** config.xml icon_only_buttons. */+ private boolean iconOnlyButtons;+ /** icon_only_buttons without wifi_label_width: the Wi-Fi pill shows no network name. */+ private boolean wifiIconOnly;+ /** The app library button in the top bar (library_button). */+ private View btnLibraryTop;+ /** The open library came from that button: closing it returns there instead of scrolling to the grid's end. */+ private boolean libraryFromTopBar;++ /** Turns a labelled top pill into the round TopButtonIcon shape: no text, the icon centred by even padding. */+ private void makeIconOnly(TextView pill) {+ pill.setContentDescription(pill.getText());+ pill.setText(null);+ pill.setMaxWidth(Integer.MAX_VALUE);+ int pad = Math.round(10 * density);+ pill.setPaddingRelative(pad, 0, pad, 0);+ pill.setCompoundDrawablePadding(0);+ pill.getLayoutParams().width = Math.round(42 * density);+ }+// ---- festive skin ------------------------------------------------------------------------------/**diff --git a/launcher/app/src/main/res/layout-iw/activity_main.xml b/launcher/app/src/main/res/layout-iw/activity_main.xmlindex e546dcec8..539778b0d 100644--- a/launcher/app/src/main/res/layout-iw/activity_main.xml+++ b/launcher/app/src/main/res/layout-iw/activity_main.xml@@ -317,6 +317,14 @@android:drawableStart="@drawable/ic_settings"android:nextFocusDown="@+id/grid" />+ <TextView+ android:id="@+id/btnLibraryTop"+ style="@style/TopButtonIcon"+ android:visibility="gone"+ android:contentDescription="@string/app_library"+ android:drawableStart="@drawable/ic_apps"+ android:nextFocusDown="@+id/grid" />+<TextViewandroid:id="@+id/btnReorder"style="@style/TopButtonIcon"diff --git a/launcher/app/src/main/res/layout/activity_main.xml b/launcher/app/src/main/res/layout/activity_main.xmlindex b8895f0f9..1a8268968 100644--- a/launcher/app/src/main/res/layout/activity_main.xml+++ b/launcher/app/src/main/res/layout/activity_main.xml@@ -330,6 +330,14 @@android:drawableStart="@drawable/ic_swap_vert"android:nextFocusDown="@+id/grid" />+ <TextView+ android:id="@+id/btnLibraryTop"+ style="@style/TopButtonIcon"+ android:visibility="gone"+ android:contentDescription="@string/app_library"+ android:drawableStart="@drawable/ic_apps"+ android:nextFocusDown="@+id/grid" />+<TextViewandroid:id="@+id/btnSettings"style="@style/TopButton"diff --git a/launcher/app/src/main/res/values/config.xml b/launcher/app/src/main/res/values/config.xmlindex 3deebbea4..a87dc6209 100644--- a/launcher/app/src/main/res/values/config.xml+++ b/launcher/app/src/main/res/values/config.xml@@ -110,6 +110,14 @@<!-- A reorder button (two arrows) in the top bar. Off by default: reordering is also in the Settingsbutton's long-press menu, so it needs no extra button on screen. --><bool name="reorder_button">false</bool>+ <!-- Wi-Fi and Settings as round icon-only buttons (the network name moves to the talkback description);+ Inputs keeps its label. -->+ <bool name="icon_only_buttons">false</bool>+ <!-- The app library as a round button in the top bar, beside Settings (app_library must be on too). -->+ <bool name="library_button">false</bool>+ <!-- With icon_only_buttons: keep the network name on the Wi-Fi pill up to this width in dp, cut with an ellipsis.+ 0 leaves the Wi-Fi pill as an icon. -->+ <integer name="wifi_label_width">0</integer><!-- Grid rows left visible under the dock on the home screen. 0 = dock sits at the very bottom. Tiles shrink ifthe dock, its title and this many rows would not otherwise fit the screen height. -->diff --git a/themes/README.md b/themes/README.mdindex d08c19670..4331590e7 100644--- a/themes/README.md+++ b/themes/README.md@@ -40,6 +40,9 @@ is ignored, and a file that doesn't parse is ignored as a whole, so a theme can| `dock_title` | bool | The focused dock app's name in large type above the dock (`true`); `false` keeps only the glow || `dock_row` | bool | The dock as its own row with a band (`true`); `false` makes the dock apps the first tiles of one plain grid || `reorder_button` | bool | A reorder button in the top bar (`false` by default); reordering is always in the Settings button's long-press menu |+| `icon_only_buttons` | bool | Wi-Fi and Settings as round icon buttons; Inputs keeps its label (`false` by default) |+| `wifi_label_width` | 0 to 300 | With `icon_only_buttons`, keep the network name on the Wi-Fi pill up to this width in dp, cut with an ellipsis; 0 leaves only the icon |+| `library_button` | bool | The app library as a round button in the top bar, beside Settings; needs `app_library`. Closing the library returns to it || `app_library` | bool | An App library pill after the last Home row: every installed app, add one to Home or take it off (`false` by default). The choices stay on the TV when a theme is pushed or reset; see [docs/app-library.md](../docs/app-library.md) || `shamsi_date` | bool | Show the Solar Hijri date above the Gregorian one || `greeting_name` | string | A name after the greeting, e.g. `"Mr. Trịnh"` for GOOD MORNING, MR. TRỊNH; empty for the greeting alone |