Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e24505d authored by Brandon Dayauon's avatar Brandon Dayauon Committed by Automerger Merge Worker
Browse files

Merge "Fix big icon when dragging Toast by isolating the previous QL fix...

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

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



Change-Id: I4e955f635773b5084b315282d373b16cff6988e3
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 605db4b7 f9a203c5
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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<T extends Context & ActivityContext>
            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<T extends Context & ActivityContext>
            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);
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2023 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<com.android.launcher3.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:launcher="http://schemas.android.com/apk/res-auto"
    style="@style/BaseIcon.AllApps"
    android:id="@+id/icon"
    launcher:iconDisplay="prediction_row"
    launcher:centerVertically="true" />
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@
            <enum name="search_result_tall" value="6" />
            <enum name="search_result_small" value="7" />
            <enum name="prediction_row" value="8" />
            <enum name="search_result_app_row" value="9" />
        </attr>
        <attr name="centerVertically" format="boolean" />
    </declare-styleable>
+11 −4
Original line number Diff line number Diff line
@@ -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;
@@ -1105,8 +1107,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
+4 −1
Original line number Diff line number Diff line
@@ -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);