Skip to content

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

Launcher: let Right from Settings reach Wi-Fi in Hebrew

Yosi-Brown42fde8056ee2
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 4e3b8bd06..870ca5168 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@ -2546,8 +2546,13 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
/** The first top-bar button after Inputs that is shown, in bar order (top_bar_apps, the network pill, ...); Settings is always there. */
private View firstTopButton() {
ViewGroup bar = findViewById(R.id.topButtons);
- for (int i = 0; i < bar.getChildCount(); i++) {
- View button = bar.getChildAt(i);
+ // The Hebrew layout (layout-iw) lists the bar mirrored, Settings first and Inputs last, so bar order
+ // runs from the end there. Walking it forwards returned Settings, and the pill key guard then treated
+ // Settings as both ends of the bar: Right from Settings was swallowed and never reached Wi-Fi.
+ boolean rtl = getResources().getBoolean(R.bool.rtl_menu_bar);
+ int n = bar.getChildCount();
+ for (int k = 0; k < n; k++) {
+ View button = bar.getChildAt(rtl ? n - 1 - k : k);
if (button != btnInputs && button.getVisibility() == View.VISIBLE) return button;
}
return findViewById(R.id.btnSettings);