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

Commit fb77b34d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Change wallpaper depth in widget picker" into tm-qpr-dev am: 3ded296c am: 9c43626a

parents b5cd064a 9c43626a
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -43,4 +43,9 @@
    <!-- Accessibility actions -->
    <!-- Accessibility actions -->
    <item type="id" name="action_move_to_top_or_left" />
    <item type="id" name="action_move_to_top_or_left" />
    <item type="id" name="action_move_to_bottom_or_right" />
    <item type="id" name="action_move_to_bottom_or_right" />

    <!-- The max scale for the wallpaper when it's zoomed in -->
    <item name="config_wallpaperMaxScale" format="float" type="dimen">
        @*android:dimen/config_wallpaperMaxScale
    </item>
</resources>
</resources>
+6 −5
Original line number Original line Diff line number Diff line
@@ -42,7 +42,7 @@ import static com.android.launcher3.config.FeatureFlags.ENABLE_SCRIM_FOR_APP_LAU
import static com.android.launcher3.config.FeatureFlags.KEYGUARD_ANIMATION;
import static com.android.launcher3.config.FeatureFlags.KEYGUARD_ANIMATION;
import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVITY;
import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVITY;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.statehandlers.DepthController.DEPTH;
import static com.android.launcher3.statehandlers.DepthController.STATE_DEPTH;
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION;
import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION;
import static com.android.launcher3.views.FloatingIconView.getFloatingIconView;
import static com.android.launcher3.views.FloatingIconView.getFloatingIconView;
@@ -385,7 +385,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
                @Override
                @Override
                public void onAnimationStart(Animator animation) {
                public void onAnimationStart(Animator animation) {
                    mLauncher.addOnResumeCallback(() ->
                    mLauncher.addOnResumeCallback(() ->
                            ObjectAnimator.ofFloat(mLauncher.getDepthController(), DEPTH,
                            ObjectAnimator.ofFloat(mLauncher.getDepthController(), STATE_DEPTH,
                                    mLauncher.getStateManager().getState().getDepth(
                                    mLauncher.getStateManager().getState().getDepth(
                                            mLauncher)).start());
                                            mLauncher)).start());
                }
                }
@@ -409,7 +409,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
            @Override
            @Override
            public void onAnimationStart(Animator animation) {
            public void onAnimationStart(Animator animation) {
                mLauncher.addOnResumeCallback(() ->
                mLauncher.addOnResumeCallback(() ->
                        ObjectAnimator.ofFloat(mLauncher.getDepthController(), DEPTH,
                        ObjectAnimator.ofFloat(mLauncher.getDepthController(), STATE_DEPTH,
                                mLauncher.getStateManager().getState().getDepth(
                                mLauncher.getStateManager().getState().getDepth(
                                        mLauncher)).start());
                                        mLauncher)).start());
            }
            }
@@ -1052,7 +1052,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
                && BlurUtils.supportsBlursOnWindows();
                && BlurUtils.supportsBlursOnWindows();


        MyDepthController depthController = new MyDepthController(mLauncher);
        MyDepthController depthController = new MyDepthController(mLauncher);
        ObjectAnimator backgroundRadiusAnim = ObjectAnimator.ofFloat(depthController, DEPTH,
        ObjectAnimator backgroundRadiusAnim = ObjectAnimator.ofFloat(depthController, STATE_DEPTH,
                        BACKGROUND_APP.getDepth(mLauncher))
                        BACKGROUND_APP.getDepth(mLauncher))
                .setDuration(APP_LAUNCH_DURATION);
                .setDuration(APP_LAUNCH_DURATION);


@@ -1601,7 +1601,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
                            true /* animateOverviewScrim */, launcherView).getAnimators());
                            true /* animateOverviewScrim */, launcherView).getAnimators());


                    if (!areAllTargetsTranslucent(appTargets)) {
                    if (!areAllTargetsTranslucent(appTargets)) {
                        anim.play(ObjectAnimator.ofFloat(mLauncher.getDepthController(), DEPTH,
                        anim.play(ObjectAnimator.ofFloat(mLauncher.getDepthController(),
                                STATE_DEPTH,
                                BACKGROUND_APP.getDepth(mLauncher), NORMAL.getDepth(mLauncher)));
                                BACKGROUND_APP.getDepth(mLauncher), NORMAL.getDepth(mLauncher)));
                    }
                    }


+3 −2
Original line number Original line Diff line number Diff line
@@ -165,7 +165,8 @@ public class DepthController extends BaseDepthController implements StateHandler


        float toDepth = toState.getDepth(mLauncher);
        float toDepth = toState.getDepth(mLauncher);
        if (Float.compare(mDepth, toDepth) != 0) {
        if (Float.compare(mDepth, toDepth) != 0) {
            animation.setFloat(this, DEPTH, toDepth, config.getInterpolator(ANIM_DEPTH, LINEAR));
            animation.setFloat(this, STATE_DEPTH, toDepth,
                    config.getInterpolator(ANIM_DEPTH, LINEAR));
        }
        }
    }
    }


@@ -179,7 +180,7 @@ public class DepthController extends BaseDepthController implements StateHandler
    public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
    public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
        mIgnoreStateChangesDuringMultiWindowAnimation = true;
        mIgnoreStateChangesDuringMultiWindowAnimation = true;


        ObjectAnimator mwAnimation = ObjectAnimator.ofFloat(this, DEPTH,
        ObjectAnimator mwAnimation = ObjectAnimator.ofFloat(this, STATE_DEPTH,
                mLauncher.getStateManager().getState().getDepth(mLauncher, isInMultiWindowMode))
                mLauncher.getStateManager().getState().getDepth(mLauncher, isInMultiWindowMode))
                .setDuration(300);
                .setDuration(300);
        mwAnimation.addListener(new AnimatorListenerAdapter() {
        mwAnimation.addListener(new AnimatorListenerAdapter() {
+9 −0
Original line number Original line Diff line number Diff line
@@ -27,9 +27,11 @@ import static com.android.launcher3.LauncherState.NO_OFFSET;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.anim.Interpolators.EMPHASIZED;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE;
import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE;
import static com.android.launcher3.config.FeatureFlags.ENABLE_WIDGET_PICKER_DEPTH;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition;
import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition;
@@ -44,6 +46,7 @@ import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR;
import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.util.BaseDepthController.WIDGET_DEPTH;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;


import android.animation.AnimatorSet;
import android.animation.AnimatorSet;
@@ -75,6 +78,7 @@ import com.android.launcher3.LauncherState;
import com.android.launcher3.QuickstepAccessibilityDelegate;
import com.android.launcher3.QuickstepAccessibilityDelegate;
import com.android.launcher3.QuickstepTransitionManager;
import com.android.launcher3.QuickstepTransitionManager;
import com.android.launcher3.R;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.Workspace;
import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.AnimatorPlaybackController;
@@ -583,6 +587,11 @@ public class QuickstepLauncher extends Launcher {
    public void onWidgetsTransition(float progress) {
    public void onWidgetsTransition(float progress) {
        super.onWidgetsTransition(progress);
        super.onWidgetsTransition(progress);
        onTaskbarInAppDisplayProgressUpdate(progress, WIDGETS_PAGE_PROGRESS_INDEX);
        onTaskbarInAppDisplayProgressUpdate(progress, WIDGETS_PAGE_PROGRESS_INDEX);
        if (ENABLE_WIDGET_PICKER_DEPTH.get() && !Utilities.IS_RUNNING_IN_TEST_HARNESS) {
            WIDGET_DEPTH.set(getDepthController(),
                    Utilities.mapToRange(progress, 0f, 1f, 0f, getDeviceProfile().bottomSheetDepth,
                            EMPHASIZED));
        }
    }
    }


    private void onTaskbarInAppDisplayProgressUpdate(float progress, int flag) {
    private void onTaskbarInAppDisplayProgressUpdate(float progress, int flag) {
+4 −14
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@
package com.android.launcher3.uioverrides.states;
package com.android.launcher3.uioverrides.states;


import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAPPS;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAPPS;


import android.content.Context;
import android.content.Context;
@@ -26,7 +25,6 @@ import com.android.launcher3.DeviceProfile.DeviceProfileListenable;
import com.android.launcher3.Launcher;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.Themes;
import com.android.launcher3.util.Themes;


/**
/**
@@ -44,9 +42,9 @@ public class AllAppsState extends LauncherState {
    @Override
    @Override
    public <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfileListenable>
    public <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfileListenable>
    int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState) {
    int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState) {
        return context.getDeviceProfile().isTablet
        return isToState
                ? 500
                ? context.getDeviceProfile().allAppsOpenDuration
                :  isToState ? 600 : 300;
                : context.getDeviceProfile().allAppsCloseDuration;
    }
    }


    @Override
    @Override
@@ -83,15 +81,7 @@ public class AllAppsState extends LauncherState {
    protected <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfile.DeviceProfileListenable>
    protected <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfile.DeviceProfileListenable>
            float getDepthUnchecked(DEVICE_PROFILE_CONTEXT context) {
            float getDepthUnchecked(DEVICE_PROFILE_CONTEXT context) {
        if (context.getDeviceProfile().isTablet) {
        if (context.getDeviceProfile().isTablet) {
            // The goal is to set wallpaper to zoom at workspaceContentScale when in AllApps.
            return context.getDeviceProfile().bottomSheetDepth;
            // When depth is 0, wallpaper zoom is set to maxWallpaperScale.
            // When depth is 1, wallpaper zoom is set to 1.
            // For depth to achieve zoom set to maxWallpaperScale * workspaceContentScale:
            float maxWallpaperScale = context.getResources().getFloat(
                    com.android.internal.R.dimen.config_wallpaperMaxScale);
            return Utilities.mapToRange(
                    maxWallpaperScale * context.getDeviceProfile().workspaceContentScale,
                    maxWallpaperScale, 1f, 0f, 1f, LINEAR);
        } else {
        } else {
            // The scrim fades in at approximately 50% of the swipe gesture.
            // The scrim fades in at approximately 50% of the swipe gesture.
            // This means that the depth should be greater than 1, in order to fully zoom out.
            // This means that the depth should be greater than 1, in order to fully zoom out.
Loading