Skip to content

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

Launcher: a focused dock tile grows in place with advanced_effects, without the lift that set it off-centre in the band (#2135)

Gathin2357bfe29c5a01
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 41825a1af..5e2ab51c0 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java
@@ -476,11 +476,12 @@ public class AppAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
// In a single row every tile is the dock's kind: the big title above names it.
boolean dockKind = dockRow && (singleRow || position < dockSize);
h.name.setVisibility(dockKind && restNameAlpha == 0f ? View.INVISIBLE : View.VISIBLE);
+ h.inDock = dockKind;
boolean focused = h.card.isFocused(); // a rebind after reload() can hit the focused tile
h.name.setAlpha(focused ? 1f : restNameAlpha);
h.card.setScaleX(focused && animations ? focusScale() : 1f);
h.card.setScaleY(focused && animations ? focusScale() : 1f);
- h.card.setTranslationY(focused && advancedEffects ? -4f * ctx.getResources().getDisplayMetrics().density : 0f);
+ h.card.setTranslationY(focused && advancedEffects && !dockKind ? -4f * ctx.getResources().getDisplayMetrics().density : 0f);
h.card.setTranslationZ(focused && advancedEffects ? 8f * ctx.getResources().getDisplayMetrics().density : 0f);
h.banner.setScaleX(focused && advancedEffects ? 1.035f : 1f);
h.banner.setScaleY(focused && advancedEffects ? 1.035f : 1f);
@@ -887,6 +888,8 @@ public class AppAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
/** Alpha of the name while the tile is not focused (always_show_names). */
final float restNameAlpha;
final boolean overshoot;
+ /** A dock tile: it grows in place without advanced_effects' lift, which reads as off-centre in the band (#2135). */
+ boolean inDock;
Holder(View v, TileListener listener, boolean animations, boolean advancedEffects,
boolean reducedMotion, float restNameAlpha, boolean overshoot) {
@@ -940,7 +943,7 @@ public class AppAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
// A short zoom with no hardware layer: building a layer for so short an animation costs more
// frames than it saves. The name just appears instead of fading.
view.animate().scaleX(s).scaleY(s)
- .translationY(focused && advancedEffects ? -4f * density : 0f)
+ .translationY(focused && advancedEffects && !inDock ? -4f * density : 0f)
.translationZ(focused && advancedEffects ? 8f * density : 0f)
.setDuration(focused ? Motion.REDUCED_MS : 60)
.setInterpolator(new DecelerateInterpolator())
@@ -952,7 +955,7 @@ public class AppAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
if (focused) name.setTranslationY(density * 4f);
} else {
view.animate().scaleX(s).scaleY(s)
- .translationY(focused && advancedEffects ? -4f * density : 0f)
+ .translationY(focused && advancedEffects && !inDock ? -4f * density : 0f)
.translationZ(focused && advancedEffects ? 8f * density : 0f)
.setDuration(advancedEffects ? (focused ? 220 : 170) : (focused ? 260 : 180))
.setInterpolator(focused && !overshoot ? new DecelerateInterpolator(1.5f)