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

Commit b3ea58d5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Separate 2-button mode check from ENABLE_OVERVIEW_ACTIONS" into ub-launcher3-master

parents d880f0bc 04fca164
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ACTIONS;
import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
import static com.android.launcher3.states.RotationHelper.REQUEST_ROTATE;
import static com.android.quickstep.SysUINavigationMode.Mode.NO_BUTTON;
import static com.android.quickstep.SysUINavigationMode.removeShelfFromOverview;

import android.graphics.Rect;
import android.view.View;
@@ -125,7 +126,8 @@ public class OverviewState extends LauncherState {

    @Override
    public ScaleAndTranslation getQsbScaleAndTranslation(Launcher launcher) {
        if (this == OVERVIEW && ENABLE_OVERVIEW_ACTIONS.get()) {
        if (this == OVERVIEW && ENABLE_OVERVIEW_ACTIONS.get()
                && removeShelfFromOverview(launcher)) {
            // Treat the QSB as part of the hotseat so they move together.
            return getHotseatScaleAndTranslation(launcher);
        }
@@ -158,7 +160,7 @@ public class OverviewState extends LauncherState {
        if (launcher.getDeviceProfile().isVerticalBarLayout()) {
            return VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON;
        } else {
            if (ENABLE_OVERVIEW_ACTIONS.get()) {
            if (ENABLE_OVERVIEW_ACTIONS.get() && removeShelfFromOverview(launcher)) {
                return VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON;
            }

@@ -229,6 +231,7 @@ public class OverviewState extends LauncherState {
            builder.setInterpolator(ANIM_WORKSPACE_FADE, OVERSHOOT_1_2);
            builder.setInterpolator(ANIM_OVERVIEW_SCALE, OVERSHOOT_1_2);
            Interpolator translationInterpolator = ENABLE_OVERVIEW_ACTIONS.get()
                    && removeShelfFromOverview(launcher)
                    ? OVERSHOOT_1_2
                    : OVERSHOOT_1_7;
            builder.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, translationInterpolator);
+1 −1
Original line number Diff line number Diff line
@@ -346,7 +346,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
        setLayoutDirection(mIsRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR);
        mTaskTopMargin = getResources()
                .getDimensionPixelSize(R.dimen.task_thumbnail_top_margin);
        mTaskBottomMargin = LayoutUtils.thumbnailBottomMargin(getResources());
        mTaskBottomMargin = LayoutUtils.thumbnailBottomMargin(context);
        mSquaredTouchSlop = squaredTouchSlop(context);

        mEmptyIcon = context.getDrawable(R.drawable.ic_empty_recents);
+9 −7
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static com.android.launcher3.QuickstepAppTransitionManagerImpl.RECENTS_LA
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.quickstep.SysUINavigationMode.removeShelfFromOverview;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -30,7 +31,6 @@ import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Outline;
import android.graphics.Rect;
import android.graphics.RectF;
@@ -221,7 +221,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
        mCurrentFullscreenParams = new FullscreenDrawParams(mCornerRadius);
        mDigitalWellBeingToast = new DigitalWellBeingToast(mActivity, this);

        mOutlineProvider = new TaskOutlineProvider(getResources(), mCurrentFullscreenParams);
        mOutlineProvider = new TaskOutlineProvider(getContext(), mCurrentFullscreenParams);
        setOutlineProvider(mOutlineProvider);
    }

@@ -230,13 +230,14 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
        super.onFinishInflate();
        mSnapshotView = findViewById(R.id.snapshot);
        mIconView = findViewById(R.id.icon);
        final Context context = getContext();

        TaskView.LayoutParams thumbnailParams = (LayoutParams) mSnapshotView.getLayoutParams();
        thumbnailParams.bottomMargin = LayoutUtils.thumbnailBottomMargin(getResources());
        thumbnailParams.bottomMargin = LayoutUtils.thumbnailBottomMargin(context);
        mSnapshotView.setLayoutParams(thumbnailParams);


        if (FeatureFlags.ENABLE_OVERVIEW_ACTIONS.get()) {
        if (FeatureFlags.ENABLE_OVERVIEW_ACTIONS.get() && removeShelfFromOverview(context)) {
            mActionsView = mSnapshotView.getTaskOverlay().getActionsView();
            if (mActionsView != null) {
                TaskView.LayoutParams params = new TaskView.LayoutParams(LayoutParams.MATCH_PARENT,
@@ -679,9 +680,10 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
        private final int mMarginBottom;
        private FullscreenDrawParams mFullscreenParams;

        TaskOutlineProvider(Resources res, FullscreenDrawParams fullscreenParams) {
            mMarginTop = res.getDimensionPixelSize(R.dimen.task_thumbnail_top_margin);
            mMarginBottom = LayoutUtils.thumbnailBottomMargin(res);
        TaskOutlineProvider(Context context, FullscreenDrawParams fullscreenParams) {
            mMarginTop = context.getResources().getDimensionPixelSize(
                    R.dimen.task_thumbnail_top_margin);
            mMarginBottom = LayoutUtils.thumbnailBottomMargin(context);
            mFullscreenParams = fullscreenParams;
        }

+12 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import static com.android.launcher3.allapps.DiscoveryBounce.HOME_BOUNCE_COUNT;
import static com.android.launcher3.allapps.DiscoveryBounce.HOME_BOUNCE_SEEN;
import static com.android.launcher3.allapps.DiscoveryBounce.SHELF_BOUNCE_COUNT;
import static com.android.launcher3.allapps.DiscoveryBounce.SHELF_BOUNCE_SEEN;
import static com.android.quickstep.SysUINavigationMode.removeShelfFromOverview;

import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
@@ -35,6 +36,7 @@ import android.os.CancellationSignal;

import com.android.launcher3.LauncherState.ScaleAndTranslation;
import com.android.launcher3.LauncherStateManager.StateHandler;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.WellbeingModel;
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.proxy.ProxyActivityStarter;
@@ -186,6 +188,16 @@ public abstract class BaseQuickstepLauncher extends Launcher
        }
    }

    @Override
    protected void setupViews() {
        super.setupViews();

        if (FeatureFlags.ENABLE_OVERVIEW_ACTIONS.get() && removeShelfFromOverview(this)) {
            // Overview is above all other launcher elements, including qsb, so move it to the top.
            getOverviewPanel().bringToFront();
        }
    }

    @Override
    protected StateHandler[] createStateHandlers() {
        return new StateHandler[] {
+2 −23
Original line number Diff line number Diff line
@@ -15,11 +15,6 @@
 */
package com.android.quickstep;

import static android.content.Context.MODE_PRIVATE;

import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ACTIONS;
import static com.android.launcher3.config.FeatureFlags.FLAGS_PREF_NAME;

import android.content.Context;
import android.content.pm.PackageManager;
import android.os.UserManager;
@@ -27,7 +22,6 @@ import android.util.Log;

import com.android.launcher3.BuildConfig;
import com.android.launcher3.MainProcessInitializer;
import com.android.launcher3.config.FeatureFlags;
import com.android.systemui.shared.system.ThreadedRendererCompat;

@SuppressWarnings("unused")
@@ -55,22 +49,7 @@ public class QuickstepProcessInitializer extends MainProcessInitializer {
        super.init(context);

        // Elevate GPU priority for Quickstep and Remote animations.
        ThreadedRendererCompat.setContextPriority(ThreadedRendererCompat.EGL_CONTEXT_PRIORITY_HIGH_IMG);

        // Force disable some feature flags based on the system ui navigation mode.
        SysUINavigationMode.Mode currMode = SysUINavigationMode.INSTANCE.get(context)
                .addModeChangeListener(mode -> disableFeatureFlagsForSysuiNavMode(context, mode));
        disableFeatureFlagsForSysuiNavMode(context, currMode);
    }

    private void disableFeatureFlagsForSysuiNavMode(Context ctx, SysUINavigationMode.Mode mode) {
        if (mode == SysUINavigationMode.Mode.TWO_BUTTONS) {
            ctx.getSharedPreferences(FLAGS_PREF_NAME, MODE_PRIVATE)
                    .edit()
                    .putBoolean(ENABLE_OVERVIEW_ACTIONS.key, false)
                    .apply();

            FeatureFlags.initialize(ctx);
        }
        ThreadedRendererCompat.setContextPriority(
                ThreadedRendererCompat.EGL_CONTEXT_PRIORITY_HIGH_IMG);
    }
}
Loading