Skip to content

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

Merge PR #119: GPU focus animation, opt-in reduced motion

Gathin23d3b8e01093dd
diff --cc README.md
index 48fe690fd,0332daa5b..785299672
--- a/README.md
+++ b/README.md
@@@ -173,13 -165,11 +173,13 @@@ The install scripts ask the TV which la
A small native Android TV app (`com.gathin.tvhome`, about 250 KB installed) in plain Java with
AndroidX RecyclerView and nothing heavier. Built for sets with 1 GB of RAM: no blur, no video, no
network, no background services. It needs JDK 17 and Android SDK platform 34 to build; on macOS,
-`brew install openjdk@17 android-commandlinetools` and `sdkmanager "platforms;android-34" "build-tools;34.0.0"`.
+`brew install openjdk@17 android-commandlinetools` and `sdkmanager "platforms;android-34" "build-tools;34.0.0"`. On Linux
+the install script finds `~/Android/Sdk` and the `java` on your PATH.
- - **Configure** in [`config.xml`](launcher/app/src/main/res/values/config.xml): dock order, hidden apps, the Live TV package, columns (tiles shrink from 5 up), rows under the dock, an optional VPN app for the network pill.
+ - **Configure** in [`config.xml`](launcher/app/src/main/res/values/config.xml): dock order, hidden apps, the Live TV package, columns (tiles shrink from 5 up), rows under the dock, an optional VPN app for the network pill, and `reduced_motion` for TVs whose GPU cannot keep up.
- **Themes** set the same keys plus a background colour and a wallpaper from a `config.json` pushed to the TV, no rebuild. Three ship in [`themes/`](themes/), documented there.
-- **Language** follows the TV: English, German, Spanish, Catalan, French, Russian, Simplified Chinese, Thai. Android 13+ can set it for the launcher alone: `tools/tv.py 'cmd locale set-app-locales com.gathin.tvhome --locales ca'`.
+- **Language** follows the TV: English, German, Spanish, Catalan, French, Russian, Serbian (Latin), Polish, Arabic, Simplified Chinese, Thai. Android 13+ can set it for the launcher alone: `tools/tv.py 'cmd locale set-app-locales com.gathin.tvhome --locales ca'`.
+ Russian includes the module-card approval and management screens and the VPN-off badge.
- **Module cards** let any TV app declare its own tile (label, caption, glow). The launcher asks you once per app, Keep hidden by default, and remembers the answer for that app's signing key and card name. Hold OK on Settings to change your mind. How to make one: [`docs/modules.md`](docs/modules.md); the contract: [`docs/specs/card.md`](docs/specs/card.md).
- **Clock screensaver**: a drifting clock over the glow, so nothing burns in. Pick "Clock" in the TV's screensaver settings, or over ADB:
`tools/tv.py 'settings put secure screensaver_components com.gathin.tvhome/.ClockDream; settings put secure screensaver_enabled 1'`
diff --cc launcher/app/src/main/java/com/gathin/tvhome/GlassView.java
index fcd85378a,82889b9e7..6b3fa85ed
--- a/launcher/app/src/main/java/com/gathin/tvhome/GlassView.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/GlassView.java
@@@ -33,6 -31,12 +31,10 @@@ public class GlassView extends View
rim.setStrokeWidth(1.5f * density);
rim.setColor(0xCCFFFFFF);
glow.setStyle(Paint.Style.STROKE);
- glow.setStrokeWidth(2f * density);
- glow.setColor(0x22FFFFFF);
+ // Cache the slab as a texture. The spring only changes translation, so the GPU can
+ // move it without replaying clipPath and the glow on every frame. That path is
+ // software-rendered on the MT5895 and is what makes the highlight crawl.
+ setLayerType(LAYER_TYPE_HARDWARE, null);
}
void setRadius(float px) {
@@@ -52,22 -56,18 +54,23 @@@
float inset = 6f * density; // room for the glow
rect.set(inset, inset, getWidth() - inset, getHeight() - inset);
- // Outer glow: three widening, fading strokes.
- // One faint stroke: the layer caches it, so it is drawn once rather than on every
- // frame of the spring.
- float o = density;
- canvas.drawRoundRect(rect.left - o, rect.top - o, rect.right + o, rect.bottom + o,
- radius + o, radius + o, glow);
++ // Outer glow: three widening, fading strokes. The hardware layer caches the result, so
++ // they cost one draw, not one per frame of the spring.
+ for (int i = 1; i <= 3; i++) {
+ glow.setStrokeWidth(i * 2f * density);
+ glow.setColor((0x30 / i) << 24 | 0xFFFFFF);
+ float o = i * density;
+ canvas.drawRoundRect(rect.left - o, rect.top - o, rect.right + o, rect.bottom + o, radius + o, radius + o, glow);
+ }
canvas.drawRoundRect(rect, radius, radius, fill);
- clip.reset();
- clip.addRoundRect(rect, radius, radius, Path.Direction.CW);
- // A sheen across the top, drawn as its own round rect so the highlight stays on the GPU.
- // clipPath falls back to software on this SoC and redraws for the whole spring.
- float sheenBottom = rect.top + rect.height() * 0.42f;
- canvas.drawRoundRect(rect.left, rect.top, rect.right, sheenBottom, radius, radius, specular);
++ // Sheen across the top 45%: clipRect stays on the GPU (clipPath did not on the MT5895) and
++ // the round rect under it keeps the top corners rounded with a flat bottom edge.
+ canvas.save();
- canvas.clipPath(clip);
- canvas.drawRect(rect.left, rect.top, rect.right, rect.top + rect.height() * 0.45f, specular);
++ canvas.clipRect(rect.left, rect.top, rect.right, rect.top + rect.height() * 0.45f);
++ canvas.drawRoundRect(rect, radius, radius, specular);
+ canvas.restore();
canvas.drawRoundRect(rect, radius, radius, rim);
}
diff --cc launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index bf4926eb5,f26f35ef5..ce963807d
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@@ -504,8 -509,13 +514,14 @@@ public class MainActivity extends Activ
// Dock: park it at the bottom of the screen and show the top shelf for this app.
int decoratedTop = item.getTop() - (int) (6 * density);
int dy = decoratedTop - grid.getPaddingTop();
- if (Math.abs(dy) > 1) grid.smoothScrollBy(0, dy);
- showHero(position, r.top - dy);
+ // A 1px mismatch used to start a scroll on every dock move. Only scroll when the row is
+ // actually off; reduced motion does it in one jump so it does not fight the highlight.
- if (Math.abs(dy) > (int) (8 * density)) {
++ boolean scroll = Math.abs(dy) > (int) (8 * density);
++ if (scroll) {
+ if (reducedMotion) grid.scrollBy(0, dy);
+ else grid.smoothScrollBy(0, dy);
+ }
- showHero(position, r.top - dy);
++ showHero(position, scroll ? r.top - dy : r.top);
} else {
hideHero();
// Scroll just enough so the whole glass (not only the tile) is visible.