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

Commit e9bd3643 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias Committed by Android (Google) Code Review
Browse files

Merge "Generalize the icon popup menu types." into sc-v2-dev

parents 3c647ff3 16e04e29
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.FolderInfo;
@@ -298,7 +299,7 @@ public class HotseatEduController {
            Log.e(TAG, "Unable to find suitable view for ArrowTip");
            return false;
        }
        Rect bounds = mLauncher.getViewBounds(tipTargetView);
        Rect bounds = Utilities.getViewBounds(tipTargetView);
        new ArrowTipView(mLauncher).show(message, Gravity.END, bounds.centerX(), bounds.top);
        return true;
    }
+1 −1
Original line number Diff line number Diff line
@@ -377,7 +377,7 @@ public final class WellbeingModel extends BgObjectWithLooper {
    /**
     * Shortcut factory for generating wellbeing action
     */
    public static final SystemShortcut.Factory SHORTCUT_FACTORY =
    public static final SystemShortcut.Factory<BaseDraggingActivity> SHORTCUT_FACTORY =
            (activity, info) -> (info.getTargetComponent() == null) ? null : INSTANCE.get(activity)
                    .getShortcutForApp(
                            info.getTargetComponent().getPackageName(), info.user.getIdentifier(),
+2 −2
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ public interface TaskShortcutFactory {
        }
    }

    class MultiWindowSystemShortcut extends SystemShortcut {
    class MultiWindowSystemShortcut extends SystemShortcut<BaseDraggingActivity> {

        private Handler mHandler;

@@ -305,7 +305,7 @@ public interface TaskShortcutFactory {
        return new PinSystemShortcut(activity, taskContainer);
    };

    class PinSystemShortcut extends SystemShortcut {
    class PinSystemShortcut extends SystemShortcut<BaseDraggingActivity> {

        private static final String TAG = "PinSystemShortcut";

+3 −9
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import android.util.Log;
import android.view.ActionMode;
import android.view.Display;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowInsets.Type;
import android.view.WindowMetrics;
import android.widget.Toast;
@@ -166,12 +165,6 @@ public abstract class BaseDraggingActivity extends BaseActivity
        // no-op
    }

    public Rect getViewBounds(View v) {
        int[] pos = new int[2];
        v.getLocationOnScreen(pos);
        return new Rect(pos[0], pos[1], pos[0] + v.getWidth(), pos[1] + v.getHeight());
    }

    @NonNull
    public ActivityOptionsWrapper getActivityLaunchOptions(View v, @Nullable ItemInfo item) {
        int left = 0, top = 0;
@@ -206,7 +199,7 @@ public abstract class BaseDraggingActivity extends BaseActivity
        // Prepare intent
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        if (v != null) {
            intent.setSourceBounds(getViewBounds(v));
            intent.setSourceBounds(Utilities.getViewBounds(v));
        }
        try {
            boolean isShortcut = (item instanceof WorkspaceItemInfo)
@@ -316,7 +309,8 @@ public abstract class BaseDraggingActivity extends BaseActivity
        }
    }

    public OnClickListener getItemOnClickListener() {
    @Override
    public View.OnClickListener getItemOnClickListener() {
        return ItemClickHandler.INSTANCE;
    }

+7 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ import android.view.ViewConfiguration;
import android.view.animation.Interpolator;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;
import androidx.core.graphics.ColorUtils;
import androidx.core.os.BuildCompat;

@@ -846,6 +847,12 @@ public final class Utilities {
        view.setLayoutParams(lp);
    }

    public static Rect getViewBounds(@NonNull View v) {
        int[] pos = new int[2];
        v.getLocationOnScreen(pos);
        return new Rect(pos[0], pos[1], pos[0] + v.getWidth(), pos[1] + v.getHeight());
    }

    private static class FixedSizeEmptyDrawable extends ColorDrawable {

        private final int mSize;
Loading