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: orange and red states for wifi_status_color (wifi_status_warnings)
benny1170ce6740ddfac
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/Config.java b/launcher/app/src/main/java/com/gathin/tvhome/Config.javaindex 6252d6d4b..a21f02d5c 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java@@ -206,6 +206,8 @@ final class Config {final boolean handleViewInputs;/** Hold OK on a tile opens a menu (Move, Remove from Home, App info) instead of App info (config.xml / theme tile_menu). */final boolean tileMenu;+ /** With wifi_status_color, the icon orange while connected without internet (a captive portal) and red while offline (config.xml, wifi_status_warnings). */+ final boolean wifiStatusWarnings;private Config(List<String> dockApps, boolean fillDock, List<String> hiddenApps, List<String> libraryApps, String liveTvPackage,String liveTvAction, String liveTvInputId, Map<String, String> launchActions, Map<String, String> appLabels,@@ -220,7 +222,7 @@ final class Config {List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, boolean appGlow, boolean fadeRows, int homeIdleClockMinutes,boolean keyFilter, boolean dockGlass, String glowStyle, boolean wallpaperCaptions,boolean handleViewInputs, boolean tileMenu, boolean dockEvenPadding, boolean cinematicDots, boolean cinematicWhiteFocus, boolean wifiStatusColor, int cinematicScrim, int cinematicArt,- Map<String, Set<String>> wallpaperMoods, boolean gamepadPassthrough) {+ Map<String, Set<String>> wallpaperMoods, boolean gamepadPassthrough, boolean wifiStatusWarnings) {this.handleViewInputs = handleViewInputs;this.tileMenu = tileMenu;this.inputKeycodes = inputKeycodes;@@ -300,6 +302,7 @@ final class Config {this.cinematicScrim = cinematicScrim;this.wallpaperMoods = wallpaperMoods;this.gamepadPassthrough = gamepadPassthrough;+ this.wifiStatusWarnings = wifiStatusWarnings;this.glowStyle = glowStyle(glowStyle);this.wallpaperCaptions = wallpaperCaptions;}@@ -387,6 +390,7 @@ final class Config {int cinematicScrim = res.getInteger(R.integer.cinematic_scrim);Map<String, Set<String>> wallpaperMoods = moods(res.getString(R.string.wallpaper_moods));String glowStyle = res.getString(R.string.glow_style);+ boolean wifiStatusWarnings = res.getBoolean(R.bool.wifi_status_warnings);boolean applied = false;File dir = dir(ctx);@@ -466,6 +470,7 @@ final class Config {cinematicScrim = integer(json, "cinematic_scrim", cinematicScrim, 0, 100);JSONObject moods = json.optJSONObject("wallpaper_moods");if (moods != null) wallpaperMoods = moods(moods);+ wifiStatusWarnings = bool(json, "wifi_status_warnings", wifiStatusWarnings);glowStyle = string(json, "glow_style", glowStyle);}// A theme push or reset invalidates choices made on the TV. On first use, remember the@@ -520,7 +525,7 @@ final class Config {Math.max(0, Math.min(100, skyIntensity)), settingsKeycodes, settingsKeyPanel, restoreKeyServices, wallpaperEnabled, wallpaper,wallpapers, rotationMinutes, wallpaperDim, dockOpacity, wallpaperOrder, applied,festival, inputKeycodes, appKeys, stockHomeRedirect, json == null ? Collections.emptyList() : raceCalendar(json), cinematic, ambientGlow, appGlow, fadeRows,- Math.max(0, idleClockMinutes), keyFilter, dockGlass, glowStyle, wallpaperCaptions, handleViewInputs, tileMenu, dockEvenPadding, cinematicDots, cinematicWhiteFocus, wifiStatusColor, cinematicScrim, cinematicArt, wallpaperMoods, gamepadPassthrough);+ Math.max(0, idleClockMinutes), keyFilter, dockGlass, glowStyle, wallpaperCaptions, handleViewInputs, tileMenu, dockEvenPadding, cinematicDots, cinematicWhiteFocus, wifiStatusColor, cinematicScrim, cinematicArt, wallpaperMoods, gamepadPassthrough, wifiStatusWarnings);}/**diff --git a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.javaindex dca4f8424..c59b24904 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java@@ -288,6 +288,17 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {public void onLost(@NonNull Network network) {handler.post(MainActivity.this::updateWifiLabel);}++ /** wifi_status_warnings follows validation; signal-strength updates also land here, so skip those. */+ private boolean lastValidated;++ @Override+ public void onCapabilitiesChanged(@NonNull Network network, @NonNull NetworkCapabilities caps) {+ boolean validated = caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);+ if (validated == lastValidated) return;+ lastValidated = validated;+ if (wifiNoInternetTint != null) handler.post(MainActivity.this::updateWifiLabel);+ }};/** Shows the Inputs pill once the TV registers an input: at boot HDMI inputs can appear after Home is shown. */private final TvInputManager.TvInputCallback inputCallback = new TvInputManager.TvInputCallback() {@@ -625,6 +636,10 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {if (cfg.wifiStatusColor) {wifiPlainTint = btnWifi.getCompoundDrawableTintList();wifiOnlineTint = getColorStateList(R.color.pill_icon_online);+ if (cfg.wifiStatusWarnings) {+ wifiNoInternetTint = getColorStateList(R.color.pill_icon_no_internet);+ wifiOfflineTint = getColorStateList(R.color.pill_icon_offline);+ }}if (cfg.topMenu) {// One gear: Inputs and Wi-Fi move into its dropdown. The Wi-Fi pill stays hidden but keeps its@@ -2363,7 +2378,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {/** Shows the Wi-Fi network name on the button when we can read it, otherwise the connection type. */private void updateWifiLabel() {String text = getString(R.string.wifi);- boolean vpn = false, online = false;+ boolean vpn = false, online = false, validated = false;int icon = R.drawable.ic_wifi;// The diya's flame: 0 is out (offline), 1 to 4 follow the Wi-Fi signal, Ethernet burns steady at 4.int flame = 0;@@ -2381,6 +2396,8 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {}if (!caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)) continue;online = true;+ // Android reached the internet through it; a captive portal stays unvalidated until login.+ if (caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)) validated = true;if (caps.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET)) ethernet = true;if (caps.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) wifi = true;}@@ -2448,6 +2465,8 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {btnWifi.setCompoundDrawablesRelativeWithIntrinsicBounds(icon, 0, 0, 0);}ColorStateList tint = online ? wifiOnlineTint : wifiPlainTint;+ // wifi_status_warnings: orange while connected but not validated (a captive portal), red while offline.+ if (wifiNoInternetTint != null) tint = !online ? wifiOfflineTint : validated ? wifiOnlineTint : wifiNoInternetTint;if (wifiOnlineTint != null && btnWifi.getCompoundDrawableTintList() != tint) {btnWifi.setCompoundDrawableTintList(tint);}@@ -2465,6 +2484,8 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {private boolean wifiIconOnly;/** config.xml wifi_status_color: the Wi-Fi icon's green while online and its usual pill colours; null while off. */private ColorStateList wifiOnlineTint, wifiPlainTint;+ /** wifi_status_warnings (with wifi_status_color): orange without internet, red offline; null while off. */+ private ColorStateList wifiNoInternetTint, wifiOfflineTint;/** 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. */diff --git a/launcher/app/src/main/res/color/pill_icon_no_internet.xml b/launcher/app/src/main/res/color/pill_icon_no_internet.xmlnew file mode 100644index 000000000..5b49deca7--- /dev/null+++ b/launcher/app/src/main/res/color/pill_icon_no_internet.xml@@ -0,0 +1,7 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- wifi_status_warnings: the Wi-Fi pill's icon while connected but not validated (a captive portal waiting for its+ login page), orange; dark on the focused pill, as pill_icon_online. -->+<selector xmlns:android="http://schemas.android.com/apk/res/android">+ <item android:state_focused="true" android:color="#FF111111" />+ <item android:color="#FFFF9F0A" />+</selector>diff --git a/launcher/app/src/main/res/color/pill_icon_offline.xml b/launcher/app/src/main/res/color/pill_icon_offline.xmlnew file mode 100644index 000000000..7540d1f2a--- /dev/null+++ b/launcher/app/src/main/res/color/pill_icon_offline.xml@@ -0,0 +1,6 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- wifi_status_warnings: the Wi-Fi pill's icon while offline, red; dark on the focused pill, as pill_icon_online. -->+<selector xmlns:android="http://schemas.android.com/apk/res/android">+ <item android:state_focused="true" android:color="#FF111111" />+ <item android:color="#FFFF453A" />+</selector>diff --git a/launcher/app/src/main/res/values/config.xml b/launcher/app/src/main/res/values/config.xmlindex f600b7d60..add75a041 100644--- a/launcher/app/src/main/res/values/config.xml+++ b/launcher/app/src/main/res/values/config.xml@@ -222,6 +222,10 @@the focused pill either way), so the connection shows at a glance, also as an icon-only button. Can also beset with "wifi_status_color": true in a theme's config.json. --><bool name="wifi_status_color">false</bool>+ <!-- With wifi_status_color: the icon orange while the TV is connected but Android has not reached the internet+ through it (a hotel or holiday-park Wi-Fi waiting for its login page) and red while it is offline, instead+ of white for both. Can also be set with "wifi_status_warnings": true in a theme's config.json. -->+ <bool name="wifi_status_warnings">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.diff --git a/themes/README.md b/themes/README.mdindex fd66ad533..2548497e7 100644--- a/themes/README.md+++ b/themes/README.md@@ -62,6 +62,7 @@ A new key needs one there in the same pull request.| `top_menu` | bool | Inputs, Wi-Fi and Settings folded into one round gear, centred on the header: OK drops a menu with the three plus Reorder apps, hold OK keeps the launcher menu (`false` by default) || `launcher_settings_button` | bool | Make the header Settings action open Launcher settings directly with a matching 22dp home icon; also changes the Settings row when `top_menu` is on. Hold OK keeps module-card and ordering tools. The settings page includes Reorder apps and TV settings (`false` by default) || `wifi_status_color` | bool | The Wi-Fi pill's icon green while the TV is online, white while it is not (`false` by default) |+| `wifi_status_warnings` | bool | With `wifi_status_color`, the icon orange while connected without internet (a captive portal waiting for its login page) and red while offline, instead of white (`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 || `always_show_names` | bool | Names under every tile, dimmed until focused, the dock included (its band grows to hold them); `false` by default shows only the focused tile's name |