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

Commit 8699bf56 authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

Merge "Re-enable home screen rotation" into ub-launcher3-rvc-dev

parents 3e54ddc0 326d93bd
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
import android.annotation.TargetApi;
import android.os.Build;
import android.util.FloatProperty;
import android.view.Surface;
import android.view.View;
import android.view.animation.Interpolator;

@@ -91,8 +92,9 @@ public final class RecentsViewStateController extends
                buttonAlpha, LINEAR);

        View actionsView = mLauncher.getActionsView();
        if (actionsView != null) {
            propertySetter.setFloat(actionsView, VIEW_ALPHA, buttonAlpha, actionInterpolator);
        int launcherRotation = mRecentsView.getPagedViewOrientedState().getLauncherRotation();
        if (actionsView != null && launcherRotation == Surface.ROTATION_0) {
            propertySetter.setViewAlpha(actionsView, buttonAlpha, actionInterpolator);
        }
    }

+0 −1
Original line number Diff line number Diff line
@@ -144,7 +144,6 @@ public class OverviewState extends LauncherState {

    @Override
    public void onStateTransitionEnd(Launcher launcher) {
        launcher.getRotationHelper().setCurrentStateRequest(REQUEST_ROTATE);
        DiscoveryBounce.showForOverviewIfNeeded(launcher);
        RecentsView recentsView = launcher.getOverviewPanel();
        AccessibilityManagerCompat.sendCustomAccessibilityEvent(
+3 −2
Original line number Diff line number Diff line
@@ -322,13 +322,14 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
            mAppWindowAnimationHelper.updateHomeBounds(getStackBounds(dp));
        }
        int displayRotation = 0;
        if (mOrientedState != null) {
        if (mOrientedState != null && !mOrientedState.areMultipleLayoutOrientationsDisabled()) {
            // TODO(b/150300347): The first recents animation after launcher is started with the
            //  foreground app not in landscape will look funky until that bug is fixed
            displayRotation = mOrientedState.getDisplayRotation();

            RectF tempRectF = new RectF(TEMP_RECT);
            mOrientedState.mapRectFromNormalOrientation(tempRectF, dp.widthPx, dp.heightPx);
            mOrientedState.mapRectFromRotation(displayRotation,
                    tempRectF, dp.widthPx, dp.heightPx);
            tempRectF.roundOut(TEMP_RECT);
        }
        mAppWindowAnimationHelper.updateTargetRect(TEMP_RECT);
+5 −4
Original line number Diff line number Diff line
@@ -160,9 +160,9 @@ public class AppWindowAnimationHelper {
    }

    private float getSrcToTargetScale() {
        if (mOrientedState == null ||
            (mOrientedState.getDisplayRotation() == Surface.ROTATION_0
                || mOrientedState.getDisplayRotation() == Surface.ROTATION_180)) {
        if (mOrientedState == null
                || mOrientedState.isHomeRotationAllowed()
                || mOrientedState.isDisplayPhoneNatural()) {
            return mSourceRect.width() / mTargetRect.width();
        } else {
            return mSourceRect.height() / mTargetRect.height();
@@ -277,8 +277,9 @@ public class AppWindowAnimationHelper {
                mCurrentRect.offset(params.mOffset, 0);
            } else {
                int displayRotation = mOrientedState.getDisplayRotation();
                int launcherRotation = mOrientedState.getLauncherRotation();
                mOrientedState.getOrientationHandler().offsetTaskRect(mCurrentRect,
                    params.mOffset, displayRotation);
                    params.mOffset, displayRotation, launcherRotation);
            }
        }

+0 −6
Original line number Diff line number Diff line
@@ -88,10 +88,6 @@ public class LauncherRecentsView extends RecentsView<BaseQuickstepLauncher>
        }
    };

    private RotationHelper.ForcedRotationChangedListener mForcedRotationChangedListener =
            isForcedRotation -> LauncherRecentsView.this
                    .disableMultipleLayoutRotations(!isForcedRotation);

    public LauncherRecentsView(Context context) {
        this(context, null);
    }
@@ -344,7 +340,6 @@ public class LauncherRecentsView extends RecentsView<BaseQuickstepLauncher>
        super.onAttachedToWindow();
        PluginManagerWrapper.INSTANCE.get(getContext()).addPluginListener(
                mRecentsExtraCardPluginListener, RecentsExtraCard.class);
        mActivity.getRotationHelper().addForcedRotationCallback(mForcedRotationChangedListener);
    }

    @Override
@@ -352,7 +347,6 @@ public class LauncherRecentsView extends RecentsView<BaseQuickstepLauncher>
        super.onDetachedFromWindow();
        PluginManagerWrapper.INSTANCE.get(getContext()).removePluginListener(
                mRecentsExtraCardPluginListener);
        mActivity.getRotationHelper().removeForcedRotationCallback(mForcedRotationChangedListener);
    }

    @Override
Loading