Skip to content

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

Merge PR #218: Hebrew localization and right-to-left Home

Gathin2341503d274e3e
diff --cc README.md
index a91fe8016,4f220fcb4..f57dbeb1c
--- a/README.md
+++ b/README.md
@@@ -226,15 -210,14 +226,17 @@@ network, no background services. It nee
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, and `reduced_motion` for TVs whose GPU cannot keep up.
+- **On-TV launcher settings:** click Settings for the TV's system settings, or hold OK on Settings and choose Launcher settings to set 4, 5, 6 or 7 apps per row, turn animations on or off, and opt into advanced effects. The advanced option adds tile lift, icon zoom and smooth ambient-colour transitions; it may use more memory. Use Follow theme to clear on-TV choices. Pushing or resetting a theme also clears them.
+- **Change the default home:** Launcher settings and the optional Default-home tile (`show_home_settings_shortcut`) open Android's home picker. Choose the original launcher to stop using CleanYourTV as Home, or CleanYourTV to return. The original launcher must be enabled. If the install script disabled it, use the restore script below first. Some TVs provide no home picker.
- **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, Serbian (Latin), Polish, Arabic, Simplified Chinese, Thai, Turkish, Portuguese. 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, Hebrew, Simplified Chinese, Thai, Turkish. Android 13+ can set it for the launcher alone: `tools/tv.py 'cmd locale set-app-locales com.gathin.tvhome --locales he'`.
+ Hebrew places the menu buttons on the left and the date and clock on the right, with the greeting above the clock. The Clock screensaver right-aligns its date and time, and Hebrew dates include the month prefix ב (for example, 19 באוקטובר). Hebrew dock and app-grid rows start on the right, with matching left/right remote navigation. The Hebrew input selector places icons and labels on the right, status on the left, and aligns the dropdown with the Inputs button’s right edge. Other languages keep their original layouts.
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).
+- **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 and choose Module cards 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'`
-- **Remote keys**: an optional accessibility service keeps the remote's Input button working on Google TV (`INPUT_KEY_SERVICE=1` at install), another fixes sticks whose Home key sends ALL_APPS and opens Settings from the remote's gear button, even one Android does not map (`HOME_KEY_SERVICE=1`, scancodes in `config.xml`).
+- **Remote keys**: an optional accessibility service keeps the remote's Input button working on Google TV (`INPUT_KEY_SERVICE=1` at install), another fixes sticks whose Home key sends ALL_APPS and opens Settings from the remote's gear button, even one Android does not map (`HOME_KEY_SERVICE=1`, scancodes or keycodes in `config.xml`).
- **Navigation** is deliberate: Up and Down move one row, the top buttons never fall through to tiles and Down from them returns to the dock tile you came from, the last focused app is remembered, and installing or removing an app refreshes the tiles while Home is open.
- **Artwork**: app banners load at xhdpi or better, so low-density TV UIs do not downsample them before the focus zoom.
diff --cc launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index 2b72f2ee5,c7d1db5be..653182d8e
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@@ -75,9 -73,9 +75,10 @@@ import java.util.Set
*/
public class MainActivity extends Activity implements AppAdapter.TileListener {
+ private static final int LAUNCHER_SETTINGS_REQUEST = 42;
/** Tiles per row and dock slots (res/values/config.xml, columns). Set in onCreate. */
static int COLUMNS = 4;
+ private boolean rtlAppGrid;
private static final long MINUTE_MS = 60_000L;
private String liveTvPkg;
private String liveTvAction;
diff --cc launcher/app/src/main/res/layout-iw/activity_main.xml
index 000000000,1e85b660c..71da1b311
mode 000000,100644..100644
--- a/launcher/app/src/main/res/layout-iw/activity_main.xml
+++ b/launcher/app/src/main/res/layout-iw/activity_main.xml
@@@ -1,0 -1,222 +1,230 @@@
+ <?xml version="1.0" encoding="utf-8"?>
+ <!-- Hebrew-only header positioning. Other languages use layout/activity_main.xml. -->
+ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/root"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="#FF000000">
+
++ <!-- Time-of-day backdrop, drawn once a minute (config.xml sky_intensity; 0 keeps it hidden).
++ Keep in step with layout/activity_main.xml: every view there must exist here too. -->
++ <com.gathin.tvhome.SkyView
++ android:id="@+id/sky"
++ android:layout_width="match_parent"
++ android:layout_height="match_parent"
++ android:importantForAccessibility="no" />
++
+ <!-- Ambient glow in the colour of the focused dock app. -->
+ <View
+ android:id="@+id/ambient"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:alpha="0" />
+
+ <!-- Top shelf: the focused dock app's name, positioned above the dock in code. -->
+ <TextView
+ android:id="@+id/heroName"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="68dp"
+ android:layout_gravity="right"
+ android:gravity="right"
+ android:alpha="0"
+ android:textColor="#FFFFFFFF"
+ android:textSize="48sp"
+ android:fontFamily="@font/outfit"
+ android:fontVariationSettings="'wght' 300"
+ android:letterSpacing="-0.02"
+ android:includeFontPadding="false"
+ android:singleLine="true" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingStart="56dp"
+ android:paddingEnd="56dp"
+ android:paddingTop="26dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <LinearLayout
+ android:id="@+id/leftBlock"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_toEndOf="@+id/topButtons"
+ android:layout_marginStart="16dp"
+ android:orientation="horizontal"
+ android:gravity="right|bottom">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:layout_marginBottom="9dp"
+ android:orientation="vertical">
+
+ <!-- Shamsi date ("27 Mehr 1405"), shown when shamsi_date is on. -->
+ <TextView
+ android:id="@+id/shamsiDate"
+ android:gravity="right"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textColor="#E6FFFFFF"
+ android:textSize="17sp"
+ android:fontFamily="@font/outfit"
+ android:fontVariationSettings="'wght' 400"
+ android:letterSpacing="0.02"
+ android:includeFontPadding="false"
+ android:visibility="gone" />
+
+ <TextClock
+ android:id="@+id/date"
+ android:gravity="right"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:format12Hour="@string/date_format"
+ android:format24Hour="@string/date_format"
+ android:textColor="#A6FFFFFF"
+ android:textSize="14sp"
+ android:fontFamily="@font/outfit"
+ android:fontVariationSettings="'wght' 400"
+ android:letterSpacing="0.14"
+ android:textAllCaps="true" />
+ </LinearLayout>
+
+ <View
+ android:layout_width="1dp"
+ android:layout_height="26dp"
+ android:layout_gravity="bottom"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="8dp"
+ android:background="#33FFFFFF" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+ <TextView
+ android:id="@+id/greeting"
+ android:gravity="center_horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textColor="#8CFFFFFF"
+ android:textSize="12sp"
+ android:fontFamily="@font/outfit"
+ android:fontVariationSettings="'wght' 500"
+ android:letterSpacing="0.22"
+ android:textAllCaps="true" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:baselineAligned="true">
+ <TextClock
+ android:id="@+id/clock"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:format12Hour="h:mm"
+ android:format24Hour="HH:mm"
+ android:textColor="#FFFFFFFF"
+ android:textSize="52sp"
+ android:fontFamily="@font/outfit"
+ android:fontVariationSettings="'wght' 300"
+ android:letterSpacing="-0.04"
+ android:includeFontPadding="false" />
+
+ <TextClock
+ android:id="@+id/ampm"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="6dp"
+ android:layout_gravity="bottom"
+ android:layout_marginBottom="8dp"
+ android:format12Hour="a"
+ android:format24Hour=""
+ android:textColor="#B3FFFFFF"
+ android:textSize="15sp"
+ android:fontFamily="@font/outfit"
+ android:fontVariationSettings="'wght' 500"
+ android:letterSpacing="0.08"
+ android:textAllCaps="true" />
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/topButtons"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_alignBottom="@id/leftBlock"
+ android:layout_marginBottom="6dp"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/btnSettings"
+ style="@style/TopButton"
+ android:text="@string/settings"
+ android:drawableStart="@drawable/ic_settings"
+ android:nextFocusDown="@+id/grid" />
+
+ <TextView
+ android:id="@+id/btnWifi"
+ style="@style/TopButton"
+ android:maxWidth="180dp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:text="@string/wifi"
+ android:drawableStart="@drawable/ic_wifi"
+ android:nextFocusDown="@+id/grid" />
+
+ <TextView
+ android:id="@+id/btnInputs"
+ style="@style/TopButton"
+ android:text="@string/inputs"
+ android:drawableStart="@drawable/ic_input"
+ android:nextFocusDown="@+id/grid" />
+ </LinearLayout>
+ </RelativeLayout>
+
+ <!-- The wrapper clips at the grid's edge; the grid itself must not clip so scaled tiles can overflow their cells. -->
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:layout_marginTop="10dp">
+
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/grid"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="10dp"
+ android:paddingBottom="40dp"
+ android:clipToPadding="false"
+ android:clipChildren="false"
+ android:overScrollMode="never"
+ android:scrollbars="none"
+ android:descendantFocusability="afterDescendants" />
+ </FrameLayout>
+ </LinearLayout>
+
+ <!-- The single floating glass highlight that springs between tiles. -->
+ <com.gathin.tvhome.GlassView
+ android:id="@+id/glass"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:alpha="0"
+ android:importantForAccessibility="no" />
+ </FrameLayout>
diff --cc launcher/app/src/main/res/xml/locales_config.xml
index 5977e516b,46d33c41e..d24fec663
--- a/launcher/app/src/main/res/xml/locales_config.xml
+++ b/launcher/app/src/main/res/xml/locales_config.xml
@@@ -14,6 -14,7 +14,8 @@@
<locale android:name="sr-Latn" />
<locale android:name="pl" />
<locale android:name="ar" />
+ <!-- Android uses the legacy iw qualifier for Hebrew resources. -->
+ <locale android:name="iw" />
<locale android:name="tr" />
+ <locale android:name="pt" />
</locale-config>