Skip to content

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

Merge PR #2330: Launcher: date_below_clock re-measures the date when the day's name gets longer

Gathin23fd9ea512ff7d
diff --cc launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index b380d3c0a,ad2f28dea..f453692e7
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@@ -2382,6 -2318,14 +2382,17 @@@ public class MainActivity extends Activ
((LinearLayout.LayoutParams) clockRow.getLayoutParams()).gravity = Gravity.RIGHT;
}
clockColumn.addView(column, clockColumn.indexOfChild(clockRow) + 1, lp);
+ // The column now wraps its texts, so they must wrap too: a match_parent TextView does not ask for a new
+ // layout when its text gets longer, and the column kept the width of the day before ("TUESDAY 27 OCTOB…").
+ ViewGroup texts = (ViewGroup) column;
+ for (int i = 0; i < texts.getChildCount(); i++) {
+ View text = texts.getChildAt(i);
- text.getLayoutParams().width = ViewGroup.LayoutParams.WRAP_CONTENT;
- text.setLayoutParams(text.getLayoutParams());
++ LinearLayout.LayoutParams textLp = (LinearLayout.LayoutParams) text.getLayoutParams();
++ textLp.width = ViewGroup.LayoutParams.WRAP_CONTENT;
++ // Keep each line where its own gravity put it (right in Hebrew) now that it no longer fills the column.
++ textLp.gravity = ((TextView) text).getGravity() & Gravity.HORIZONTAL_GRAVITY_MASK;
++ text.setLayoutParams(textLp);
+ }
}
/** The first top-bar button after Inputs that is shown, in bar order (top_bar_apps, the network pill, ...); Settings is always there. */