From e3d74b496e328e7ecc4cbd26a84fb480147c78ee Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Wed, 8 Jun 2022 13:15:13 +0100 Subject: [PATCH] Hide both drop target icons if either text goes to two lines. Fix: 235088140 Test: manual Change-Id: I582b8b771d859402b932193251690e5a4ffecbae --- src/com/android/launcher3/DropTargetBar.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/DropTargetBar.java b/src/com/android/launcher3/DropTargetBar.java index d908440bc8..c1304d413c 100644 --- a/src/com/android/launcher3/DropTargetBar.java +++ b/src/com/android/launcher3/DropTargetBar.java @@ -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);