Merge "Icon should not disappear on drag and drop" into tm-qpr-dev am: 7eae6a4ce1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22255567
Change-Id: Ied5d3740325666cc74f407fd0c9d8821bfa8be8e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 8e1c279..53d9281 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -268,8 +268,10 @@
mDotParams.scale = 0f;
mForceHideDot = false;
setBackground(null);
- setSingleLine(true);
- setMaxLines(1);
+ if (FeatureFlags.ENABLE_TWOLINE_ALLAPPS.get()
+ || FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get()) {
+ setMaxLines(1);
+ }
setTag(null);
if (mIconLoadRequest != null) {
diff --git a/tests/src/com/android/launcher3/ui/BubbleTextViewTest.java b/tests/src/com/android/launcher3/ui/BubbleTextViewTest.java
index d07c6c2..fdba4eb 100644
--- a/tests/src/com/android/launcher3/ui/BubbleTextViewTest.java
+++ b/tests/src/com/android/launcher3/ui/BubbleTextViewTest.java
@@ -21,6 +21,7 @@
import static com.android.launcher3.config.FeatureFlags.ENABLE_TWOLINE_ALLAPPS;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
import android.content.Context;
import android.graphics.Typeface;
@@ -79,7 +80,6 @@
mBubbleTextView = new BubbleTextView(mContext);
mBubbleTextView.reset();
mBubbleTextView.setDisplayAllApps();
- assertEquals(ONE_LINE, mBubbleTextView.getMaxLines());
BubbleTextView testView = new BubbleTextView(mContext);
testView.setTypeface(Typeface.MONOSPACE);
@@ -108,7 +108,7 @@
mBubbleTextView.setTypeface(Typeface.MONOSPACE);
mBubbleTextView.measure(mLimitedWidth, 0);
mBubbleTextView.onPreDraw();
- assertEquals(ONE_LINE, mBubbleTextView.getMaxLines());
+ assertNotEquals(TWO_LINE, mBubbleTextView.getMaxLines());
} catch (Exception e) {
throw new RuntimeException(e);
}