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: glass_style, a quieter focus highlight
Quentin Lecoq2a5a858b35e1
diff --git a/docs/switches.md b/docs/switches.mdindex 17f253536..a50998b45 100644--- a/docs/switches.md+++ b/docs/switches.md@@ -23,6 +23,7 @@ the rules. Keys from before this rule are on its wanted list; a screenshot for o| Key | Screenshot ||---|---|| `columns` | <img src="../themes/six-columns/screenshot.jpg" width="320" alt="columns on a TV"> |+| `glass_style` | <img src="switches/glass_style.jpg" width="320" alt="glass_style halo on a TV"> || `sky_intensity` | <img src="sky-sunset.jpg" width="320" alt="sky_intensity on a TV"> || `wallpaper_rotation_minutes` | <img src="../themes/scenes/screenshot.jpg" width="320" alt="wallpaper_rotation_minutes on a TV"> || `festival` | <img src="../themes/dussehra/screenshot.jpg" width="320" alt="festival on a TV"> |diff --git a/docs/switches/glass_style.jpg b/docs/switches/glass_style.jpgnew file mode 100644index 000000000..20e1721ecBinary files /dev/null and b/docs/switches/glass_style.jpg differdiff --git a/launcher/app/src/main/java/com/gathin/tvhome/Config.java b/launcher/app/src/main/java/com/gathin/tvhome/Config.javaindex 6252d6d4b..749398d80 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java@@ -198,8 +198,11 @@ final class Config {final Map<String, Set<String>> wallpaperMoods;/** Shape of the glow behind the focused app (config.xml, glow_style): {@link #GLOW_RADIAL} or {@link #GLOW_HORIZON}. */final String glowStyle;+ /** The focus highlight's look (config.xml, glass_style): {@link #GLASS_DEFAULT}, {@link #GLASS_RIM} or {@link #GLASS_HALO}. */+ final String glassStyle;static final String GLOW_RADIAL = "radial", GLOW_HORIZON = "horizon";+ static final String GLASS_DEFAULT = "glass", GLASS_RIM = "rim", GLASS_HALO = "halo";/** Show each rotating wallpaper's name from wallpapers/captions.txt (config.xml / theme wallpaper_captions). */final boolean wallpaperCaptions;/** Answer VIEW_INPUTS with the Inputs menu (handle_view_inputs); see InputsRequestActivity. */@@ -220,7 +223,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, String glassStyle) {this.handleViewInputs = handleViewInputs;this.tileMenu = tileMenu;this.inputKeycodes = inputKeycodes;@@ -302,6 +305,7 @@ final class Config {this.gamepadPassthrough = gamepadPassthrough;this.glowStyle = glowStyle(glowStyle);this.wallpaperCaptions = wallpaperCaptions;+ this.glassStyle = glassStyle(glassStyle);}/** A known glow_style, or radial (the default) for anything else. */@@ -309,6 +313,14 @@ final class Config {return value != null && GLOW_HORIZON.equalsIgnoreCase(value.trim()) ? GLOW_HORIZON : GLOW_RADIAL;}+ /** A known glass_style, or glass (the default) for anything else. */+ static String glassStyle(String value) {+ if (value == null) return GLASS_DEFAULT;+ String v = value.trim();+ if (GLASS_RIM.equalsIgnoreCase(v)) return GLASS_RIM;+ return GLASS_HALO.equalsIgnoreCase(v) ? GLASS_HALO : GLASS_DEFAULT;+ }+/** The folder the theme tools push into; null when external storage is unavailable. */static File dir(Context ctx) {return ctx.getExternalFilesDir(null);@@ -387,6 +399,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);+ String glassStyle = res.getString(R.string.glass_style);boolean applied = false;File dir = dir(ctx);@@ -467,6 +480,7 @@ final class Config {JSONObject moods = json.optJSONObject("wallpaper_moods");if (moods != null) wallpaperMoods = moods(moods);glowStyle = string(json, "glow_style", glowStyle);+ glassStyle = string(json, "glass_style", glassStyle);}// A theme push or reset invalidates choices made on the TV. On first use, remember the// current theme without clearing choices from an older launcher version.@@ -520,7 +534,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, glassStyle);}/**diff --git a/launcher/app/src/main/java/com/gathin/tvhome/GlassView.java b/launcher/app/src/main/java/com/gathin/tvhome/GlassView.javaindex 33593c8ca..0fd2b6cd6 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/GlassView.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/GlassView.java@@ -26,6 +26,9 @@ public class GlassView extends View {private int glowRgb = 0xFFFFFF;/** Glow strength: the white glow stays faint, a coloured one needs more alpha to read as warm light. */private int glowAlpha = 0x30;+ /** glass_style rim or halo: no sheen and no fill, only the crisp rim (and, for halo, a lighter outer glow). */+ private boolean flat;+ private boolean halo;public GlassView(Context context, AttributeSet attrs) {super(context, attrs);@@ -58,6 +61,14 @@ public class GlassView extends View {invalidate();}+ /** One of Config's GLASS_* styles. */+ void setStyle(String style) {+ flat = Config.GLASS_RIM.equals(style) || Config.GLASS_HALO.equals(style);+ halo = Config.GLASS_HALO.equals(style);+ rim.setStrokeWidth((flat ? 2f : 1.5f) * density);+ invalidate();+ }+void setRadius(float px) {radius = px;invalidate();@@ -78,14 +89,21 @@ public class GlassView extends View {// Outer glow: thin rings across the inset, each a little fainter, so it fades out smoothly. Three wide// strokes left visible bands once the glow took an app's colour at a stronger alpha. The hardware layer// caches the result, so the rings cost one draw, not one per frame of the spring.- int rings = 12;- float step = inset / rings;- glow.setStrokeWidth(step + 0.5f);- for (int i = 0; i < rings; i++) {- float o = step * (i + 0.5f);- float t = 1f - (float) i / rings;- glow.setColor(Math.round(glowAlpha * t) << 24 | glowRgb);- canvas.drawRoundRect(rect.left - o, rect.top - o, rect.right + o, rect.bottom + o, radius + o, radius + o, glow);+ if (!flat || halo) {+ int rings = 12;+ float step = inset / rings;+ int alpha = flat ? glowAlpha / 2 : glowAlpha;+ glow.setStrokeWidth(step + 0.5f);+ for (int i = 0; i < rings; i++) {+ float o = step * (i + 0.5f);+ float t = 1f - (float) i / rings;+ glow.setColor(Math.round(alpha * t) << 24 | glowRgb);+ canvas.drawRoundRect(rect.left - o, rect.top - o, rect.right + o, rect.bottom + o, radius + o, radius + o, glow);+ }+ }+ if (flat) {+ canvas.drawRoundRect(rect, radius, radius, rim);+ return;}canvas.drawRoundRect(rect, radius, radius, fill);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..fcdec1c5f 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java@@ -395,6 +395,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {sky = findViewById(R.id.sky);sky.setIntensity(cfg.skyIntensity);glass = findViewById(R.id.glass);+ glass.setStyle(cfg.glassStyle);if (festive) glass.setAccent(festival.accentColor());ambient = findViewById(R.id.ambient);// The glow is one bitmap, so its alpha can be applied while drawing it. Otherwise every frame ofdiff --git a/launcher/app/src/main/res/values/config.xml b/launcher/app/src/main/res/values/config.xmlindex f600b7d60..7a3cf9689 100644--- a/launcher/app/src/main/res/values/config.xml+++ b/launcher/app/src/main/res/values/config.xml@@ -361,4 +361,8 @@colour washes down from the top edge and fades to black, brightest along the top). The cinematic shelfkeeps its own glow. Can also be set with "glow_style": "horizon" in a theme's config.json. --><string name="glow_style" translatable="false">radial</string>+ <!-- The focus highlight's look: glass (the default: a translucent slab with a bright top sheen, a crisp rim and a+ faint outer glow), rim (the crisp rim alone, no sheen, fill or glow, for a quiet focus over a wallpaper) or+ halo (the rim with a lighter outer glow). Can also be set with "glass_style": "rim" in a theme's config.json. -->+ <string name="glass_style" translatable="false">glass</string></resources>diff --git a/launcher/app/src/test/java/com/gathin/tvhome/GlassStyleTest.java b/launcher/app/src/test/java/com/gathin/tvhome/GlassStyleTest.javanew file mode 100644index 000000000..15784fb30--- /dev/null+++ b/launcher/app/src/test/java/com/gathin/tvhome/GlassStyleTest.java@@ -0,0 +1,29 @@+package com.gathin.tvhome;++import org.junit.Test;++import static org.junit.Assert.assertEquals;++/** glass_style from config.xml or a theme: rim or halo by name, glass for anything else. */+public class GlassStyleTest {++ @Test+ public void rimByNameAnyCase() {+ assertEquals(Config.GLASS_RIM, Config.glassStyle("rim"));+ assertEquals(Config.GLASS_RIM, Config.glassStyle(" Rim "));+ }++ @Test+ public void haloByNameAnyCase() {+ assertEquals(Config.GLASS_HALO, Config.glassStyle("halo"));+ assertEquals(Config.GLASS_HALO, Config.glassStyle("HALO "));+ }++ @Test+ public void anythingElseIsGlass() {+ assertEquals(Config.GLASS_DEFAULT, Config.glassStyle("glass"));+ assertEquals(Config.GLASS_DEFAULT, Config.glassStyle(""));+ assertEquals(Config.GLASS_DEFAULT, Config.glassStyle(null));+ assertEquals(Config.GLASS_DEFAULT, Config.glassStyle("frosted"));+ }+}diff --git a/themes/README.md b/themes/README.mdindex fd66ad533..7555eb4ee 100644--- a/themes/README.md+++ b/themes/README.md@@ -107,6 +107,7 @@ A new key needs one there in the same pull request.| `race_calendar` | list of races | F1 race-weekend mode: from 12 hours before a weekend's first session until 4 hours after the race starts, a panel under the clock shows the next session with a countdown (or the live one) and the weekend's session times in the TV's time zone. Write it with `tools/race_calendar.py <theme folder>`, which fetches the season from the free Jolpica API; the launcher itself never goes online || `home_idle_clock_minutes` | 0 to 1440 | Minutes Home may sit untouched before it shows the clock screensaver (a thin clock and date drifting over a slow glow, as the system "Clock" screensaver does). Any key returns to Home. It starts only from Home, never over Live TV or an app; 0 is off (default) || `glow_style` | string | Shape of the glow behind the focused app, in its colour: `radial` (default) or `horizon`, the colour washing down from the top edge to black; the cinematic shelf keeps its own |+| `glass_style` | string | Look of the focus highlight: `glass` (default: a translucent slab with a bright top sheen, a crisp rim and a faint outer glow), `rim` (the crisp rim alone, no sheen, fill or glow, for a quiet focus over a wallpaper) or `halo` (the rim with a lighter outer glow) || `cinematic_home` | bool | Cinematic top shelf: the focused dock app's artwork, softened, fills the top of the screen in its colour, with a larger name, "Last opened" (apps opened from Home), dock position dots, a focus glow in the app's colour and a translucent dock band; off by default || `cinematic_dots` | bool | With `cinematic_home`, the dock position dots under the app's name (`true` by default); `false` leaves them out || `cinematic_white_focus` | bool | With `cinematic_home`, the focus highlight stays white on the dock instead of taking the focused app's colour (`false` by default); `app_glow` still colours every tile |