Skip to content

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

Launcher: consume OK on the grid while reordering

SaviorOneZero6cf85bdb226e
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 28a35f331..62815a53b 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@ -746,9 +746,11 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
return true;
}
int pos = focusedTilePosition();
- if (ok && pos >= 0) {
- if (!down) pickUp(pos);
- return true; // never opens the app while reordering
+ if (ok && grid.hasFocus()) {
+ // RecyclerView can briefly report NO_POSITION during a move or rebind. Still consume
+ // OK on the grid: falling through would let the focused card open its app in reorder mode.
+ if (!down && pos >= 0) pickUp(pos);
+ return true;
}
return super.dispatchKeyEvent(event); // arrows navigate; OK on a top-bar pill works as usual
}