Hide both drop target icons if either text goes to two lines. am: e3d74b496e

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18795367

Change-Id: I1afb43206e6af6855602b4d0bc992fadcd73a0c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Pat Manning
2022-06-08 17:56:43 +00:00
committed by Automerger Merge Worker
+4 -1
View File
@@ -194,9 +194,10 @@ public class DropTargetBar extends FrameLayout
int widthSpec = MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST);
firstButton.measure(widthSpec, heightSpec);
if (!mIsVertical) {
// Remove icons and put the button's text on two lines if text is truncated.
// Remove both icons and put the button's text on two lines if text is truncated.
if (firstButton.isTextTruncated(availableWidth)) {
firstButton.setIconVisible(false);
secondButton.setIconVisible(false);
firstButton.setTextMultiLine(true);
firstButton.setPadding(horizontalPadding, verticalPadding / 2,
horizontalPadding, verticalPadding / 2);
@@ -209,8 +210,10 @@ public class DropTargetBar extends FrameLayout
}
secondButton.measure(widthSpec, heightSpec);
if (!mIsVertical) {
// Remove both icons and put the button's text on two lines if text is truncated.
if (secondButton.isTextTruncated(availableWidth)) {
secondButton.setIconVisible(false);
firstButton.setIconVisible(false);
secondButton.setTextMultiLine(true);
secondButton.setPadding(horizontalPadding, verticalPadding / 2,
horizontalPadding, verticalPadding / 2);