Skip to content

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

dock_glass: the dock band as light frosted glass, like the pills

Shivam Singh80b3bca1124f
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..90f64aa12 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
@@ -128,6 +128,8 @@ final class Config {
final boolean ambientGlow;
/** Minutes Home may sit untouched before the clock screensaver (config.xml, home_idle_clock_minutes); 0 is off. */
final int homeIdleClockMinutes;
+ /** The dock band as light frosted glass like the pills (config.xml, dock_glass); false keeps the solid band. */
+ final boolean dockGlass;
private Config(List<String> dockApps, boolean fillDock, List<String> hiddenApps, String liveTvPackage,
String liveTvAction, Map<String, String> launchActions, Map<String, String> appLabels,
@@ -138,7 +140,8 @@ final class Config {
int[] settingsKeycodes, boolean settingsKeyPanel, boolean wallpaperEnabled, File wallpaper, List<File> wallpapers,
int wallpaperRotationMinutes, int wallpaperDim, String wallpaperOrder, boolean overlayApplied,
Festival festival, int[] inputKeycodes, List<String> appKeys,
- List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, int homeIdleClockMinutes) {
+ List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, int homeIdleClockMinutes,
+ boolean dockGlass) {
this.inputKeycodes = inputKeycodes;
this.appKeys = Collections.unmodifiableList(appKeys);
this.dockApps = Collections.unmodifiableList(dockApps);
@@ -189,6 +192,7 @@ final class Config {
this.cinematicHome = cinematicHome;
this.ambientGlow = ambientGlow;
this.homeIdleClockMinutes = homeIdleClockMinutes;
+ this.dockGlass = dockGlass;
}
/** The folder the theme tools push into; null when external storage is unavailable. */
@@ -239,6 +243,7 @@ final class Config {
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 dockGlass = res.getBoolean(R.bool.dock_glass);
boolean applied = false;
File dir = dir(ctx);
@@ -288,6 +293,7 @@ final class Config {
cinematic = bool(json, "cinematic_home", cinematic);
ambientGlow = bool(json, "ambient_glow", ambientGlow);
idleClockMinutes = integer(json, "home_idle_clock_minutes", idleClockMinutes, 0, 1440);
+ dockGlass = bool(json, "dock_glass", dockGlass);
}
// 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.
@@ -347,7 +353,7 @@ final class Config {
Math.max(0, Math.min(100, skyIntensity)), settingsKeycodes, settingsKeyPanel, wallpaperEnabled, wallpaper,
wallpapers, rotationMinutes, wallpaperDim, wallpaperOrder, applied,
festival, inputKeycodes, appKeys, json == null ? Collections.emptyList() : raceCalendar(json), cinematic, ambientGlow,
- Math.max(0, idleClockMinutes));
+ Math.max(0, idleClockMinutes), dockGlass);
}
/**
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..ae1af7f1c 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/DockDecoration.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/DockDecoration.java
@@ -1,9 +1,11 @@
package com.gathin.tvhome;
import android.graphics.Canvas;
+import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
+import android.graphics.Shader;
import android.view.View;
import androidx.annotation.NonNull;
@@ -20,19 +22,25 @@ public class DockDecoration extends RecyclerView.ItemDecoration {
/** Extra band below the tiles for their names (always_show_names), in px. */
private final float namesRoom;
+ /** Light glass like the top bar's pills (config.xml dock_glass): a white tint that fades downwards. */
+ private final boolean lightGlass;
+ /** The band's top and bottom the glass gradient was made for; it is remade when they move. */
+ private float shaderTop = Float.NaN, shaderBottom = Float.NaN;
/**
* @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 lightGlass a light frosted band like the pills, for a sky or wallpaper behind it.
*/
- DockDecoration(int dockSize, float density, boolean translucent, boolean names) {
+ DockDecoration(int dockSize, float density, boolean translucent, boolean names, boolean lightGlass) {
this.dockSize = dockSize;
this.density = density;
this.namesRoom = names ? 22 * density : 0;
+ this.lightGlass = lightGlass;
band.setColor(translucent ? 0x8C121014 : 0xFF141416);
edge.setStyle(Paint.Style.STROKE);
edge.setStrokeWidth(density);
- edge.setColor(translucent ? 0x26FFFFFF : 0x1FFFFFFF);
+ edge.setColor(lightGlass ? 0x38FFFFFF : translucent ? 0x26FFFFFF : 0x1FFFFFFF);
}
@Override
@@ -75,6 +83,13 @@ public class DockDecoration extends RecyclerView.ItemDecoration {
rect.inset(-side, -pad);
rect.bottom += namesRoom;
float radius = 26 * density;
+ if (lightGlass && (rect.top != shaderTop || rect.bottom != shaderBottom)) {
+ // The pills' glass (pill_bg: white, 18% fading to 8%), a little fainter over this much larger area.
+ band.setShader(new LinearGradient(0, rect.top, 0, rect.bottom, 0x24FFFFFF, 0x0DFFFFFF,
+ Shader.TileMode.CLAMP));
+ shaderTop = rect.top;
+ shaderBottom = rect.bottom;
+ }
c.drawRoundRect(rect, radius, radius, band);
c.drawRoundRect(rect, radius, radius, edge);
}
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..b2d4563be 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.dockGlass));
if (animations) {
int enterAnim = reducedMotion ? R.anim.tile_enter_reduced : R.anim.tile_enter;
float enterDelay = reducedMotion ? 0f : 0.06f;
diff --git a/launcher/app/src/main/res/values/config.xml b/launcher/app/src/main/res/values/config.xml
index 4ca1b963c..45481b835 100644
--- a/launcher/app/src/main/res/values/config.xml
+++ b/launcher/app/src/main/res/values/config.xml
@@ -111,6 +111,10 @@
shelf above it. false makes the dock apps simply the first tiles of one plain grid (still in dock_apps
order, no empty slots), with names under every tile and the glow behind every focused tile. -->
<bool name="dock_row">true</bool>
+ <!-- The dock band as light frosted glass, like the Inputs, Wi-Fi and Settings pills, so a sky or wallpaper shows
+ through it. false (the default) keeps the solid near-black band, or the cinematic shelf's dark glass. Can
+ also be set with "dock_glass": true in a theme's config.json. -->
+ <bool name="dock_glass">false</bool>
<!-- A reorder button (two arrows) in the top bar. Off by default: reordering is also in the Settings
button's long-press menu, so it needs no extra button on screen. -->
<bool name="reorder_button">false</bool>
diff --git a/themes/README.md b/themes/README.md
index e9ae32cfe..0e658fe1a 100644
--- a/themes/README.md
+++ b/themes/README.md
@@ -74,6 +74,7 @@ is ignored, and a file that doesn't parse is ignored as a whole, so a theme can
| `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 |
+| `dock_glass` | bool | The dock band as light frosted glass like the top bar's pills (`false` by default); suits `sky_intensity` or a wallpaper, where the solid band reads as a dark slab |
| `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