Merge "Fix big icon when dragging Toast by isolating the previous QL fix display to SEARCH_RESULT_APP_ROW" into udc-qpr-dev

This commit is contained in:
Brandon Dayauon authored and Android (Google) Code Review committed 2023-09-22 14:36:45 +00:00
commit 28ae77df37
5 files changed
+37 -9

No files matched your search

+11 -4
View File
@@ -99,8 +99,9 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
private static final int DISPLAY_FOLDER = 2;
protected static final int DISPLAY_TASKBAR = 5;
public static final int DISPLAY_SEARCH_RESULT = 6;
private static final int DISPLAY_SEARCH_RESULT_SMALL = 7;
public static final int DISPLAY_SEARCH_RESULT_SMALL = 7;
public static final int DISPLAY_PREDICTION_ROW = 8;
public static final int DISPLAY_SEARCH_RESULT_APP_ROW = 9;
private static final float MIN_LETTER_SPACING = -0.05f;
private static final int MAX_SEARCH_LOOP_COUNT = 20;
@@ -214,7 +215,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
setCompoundDrawablePadding(grid.iconDrawablePaddingPx);
defaultIconSize = grid.iconSizePx;
setCenterVertically(grid.iconCenterVertically);
} else if (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW) {
} else if (mDisplay == DISPLAY_ALL_APPS || mDisplay == DISPLAY_PREDICTION_ROW
|| mDisplay == DISPLAY_SEARCH_RESULT_APP_ROW) {
setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.allAppsIconTextSizePx);
setCompoundDrawablePadding(grid.allAppsIconDrawablePaddingPx);
defaultIconSize = grid.allAppsIconSizePx;
@@ -1104,8 +1106,13 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
}
public boolean isDisplaySearchResult() {
return mDisplay == DISPLAY_SEARCH_RESULT ||
mDisplay == DISPLAY_SEARCH_RESULT_SMALL;
return mDisplay == DISPLAY_SEARCH_RESULT
|| mDisplay == DISPLAY_SEARCH_RESULT_SMALL
|| mDisplay == DISPLAY_SEARCH_RESULT_APP_ROW;
}
public int getIconDisplay() {
return mDisplay;
}
@Override
@@ -16,6 +16,8 @@
package com.android.launcher3.graphics;
import static com.android.launcher3.BubbleTextView.DISPLAY_SEARCH_RESULT_APP_ROW;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@@ -100,7 +102,8 @@ public class DragPreviewProvider {
height = mView.getHeight();
}
if (mView instanceof BubbleTextView) {
if (mView instanceof BubbleTextView btv
&& btv.getIconDisplay() == DISPLAY_SEARCH_RESULT_APP_ROW) {
FastBitmapDrawable icon = ((BubbleTextView) mView).getIcon();
Drawable drawable = icon.getConstantState().newDrawable();
float xInset = (float) blurSizeOutline / (float) (width + blurSizeOutline);