Skip to content

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

Merge PR #610: launcher: opt-in clock screensaver that starts only from Home

Gathin238c687f21ffa7
diff --cc launcher/app/src/main/java/com/gathin/tvhome/Config.java
index 13bd52b0f,a3583ed8b..56777dbeb
--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
@@@ -119,8 -104,8 +119,10 @@@ final class Config
final List<RaceWeekend.Race> raceCalendar;
/** Cinematic top shelf (config.xml, cinematic_home): the focused dock app's artwork behind a larger shelf. */
final boolean cinematicHome;
+ /** The glow in the focused app's colour behind the dock (config.xml, ambient_glow); false keeps the background plain. */
+ final boolean ambientGlow;
+ /** Minutes Home may sit untouched before the clock screensaver (config.xml, home_idle_clock_minutes); 0 is off. */
+ final int homeIdleClockMinutes;
private Config(List<String> dockApps, boolean fillDock, List<String> hiddenApps, String liveTvPackage,
String liveTvAction, Map<String, String> launchActions, Map<String, String> appLabels,
@@@ -131,7 -116,7 +133,7 @@@
int[] settingsKeycodes, boolean settingsKeyPanel, boolean wallpaperEnabled, File wallpaper, List<File> wallpapers,
int wallpaperRotationMinutes, int wallpaperDim, boolean overlayApplied,
Festival festival, int[] inputKeycodes, List<String> appKeys,
- List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow) {
- List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, int homeIdleClockMinutes) {
++ List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, int homeIdleClockMinutes) {
this.inputKeycodes = inputKeycodes;
this.appKeys = Collections.unmodifiableList(appKeys);
this.dockApps = Collections.unmodifiableList(dockApps);
@@@ -179,7 -158,7 +181,8 @@@
this.festival = festival;
this.raceCalendar = Collections.unmodifiableList(raceCalendar);
this.cinematicHome = cinematicHome;
+ this.ambientGlow = ambientGlow;
+ this.homeIdleClockMinutes = homeIdleClockMinutes;
}
/** The folder the theme tools push into; null when external storage is unavailable. */
@@@ -228,7 -201,7 +231,8 @@@
int[] inputKeycodes = res.getIntArray(R.array.input_key_keycodes);
List<String> appKeys = new ArrayList<>(Arrays.asList(res.getStringArray(R.array.app_keys)));
boolean cinematic = res.getBoolean(R.bool.cinematic_home);
+ boolean ambientGlow = res.getBoolean(R.bool.ambient_glow);
+ int idleClockMinutes = res.getInteger(R.integer.home_idle_clock_minutes);
boolean applied = false;
File dir = dir(ctx);
@@@ -276,7 -242,7 +280,8 @@@
inputKeycodes = intArray(json, "input_key_keycodes", inputKeycodes);
appKeys = stringList(json, "app_keys", appKeys);
cinematic = bool(json, "cinematic_home", cinematic);
+ ambientGlow = bool(json, "ambient_glow", ambientGlow);
+ idleClockMinutes = integer(json, "home_idle_clock_minutes", idleClockMinutes, 0, 1440);
}
// 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.
@@@ -328,10 -293,11 +333,11 @@@
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, showNetworkPill, iconOnlyButtons, libraryButton, wifiLabelWidth, alwaysShowNames, wallpaperTrueColor, 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, ambientGlow);
- festival, inputKeycodes, appKeys, json == null ? Collections.emptyList() : raceCalendar(json), cinematic,
++ festival, inputKeycodes, appKeys, json == null ? Collections.emptyList() : raceCalendar(json), cinematic, ambientGlow,
+ Math.max(0, idleClockMinutes));
}
/**
diff --cc launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index 1c2b7e5f8,1865a056b..e89977e15
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@@ -644,8 -610,8 +648,9 @@@ public class MainActivity extends Activ
recreate();
return;
}
+ restartIdleClock();
promptsPaused = false;
+ if (grid.getAdapter() == null) grid.setAdapter(adapter); // dropped by onTrimMemory
if (rebuildOnResume) {
tilesReady = false;
reloadApps(true);
diff --cc launcher/app/src/main/res/values/config.xml
index bcb8b84f4,f442baef9..4ca1b963c
--- a/launcher/app/src/main/res/values/config.xml
+++ b/launcher/app/src/main/res/values/config.xml
@@@ -187,8 -160,9 +187,13 @@@
shelf. Can also be set with "cinematic_home": true in a theme's config.json. -->
<bool name="cinematic_home">false</bool>
+ <!-- The glow behind the dock in the focused app's colour (red for YouTube, blue for Prime Video). false keeps
+ only background_color or the wallpaper behind everything. Can also be set with "ambient_glow": false in a
+ theme's config.json. -->
+ <bool name="ambient_glow">true</bool>
+ <!-- Minutes Home may sit untouched before it shows the clock screensaver (ClockActivity); 0 turns it off.
+ Unlike the system screensaver this never starts over live TV or an app, which matters on TVs whose
+ Live TV window does not keep the screen on (CVTE): there the system screensaver would start in the
+ middle 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>
</resources>
diff --cc themes/README.md
index 969cd7ec5,225347c1e..814dd5817
--- a/themes/README.md
+++ b/themes/README.md
@@@ -68,10 -62,10 +68,11 @@@ is ignored, and a file that doesn't par
| `settings_key_keycodes` | list of keycodes | Remote buttons that open Settings, for `HomeKeyService` (TCL Google TV gear: `[83]`) |
| `settings_key_panel` | bool | Those buttons open a small quick settings panel (TV settings, Display, Network, Apps, Launcher settings) instead of the TV's Settings |
| `input_key_keycodes` | list of keycodes | More remote buttons that open the input switcher, for `InputKeyService` (`KEYCODE_TV` and `KEYCODE_TV_INPUT` always do) |
-| `app_keys` | list of strings | Remote buttons that open an app, as `"190:com.google.android.youtube.tv"` or `"KEYCODE_BUTTON_3:com.google.android.youtube.tv"`, for `InputKeyService` or `HomeKeyService` |
+| `app_keys` | list of strings | Remote buttons that open an app, as `"190:com.google.android.youtube.tv"` or `"KEYCODE_BUTTON_3:com.google.android.youtube.tv"`, or by scancode as `"scan:490:com.wbd.hbomax"` for remotes that share one keycode between app buttons (Sony BRAVIA), for `InputKeyService` or `HomeKeyService` |
| `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) |
| `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 |
+| `ambient_glow` | bool | The glow behind the dock in the focused app's colour (`true` by default); `false` keeps only `background_color` or the wallpaper, e.g. for a calm photo background |
## Wallpapers