Skip to content

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

launcher: dock_opacity, a wallpaper can show through the dock's band

Cristian Rojascfa3b59222a5
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 b55b5a100..63f37d304 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
@@ -111,6 +111,8 @@ final class Config {
final List<File> wallpapers;
final int wallpaperRotationMinutes;
final int wallpaperDim;
+ /** The dock band's opacity in percent (config.json dock_opacity, 30-100): below 100 the wallpaper shows through. */
+ final int dockOpacity;
/**
* Playback order for a wallpaper collection: {@code sequential} or {@code shuffle}. Missing or
* invalid values keep the historical shuffle so existing themes rotate exactly as before.
@@ -136,7 +138,7 @@ final class Config {
boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean dockTitle, boolean dockRow, boolean reorderButton, boolean showNetworkPill, boolean iconOnlyButtons, boolean libraryButton, int wifiLabelWidth, boolean alwaysShowNames, boolean wallpaperTrueColor, String vpnApp,
boolean showHomeSettingsShortcut, boolean showStats, boolean appLibrary, int backgroundColor, int skyIntensity,
int[] settingsKeycodes, boolean settingsKeyPanel, boolean wallpaperEnabled, File wallpaper, List<File> wallpapers,
- int wallpaperRotationMinutes, int wallpaperDim, String wallpaperOrder, boolean overlayApplied,
+ int wallpaperRotationMinutes, int wallpaperDim, int dockOpacity, String wallpaperOrder, boolean overlayApplied,
Festival festival, int[] inputKeycodes, List<String> appKeys,
List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, int homeIdleClockMinutes) {
this.inputKeycodes = inputKeycodes;
@@ -182,6 +184,7 @@ final class Config {
this.wallpapers = Collections.unmodifiableList(wallpapers);
this.wallpaperRotationMinutes = wallpaperRotationMinutes;
this.wallpaperDim = wallpaperDim;
+ this.dockOpacity = dockOpacity;
this.wallpaperOrder = wallpaperOrder;
this.overlayApplied = overlayApplied;
this.festival = festival;
@@ -307,6 +310,7 @@ final class Config {
if (!wallpaperEnabled) wallpaper = null;
int rotationMinutes = json == null ? 0 : integer(json, "wallpaper_rotation_minutes", 0, 0, 1440);
int wallpaperDim = json == null ? 0 : integer(json, "wallpaper_dim", 0, 0, 90);
+ int dockOpacity = json == null ? 100 : integer(json, "dock_opacity", 100, 30, 100);
String wallpaperOrder = json == null ? WallpaperRotation.ORDER_SHUFFLE
: string(json, "wallpaper_order", WallpaperRotation.ORDER_SHUFFLE);
// An unknown order must not silently change how an existing collection rotates.
@@ -345,7 +349,7 @@ final class Config {
Math.max(1, columns), Math.max(0, rowsBelow), animations, advancedEffects,
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, wallpaperOrder, applied,
+ wallpapers, rotationMinutes, wallpaperDim, dockOpacity, wallpaperOrder, applied,
festival, inputKeycodes, appKeys, json == null ? Collections.emptyList() : raceCalendar(json), cinematic, ambientGlow,
Math.max(0, idleClockMinutes));
}
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/DockDecoration.java b/launcher/app/src/main/java/com/gathin/tvhome/DockDecoration.java
index 88105157e..507b3a758 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/DockDecoration.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/DockDecoration.java
@@ -24,12 +24,13 @@ public class DockDecoration extends RecyclerView.ItemDecoration {
/**
* @param translucent the cinematic shelf's band: the artwork and the glow show through it.
* @param names the dock tiles show their names, so the band reaches down over them.
+ * @param opacity the plain band's opacity in percent (dock_opacity), so a wallpaper can show through it.
*/
- DockDecoration(int dockSize, float density, boolean translucent, boolean names) {
+ DockDecoration(int dockSize, float density, boolean translucent, boolean names, int opacity) {
this.dockSize = dockSize;
this.density = density;
this.namesRoom = names ? 22 * density : 0;
- band.setColor(translucent ? 0x8C121014 : 0xFF141416);
+ band.setColor(translucent ? 0x8C121014 : (Math.round(opacity * 2.55f) << 24) | 0x141416);
edge.setStyle(Paint.Style.STROKE);
edge.setStrokeWidth(density);
edge.setColor(translucent ? 0x26FFFFFF : 0x1FFFFFFF);
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 e89977e15..910c5b2f7 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@ -431,7 +431,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
public void onChildViewDetachedFromWindow(@NonNull View v) {
}
});
- if (dockRow) grid.addItemDecoration(new DockDecoration(COLUMNS, density, cinematic, cfg.alwaysShowNames));
+ if (dockRow) grid.addItemDecoration(new DockDecoration(COLUMNS, density, cinematic, cfg.alwaysShowNames, cfg.dockOpacity));
if (animations) {
int enterAnim = reducedMotion ? R.anim.tile_enter_reduced : R.anim.tile_enter;
float enterDelay = reducedMotion ? 0f : 0.06f;
diff --git a/themes/README.md b/themes/README.md
index e9ae32cfe..477c37065 100644
--- a/themes/README.md
+++ b/themes/README.md
@@ -63,6 +63,7 @@ is ignored, and a file that doesn't parse is ignored as a whole, so a theme can
| `wallpaper_rotation_minutes` | 0 to 1440 | Rotate images in the theme's `wallpapers/` folder at this interval; 0 keeps the single-image behaviour. A negative or non-numeric value is ignored, and 0 means "no rotation", not "every minute" |
| `wallpaper_order` | `shuffle` or `sequential` | How a collection advances. `shuffle` (the default, and what launchers did before this key existed) avoids repeating the current picture; `sequential` walks the folder in filename order and wraps at the end. An unknown value falls back to `shuffle` |
| `wallpaper_dim` | 0 to 90 | Black overlay over wallpaper images, in percent; 0 by default and no shade view at all |
+| `dock_opacity` | 30 to 100 | Opacity of the dock's band, in percent, so a wallpaper shows through it; 100 by default (the cinematic shelf keeps its own translucent band) |
| `festival` | string | Turns on a festive skin: the network pill becomes a diya whose flame follows the connection, Inputs a temple bell, Settings a marigold, and the first Home of the day gets a petal shower. `dussehra` and `diwali` have built-in greetings |
| `festival_until` | `YYYY-MM-DD` | Last day the festive skin shows; it switches itself off after that. A malformed date turns it off |
| `greeting` | string | Replaces the time-of-day greeting while the festive skin is on |