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

Commit 623eddd7 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Updating Launcher rotation logic

When auto-rotate is on, launcher allways allows rotation. This allows uses to use
locked rotation feature is available on the device
When auto-rotate is off, workspace does not allow rotation, but overview in quickstep
will allow rotation

Bug: 73872056
Change-Id: Ie12365c268fd5e4958634ed97b5a33dcadc691e2
parent 85f1eed5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@
            android:clearTaskOnLaunch="true"
            android:stateNotNeeded="true"
            android:windowSoftInputMode="adjustPan"
            android:screenOrientation="nosensor"
            android:screenOrientation="unspecified"
            android:configChanges="keyboard|keyboardHidden|navigation"
            android:resizeableActivity="true"
            android:resumeWhilePausing="true"
+6 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.launcher3.uioverrides;

import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS;
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.states.RotationHelper.REQUEST_ROTATE;

import android.graphics.Rect;
import android.view.View;
@@ -73,6 +74,11 @@ public class OverviewState extends LauncherState {
        rv.setOverviewStateEnabled(false);
    }

    @Override
    public void onStateTransitionEnd(Launcher launcher) {
        launcher.getRotationHelper().setCurrentStateRequest(REQUEST_ROTATE);
    }

    @Override
    public View getFinalFocus(Launcher launcher) {
        return launcher.getOverviewPanel();
+6 −3
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ import static com.android.launcher3.LauncherState.FAST_OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PROGRESS;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.states.RotationHelper.REQUEST_LOCK;
import static com.android.launcher3.states.RotationHelper.REQUEST_NONE;
import static com.android.quickstep.QuickScrubController.QUICK_SWITCH_START_DURATION;
import static com.android.quickstep.TouchConsumer.INTERACTION_NORMAL;
import static com.android.quickstep.TouchConsumer.INTERACTION_QUICK_SCRUB;
@@ -33,7 +35,6 @@ import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.res.Resources;
import android.graphics.Matrix;
import android.graphics.Matrix.ScaleToFit;
@@ -364,7 +365,8 @@ public class WindowTransformSwipeHandler extends BaseSwipeInteractionHandler {

        // For the duration of the gesture, lock the screen orientation to ensure that we do not
        // rotate mid-quickscrub
        mLauncher.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
        mLauncher.getRotationHelper().setStateHandlerRequest(REQUEST_LOCK);

        mRecentsView = mLauncher.getOverviewPanel();
        mQuickScrubController = mRecentsView.getQuickScrubController();
        mLauncherLayoutListener = new LauncherLayoutListener(mLauncher);
@@ -755,7 +757,8 @@ public class WindowTransformSwipeHandler extends BaseSwipeInteractionHandler {
        mLauncherLayoutListener.close(false);

        // Restore the requested orientation to the user preference after the gesture has ended
        mLauncher.updateRequestedOrientation();
        mLauncher.getRotationHelper().setStateHandlerRequest(REQUEST_NONE);

        mRecentsView.setFirstTaskIconScaledDown(false /* isScaledDown */, false /* animate */);
    }

+0 −6
Original line number Diff line number Diff line
@@ -173,12 +173,6 @@
    <string name="accessibility_action_overview">Overview</string>

    <!-- Strings for settings -->
    <!-- Title for Allow Rotation setting. [CHAR LIMIT=50] -->
    <string name="allow_rotation_title">Allow Home screen rotation</string>
    <!-- Text explaining when the home screen will get rotated. [CHAR LIMIT=100] -->
    <string name="allow_rotation_desc">When phone is rotated</string>
    <!-- Text explaining that rotation is disabled in Display settings. 'Display' refers to the Display section in system settings [CHAR LIMIT=100] -->
    <string name="allow_rotation_blocked_desc">Current Display setting doesn\'t permit rotation</string>
    <!-- Title for Notification dots setting. Tapping this will link to the system Notifications settings screen where the user can turn off notification dots globally. [CHAR LIMIT=50] -->
    <string name="icon_badging_title">Notification dots</string>
    <!-- Text to indicate that the system icon badging setting is on [CHAR LIMIT=100] -->
+0 −7
Original line number Diff line number Diff line
@@ -37,13 +37,6 @@
        android:persistent="true"
        />

    <SwitchPreference
        android:key="pref_allowRotation"
        android:title="@string/allow_rotation_title"
        android:defaultValue="@bool/allow_rotation"
        android:persistent="true"
        />

    <ListPreference
        android:key="pref_override_icon_shape"
        android:title="@string/icon_shape_override_label"
Loading