Skip to content

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

launcher: clean tile labels like card labels; Home on Home returns to the top

Gathin2305b2114362ab
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java b/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java
index 69296c68f..b795d034e 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java
@@ -155,7 +155,9 @@ public class AppAdapter extends RecyclerView.Adapter<AppAdapter.Holder> {
if (card != null) {
fresh.add(new Entry(Entry.CARD, card.label, component, banner, icon, card.caption, card.accent));
} else {
- fresh.add(new Entry(String.valueOf(ri.loadLabel(pm)), component, banner, icon));
+ // Same cleaner as the card prompt: an app label with a bidi override or line separator must not
+ // redraw the tile name as something else (#117).
+ fresh.add(new Entry(Cards.cleanLabel(String.valueOf(ri.loadLabel(pm)), pkg), component, banner, icon));
}
}
Collections.sort(fresh, (a, b) -> {
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 ce963807d..499018535 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@ -362,6 +362,20 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {
}
}
+ /**
+ * Home pressed while Home is already in front: singleTask delivers it here, then onResume runs.
+ * Back to the top with the first dock tile focused, like the stock launcher. Back from an app
+ * never comes this way, so returning to the app you left from is unchanged (#118).
+ */
+ @Override
+ protected void onNewIntent(Intent intent) {
+ super.onNewIntent(intent);
+ if (intent == null || !intent.hasCategory(Intent.CATEGORY_HOME)) return;
+ grid.scrollToPosition(0);
+ lastFocused = 0;
+ lastFocusedKey = adapter.getItemCount() > 0 ? adapter.keyAt(0) : null;
+ }
+
@Override
protected void onResume() {
super.onResume();