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: Home's wallpaper or plain black behind the clock screensaver (clock_wallpaper, clock_glow)
benny11732320194a991
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/ClockActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/ClockActivity.javaindex f188114f7..8454a4949 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/ClockActivity.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/ClockActivity.java@@ -22,6 +22,7 @@ public class ClockActivity extends Activity {getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE);scene = new ClockScene(getWindow().getDecorView());+ scene.useHomeWallpaper(this);}@Overridediff --git a/launcher/app/src/main/java/com/gathin/tvhome/ClockDream.java b/launcher/app/src/main/java/com/gathin/tvhome/ClockDream.javaindex caf84eee8..5dd174f29 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/ClockDream.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/ClockDream.java@@ -18,6 +18,7 @@ public class ClockDream extends DreamService {setScreenBright(false);setContentView(R.layout.dream_clock);scene = new ClockScene(getWindow().getDecorView());+ scene.useHomeWallpaper(this);}@Overridediff --git a/launcher/app/src/main/java/com/gathin/tvhome/ClockScene.java b/launcher/app/src/main/java/com/gathin/tvhome/ClockScene.javaindex 38734a1c8..6cb811a5b 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/ClockScene.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/ClockScene.java@@ -1,11 +1,20 @@package com.gathin.tvhome;import android.animation.ArgbEvaluator;+import android.content.Context;+import android.graphics.Bitmap;+import android.graphics.BitmapFactory;+import android.graphics.drawable.BitmapDrawable;+import android.graphics.drawable.ColorDrawable;+import android.graphics.drawable.Drawable;import android.graphics.drawable.GradientDrawable;+import android.graphics.drawable.LayerDrawable;import android.os.Handler;import android.os.Looper;+import android.util.DisplayMetrics;import android.view.View;+import java.io.File;import java.util.Random;/**@@ -25,9 +34,12 @@ final class ClockScene {private final Handler handler = new Handler(Looper.getMainLooper());private final Random random = new Random();private final View content;+ private final View ambient;private final GradientDrawable glow;private int colorIndex;private int glowColor;+ /** clock_wallpaper or clock_glow false: something else (a picture, or plain black) replaced the coloured glow. */+ private boolean wallpaperShown;private final Runnable tick = new Runnable() {@Override@@ -41,7 +53,7 @@ final class ClockScene {/** root is the inflated dream_clock layout. */ClockScene(View root) {content = root.findViewById(R.id.dreamContent);- View ambient = root.findViewById(R.id.dreamAmbient);+ ambient = root.findViewById(R.id.dreamAmbient);glow = new GradientDrawable();glow.setGradientType(GradientDrawable.RADIAL_GRADIENT);ambient.setBackground(glow);@@ -66,6 +78,67 @@ final class ClockScene {content.animate().cancel();}+ /**+ * clock_wallpaper: put Home's wallpaper (the theme's single picture, or the first of its collection) behind+ * the clock, darkened by clock_wallpaper_dim, in place of the glow. Decoded off the main thread at screen size+ * in RGB_565 (4 MB at 1080p), like Home's own; until then, or if it cannot be read, the glow stays.+ */+ void useHomeWallpaper(Context ctx) {+ Config cfg;+ try {+ cfg = Config.load(ctx);+ } catch (RuntimeException e) {+ return;+ }+ if (!cfg.clockWallpaper) {+ // clock_glow false: plain black behind the clock (OLED); the clock itself still moves every minute.+ if (!cfg.clockGlow) {+ wallpaperShown = true; // also stops the glow's colour cycle+ ambient.setBackground(null);+ }+ return;+ }+ File file = cfg.wallpaper != null ? cfg.wallpaper : cfg.wallpapers.isEmpty() ? null : cfg.wallpapers.get(0);+ if (file == null) return;+ int shade = (cfg.clockWallpaperDim * 255 / 100) << 24;+ DisplayMetrics dm = ctx.getResources().getDisplayMetrics();+ int w = dm.widthPixels, h = dm.heightPixels;+ new Thread(() -> {+ Bitmap bmp = decode(file, w, h);+ if (bmp == null) return;+ handler.post(() -> {+ wallpaperShown = true;+ ambient.setBackground(new LayerDrawable(new Drawable[]{+ new BitmapDrawable(ctx.getResources(), bmp), new ColorDrawable(shade)}));+ });+ }, "clock-wallpaper").start();+ }++ /** WallpaperPlayer's decode: sampled and scaled down to cover the screen, never bigger than 4K. */+ private static Bitmap decode(File file, int screenW, int screenH) {+ try {+ BitmapFactory.Options options = new BitmapFactory.Options();+ options.inJustDecodeBounds = true;+ BitmapFactory.decodeFile(file.getPath(), options);+ int width = options.outWidth, height = options.outHeight;+ if (width <= 0 || height <= 0) return null;+ int sample = WallpaperSize.sampleSize(width, height, screenW, screenH);+ if (!WallpaperSize.accepted(width / sample, height / sample)) return null;+ options.inJustDecodeBounds = false;+ options.inSampleSize = sample;+ int[] scale = WallpaperSize.coverScale(width / sample, height / sample, screenW, screenH);+ if (scale != null) {+ options.inScaled = true;+ options.inDensity = scale[0];+ options.inTargetDensity = scale[1];+ }+ options.inPreferredConfig = Bitmap.Config.RGB_565;+ return BitmapFactory.decodeFile(file.getPath(), options);+ } catch (Exception | OutOfMemoryError failure) {+ return null;+ }+ }+private void moveClock() {content.animate().alpha(0f).setDuration(900).withLayer().withEndAction(() -> {placeClock();@@ -89,6 +162,7 @@ final class ClockScene {}private void shiftGlow() {+ if (wallpaperShown) return;int from = glowColor;colorIndex = (colorIndex + 1) % PALETTE.length;int to = PALETTE[colorIndex];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..4b9eb91ea 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,12 @@ 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;+ /** The clock screensaver over Home's wallpaper instead of the black glow (config.xml, clock_wallpaper). */+ final boolean clockWallpaper;+ /** How dark the clock screensaver's wallpaper is, 0 to 90 % (config.xml, clock_wallpaper_dim). */+ final int clockWallpaperDim;+ /** The clock screensaver's coloured glow; false leaves the clock on plain black, e.g. for an OLED (config.xml, clock_glow). */+ final boolean clockGlow;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 +226,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 clockWallpaper, int clockWallpaperDim, boolean clockGlow) {this.handleViewInputs = handleViewInputs;this.tileMenu = tileMenu;this.inputKeycodes = inputKeycodes;@@ -300,6 +306,9 @@ final class Config {this.cinematicScrim = cinematicScrim;this.wallpaperMoods = wallpaperMoods;this.gamepadPassthrough = gamepadPassthrough;+ this.clockWallpaper = clockWallpaper;+ this.clockWallpaperDim = clockWallpaperDim;+ this.clockGlow = clockGlow;this.glowStyle = glowStyle(glowStyle);this.wallpaperCaptions = wallpaperCaptions;}@@ -387,6 +396,9 @@ 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 clockWallpaper = res.getBoolean(R.bool.clock_wallpaper);+ int clockWallpaperDim = res.getInteger(R.integer.clock_wallpaper_dim);+ boolean clockGlow = res.getBoolean(R.bool.clock_glow);boolean applied = false;File dir = dir(ctx);@@ -466,6 +478,9 @@ final class Config {cinematicScrim = integer(json, "cinematic_scrim", cinematicScrim, 0, 100);JSONObject moods = json.optJSONObject("wallpaper_moods");if (moods != null) wallpaperMoods = moods(moods);+ clockWallpaper = bool(json, "clock_wallpaper", clockWallpaper);+ clockWallpaperDim = integer(json, "clock_wallpaper_dim", clockWallpaperDim, 0, 90);+ clockGlow = bool(json, "clock_glow", clockGlow);glowStyle = string(json, "glow_style", glowStyle);}// A theme push or reset invalidates choices made on the TV. On first use, remember the@@ -520,7 +535,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, clockWallpaper, Math.max(0, Math.min(90, clockWallpaperDim)), clockGlow);}/**diff --git a/launcher/app/src/main/res/values/config.xml b/launcher/app/src/main/res/values/config.xmlindex f600b7d60..6428e45aa 100644--- a/launcher/app/src/main/res/values/config.xml+++ b/launcher/app/src/main/res/values/config.xml@@ -357,6 +357,15 @@Live TV window does not keep the screen on (CVTE): there the system screensaver would start in themiddle of a programme. Can also be set with "home_idle_clock_minutes": 10 in a theme's config.json. --><integer name="home_idle_clock_minutes">0</integer>+ <!-- The clock screensaver (Home idle clock and the system screensaver) over Home's wallpaper instead of black with+ a coloured glow. The clock still moves every minute. Can also be set with "clock_wallpaper" in a theme. -->+ <bool name="clock_wallpaper">false</bool>+ <!-- How dark that wallpaper is behind the clock, 0 to 90 %. Can also be set with "clock_wallpaper_dim". -->+ <integer name="clock_wallpaper_dim">50</integer>+ <!-- The clock screensaver's slow coloured glow behind the clock. false leaves the clock and date alone on plain black+ (OLED panels); they still move every minute. Ignored while clock_wallpaper shows a picture. Can also be set+ with "clock_glow" in a theme. -->+ <bool name="clock_glow">true</bool><!-- Shape of the glow behind the focused app, in its colour: radial (a soft glow, the default) or horizon (thecolour 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. -->diff --git a/themes/README.md b/themes/README.mdindex fd66ad533..2544380e9 100644--- a/themes/README.md+++ b/themes/README.md@@ -106,6 +106,9 @@ A new key needs one there in the same pull request.| `stock_home_redirect` | string | Stock launcher package; if the firmware turns it back on (XGIMI), its home screen is sent straight back here (`HOME_KEY_SERVICE=1`) || `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) |+| `clock_wallpaper` | bool | The clock screensaver over Home's wallpaper instead of black with a coloured glow; the clock still moves every minute (`false` by default) |+| `clock_wallpaper_dim` | 0 to 90 | How dark that wallpaper is behind the clock, in percent (50 by default) |+| `clock_glow` | bool | The clock screensaver's coloured glow (`true` by default); `false` leaves the moving clock on plain black, e.g. for an OLED || `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 || `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 |