diff --git a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java index 4f889c05bc..f82474a8e8 100644 --- a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +++ b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java @@ -16,8 +16,6 @@ package com.android.launcher3.appprediction; -import static com.android.launcher3.BubbleTextView.DISPLAY_PREDICTION_ROW; - import android.annotation.TargetApi; import android.content.Context; import android.graphics.Canvas; @@ -189,7 +187,7 @@ public class PredictionRowView LayoutInflater inflater = mActivityContext.getAppsView().getLayoutInflater(); while (getChildCount() < mNumPredictedAppsPerRow) { BubbleTextView icon = (BubbleTextView) inflater.inflate( - R.layout.all_apps_icon, this, false); + R.layout.all_apps_prediction_row_icon, this, false); icon.setOnClickListener(mActivityContext.getItemOnClickListener()); icon.setOnLongClickListener(mActivityContext.getAllAppsItemLongClickListener()); icon.setLongPressTimeoutFactor(1f); @@ -211,7 +209,6 @@ public class PredictionRowView icon.reset(); if (predictionCount > i) { icon.setVisibility(View.VISIBLE); - icon.setDisplay(DISPLAY_PREDICTION_ROW); icon.applyFromWorkspaceItem(mPredictedApps.get(i)); } else { icon.setVisibility(predictionCount == 0 ? GONE : INVISIBLE); diff --git a/res/layout/all_apps_prediction_row_icon.xml b/res/layout/all_apps_prediction_row_icon.xml new file mode 100644 index 0000000000..c9b327542b --- /dev/null +++ b/res/layout/all_apps_prediction_row_icon.xml @@ -0,0 +1,20 @@ + + diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 05eaf88ffb..f046eca3dc 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -86,6 +86,7 @@ + diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index abf84ddcb5..a539148a29 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -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 diff --git a/src/com/android/launcher3/graphics/DragPreviewProvider.java b/src/com/android/launcher3/graphics/DragPreviewProvider.java index b51373cb82..42083431e1 100644 --- a/src/com/android/launcher3/graphics/DragPreviewProvider.java +++ b/src/com/android/launcher3/graphics/DragPreviewProvider.java @@ -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);