diff options
author | Brandon Dayauon <brdayauon@google.com> | 2023-12-13 19:20:35 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-12-13 19:20:35 +0000 |
commit | 65eecc9352a3de83bac154602c2f213c70fa3bb2 (patch) | |
tree | b6238999fa5ad8d9ff31c74b6ac31bf068c2987d | |
parent | f2643521ecb5b7839f1c6984a13b08f2968a624a (diff) | |
parent | 812664df2ee05d99ba1975b7ae5cf1d56ce7c1f4 (diff) | |
download | Launcher3-65eecc9352a3de83bac154602c2f213c70fa3bb2.tar.gz |
Merge "Make two line text support only for ENGLISH locale" into main
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index e2e528c968..91da7e6404 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -175,6 +175,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, @ViewDebug.ExportedProperty(category = "launcher") private DotInfo mDotInfo; private DotRenderer mDotRenderer; + private Locale mCurrentLocale; @ViewDebug.ExportedProperty(category = "launcher", deepExport = true) protected DotRenderer.DrawParams mDotParams; private Animator mDotScaleAnim; @@ -250,6 +251,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, mDotParams = new DotRenderer.DrawParams(); + mCurrentLocale = context.getResources().getConfiguration().locale; setEllipsize(TruncateAt.END); setAccessibilityDelegate(mActivity.getAccessibilityDelegate()); setTextAlpha(1f); @@ -411,10 +413,12 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, * Only if actual text can be displayed in two line, the {@code true} value will be effective. */ protected boolean shouldUseTwoLine() { - return ((FeatureFlags.enableTwolineAllapps()) - && (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW)) - || (FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get() - && mDisplay == DISPLAY_SEARCH_RESULT); + return (FeatureFlags.enableTwolineAllapps() && isCurrentLanguageEnglish()) + && (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW); + } + + protected boolean isCurrentLanguageEnglish() { + return mCurrentLocale.equals(Locale.US); } @UiThread |