From 6c345f4d4c7cf78d2a1760994bc4c12fc1e99499 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Tue, 3 Oct 2023 16:38:42 -0700 Subject: [PATCH] Fix text jumping from one line -> two line when scrolling The issue this happens is because the paint letter spacing can change during checkForEllipsis() so during vertical calculation for two line, set the paint letter spacing to the MIN_LETTER_SPACING that is used in checkForELlipsis() bug: 303319642 Test: After: https://drive.google.com/file/d/14YfmEWNpmllSAdLeUamUpewa8ljbqXAU/view?usp=sharing before: https://drive.google.com/file/d/14Y_I-iuyOGHCr809AlqNL8o1IdFjk3_8/view?usp=sharing Flag: disabled Change-Id: I1f56a9e9d22ab45b0491e5fa65b5bfc5b10fc720 --- src/com/android/launcher3/BubbleTextView.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index ab9836f59e..8b16a5d812 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -814,6 +814,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, float currentWordWidth, runningWidth = 0; CharSequence currentWord; StringBuilder newString = new StringBuilder(); + // TODO: Remove when ENABLE_ICON_LABEL_AUTO_SCALING feature flag is being cleaned up. + paint.setLetterSpacing(MIN_LETTER_SPACING); int stringPtr = 0; for (int i = 0; i < breakPoints.size()+1; i++) { if (i < breakPoints.size()) {