Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

Launcher: wifi_status_color, to show the Wi-Fi icon green while the TV is online

Bansi Patel0044d5e0b25a
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/Config.java b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
index 6071c886f..a5714ab04 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
@@ -175,6 +175,8 @@ final class Config {
final boolean dockGlass;
/** The dock band's padding equals the gap between its tiles (config.xml, dock_even_padding); false keeps the fixed padding. */
final boolean dockEvenPadding;
+ /** The Wi-Fi pill's icon green while the TV is online (config.xml, wifi_status_color); false keeps it white. */
+ final boolean wifiStatusColor;
/** Shape of the glow behind the focused app (config.xml, glow_style): {@link #GLOW_RADIAL} or {@link #GLOW_HORIZON}. */
final String glowStyle;
@@ -198,7 +200,7 @@ final class Config {
Festival festival, int[] inputKeycodes, List<String> appKeys, String stockHomeRedirect,
List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, boolean appGlow, int homeIdleClockMinutes,
boolean keyFilter, boolean dockGlass, String glowStyle, boolean wallpaperCaptions,
- boolean handleViewInputs, boolean tileMenu, boolean dockEvenPadding) {
+ boolean handleViewInputs, boolean tileMenu, boolean dockEvenPadding, boolean wifiStatusColor) {
this.handleViewInputs = handleViewInputs;
this.tileMenu = tileMenu;
this.inputKeycodes = inputKeycodes;
@@ -269,6 +271,7 @@ final class Config {
this.homeIdleClockMinutes = homeIdleClockMinutes;
this.dockGlass = dockGlass;
this.dockEvenPadding = dockEvenPadding;
+ this.wifiStatusColor = wifiStatusColor;
this.glowStyle = glowStyle(glowStyle);
this.wallpaperCaptions = wallpaperCaptions;
}
@@ -346,6 +349,7 @@ final class Config {
boolean keyFilter = res.getBoolean(R.bool.key_filter);
boolean dockGlass = res.getBoolean(R.bool.dock_glass);
boolean dockEvenPadding = res.getBoolean(R.bool.dock_even_padding);
+ boolean wifiStatusColor = res.getBoolean(R.bool.wifi_status_color);
String glowStyle = res.getString(R.string.glow_style);
boolean applied = false;
@@ -416,6 +420,7 @@ final class Config {
keyFilter = bool(json, "key_filter", keyFilter);
dockGlass = bool(json, "dock_glass", dockGlass);
dockEvenPadding = bool(json, "dock_even_padding", dockEvenPadding);
+ wifiStatusColor = bool(json, "wifi_status_color", wifiStatusColor);
glowStyle = string(json, "glow_style", glowStyle);
}
// A theme push or reset invalidates choices made on the TV. On first use, remember the
@@ -470,7 +475,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,
- Math.max(0, idleClockMinutes), keyFilter, dockGlass, glowStyle, wallpaperCaptions, handleViewInputs, tileMenu, dockEvenPadding);
+ Math.max(0, idleClockMinutes), keyFilter, dockGlass, glowStyle, wallpaperCaptions, handleViewInputs, tileMenu, dockEvenPadding, wifiStatusColor);
}
/**
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index 5be43c946..730dcbae4 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@ -15,6 +15,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ApplicationInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ChangedPackages;
+import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@@ -609,6 +610,10 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
iconOnlyButtons = cfg.iconOnlyButtons;
topMenu = cfg.topMenu;
wifiIconOnly = iconOnlyButtons && cfg.wifiLabelWidth <= 0;
+ if (cfg.wifiStatusColor) {
+ wifiPlainTint = btnWifi.getCompoundDrawableTintList();
+ wifiOnlineTint = getColorStateList(R.color.pill_icon_online);
+ }
if (cfg.topMenu) {
// One gear: Inputs and Wi-Fi move into its dropdown. The Wi-Fi pill stays hidden but keeps its
// label up to date, which the menu's Wi-Fi row shows.
@@ -2394,6 +2399,10 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
wifiIcon = icon;
btnWifi.setCompoundDrawablesRelativeWithIntrinsicBounds(icon, 0, 0, 0);
}
+ ColorStateList tint = online ? wifiOnlineTint : wifiPlainTint;
+ if (wifiOnlineTint != null && btnWifi.getCompoundDrawableTintList() != tint) {
+ btnWifi.setCompoundDrawableTintList(tint);
+ }
}
}
@@ -2404,6 +2413,8 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
private boolean launcherSettingsButton;
/** icon_only_buttons without wifi_label_width: the Wi-Fi pill shows no network name. */
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;
/** 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_online.xml b/launcher/app/src/main/res/color/pill_icon_online.xml
new file mode 100644
index 000000000..b5fe969f6
--- /dev/null
+++ b/launcher/app/src/main/res/color/pill_icon_online.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- wifi_status_color: the Wi-Fi pill's icon while online, green like status_dot; dark on the focused pill, as pill_text. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_focused="true" android:color="#FF111111" />
+ <item android:color="#FF34C759" />
+</selector>
diff --git a/launcher/app/src/main/res/values/config.xml b/launcher/app/src/main/res/values/config.xml
index f600676d0..ae37662c2 100644
--- a/launcher/app/src/main/res/values/config.xml
+++ b/launcher/app/src/main/res/values/config.xml
@@ -210,6 +210,10 @@
<bool name="icon_only_buttons">false</bool>
<!-- The Inputs pill as a round icon button too (the label moves to the talkback description). -->
<bool name="icon_only_inputs">false</bool>
+ <!-- true colours the Wi-Fi pill's icon green while the TV is online and leaves it white while it is not (dark on
+ the focused pill either way), so the connection shows at a glance, also as an icon-only button. Can also be
+ set with "wifi_status_color": true in a theme's config.json. -->
+ <bool name="wifi_status_color">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.md
index c0b455181..18d9d4761 100644
--- a/themes/README.md
+++ b/themes/README.md
@@ -56,6 +56,7 @@ is ignored, and a file that doesn't parse is ignored as a whole, so a theme can
| `icon_only_inputs` | bool | The Inputs pill as a round icon button too, its label kept as the TalkBack description (`false` by default). Works with or without `icon_only_buttons` |
| `top_menu` | bool | Inputs, Wi-Fi and Settings folded into one round gear, centred on the header: OK drops a menu with the three, 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_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 |