mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 02:08:20 +00:00
Merge "Remove check that system rotation must be allowed for recents rotation to be allowed." into sc-v2-dev am: 42b5b78bbf
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15940373 Change-Id: I657a42949480520af4985053e273a7803c50bf07
This commit is contained in:
@@ -117,7 +117,7 @@ public class GoOverviewActionsView extends OverviewActionsView<OverlayUICallback
|
||||
*/
|
||||
public void updateOrientationState(RecentsOrientedState orientedState) {
|
||||
// dismiss tooltip
|
||||
boolean canLauncherRotate = orientedState.canRecentsActivityRotate();
|
||||
boolean canLauncherRotate = orientedState.isRecentsActivityRotationAllowed();
|
||||
if (mArrowTipView != null && !canLauncherRotate) {
|
||||
mArrowTipView.close(/* animate= */ false);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
|
||||
}
|
||||
}
|
||||
RecentsOrientedState orientedState = taskView.getRecentsView().getPagedViewOrientedState();
|
||||
boolean canLauncherRotate = orientedState.canRecentsActivityRotate();
|
||||
boolean canLauncherRotate = orientedState.isRecentsActivityRotationAllowed();
|
||||
boolean isInLandscape = orientedState.getTouchRotation() != ROTATION_0;
|
||||
|
||||
// Add overview actions to the menu when in in-place rotate landscape mode.
|
||||
|
||||
@@ -218,8 +218,8 @@ public class RecentsOrientedState implements
|
||||
|
||||
private boolean updateHandler() {
|
||||
mRecentsActivityRotation = inferRecentsActivityRotation(mDisplayRotation);
|
||||
if (mRecentsActivityRotation == mTouchRotation
|
||||
|| (canRecentsActivityRotate() && (mFlags & FLAG_SWIPE_UP_NOT_RUNNING) != 0)) {
|
||||
if (mRecentsActivityRotation == mTouchRotation || (isRecentsActivityRotationAllowed()
|
||||
&& (mFlags & FLAG_SWIPE_UP_NOT_RUNNING) != 0)) {
|
||||
mOrientationHandler = PagedOrientationHandler.PORTRAIT;
|
||||
} else if (mTouchRotation == ROTATION_90) {
|
||||
mOrientationHandler = PagedOrientationHandler.LANDSCAPE;
|
||||
@@ -253,7 +253,7 @@ public class RecentsOrientedState implements
|
||||
private boolean setFlag(int mask, boolean enabled) {
|
||||
boolean wasRotationEnabled = !TestProtocol.sDisableSensorRotation
|
||||
&& (mFlags & VALUE_ROTATION_WATCHER_ENABLED) == VALUE_ROTATION_WATCHER_ENABLED
|
||||
&& !canRecentsActivityRotate();
|
||||
&& !isRecentsActivityRotationAllowed();
|
||||
if (enabled) {
|
||||
mFlags |= mask;
|
||||
} else {
|
||||
@@ -262,7 +262,7 @@ public class RecentsOrientedState implements
|
||||
|
||||
boolean isRotationEnabled = !TestProtocol.sDisableSensorRotation
|
||||
&& (mFlags & VALUE_ROTATION_WATCHER_ENABLED) == VALUE_ROTATION_WATCHER_ENABLED
|
||||
&& !canRecentsActivityRotate();
|
||||
&& !isRecentsActivityRotationAllowed();
|
||||
if (wasRotationEnabled != isRotationEnabled) {
|
||||
UI_HELPER_EXECUTOR.execute(() -> {
|
||||
if (isRotationEnabled) {
|
||||
@@ -375,13 +375,6 @@ public class RecentsOrientedState implements
|
||||
| FLAG_HOME_ROTATION_FORCE_ENABLED_FOR_TESTING)) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the activity can rotate, if allowed by system rotation settings
|
||||
*/
|
||||
public boolean canRecentsActivityRotate() {
|
||||
return (mFlags & FLAG_SYSTEM_ROTATION_ALLOWED) != 0 && isRecentsActivityRotationAllowed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the rotation watcher for listening to rotation callbacks
|
||||
*/
|
||||
|
||||
@@ -117,7 +117,6 @@ import com.android.launcher3.InvariantDeviceProfile;
|
||||
import com.android.launcher3.PagedView;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.anim.AnimationSuccessListener;
|
||||
import com.android.launcher3.anim.AnimatorListeners;
|
||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
@@ -1615,7 +1614,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
boolean isInLandscape = mOrientationState.getTouchRotation() != ROTATION_0
|
||||
|| mOrientationState.getRecentsActivityRotation() != ROTATION_0;
|
||||
mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION,
|
||||
!mOrientationState.canRecentsActivityRotate() && isInLandscape);
|
||||
!mOrientationState.isRecentsActivityRotationAllowed() && isInLandscape);
|
||||
|
||||
// Update TaskView's DeviceProfile dependent layout.
|
||||
updateChildTaskOrientations();
|
||||
@@ -2047,7 +2046,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
}
|
||||
|
||||
private void animateRecentsRotationInPlace(int newRotation) {
|
||||
if (mOrientationState.canRecentsActivityRotate()) {
|
||||
if (mOrientationState.isRecentsActivityRotationAllowed()) {
|
||||
// Let system take care of the rotation
|
||||
return;
|
||||
}
|
||||
@@ -4676,7 +4675,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
getCurrentPageTaskView().setModalness(modalness);
|
||||
}
|
||||
// Only show actions view when it's modal for in-place landscape mode.
|
||||
boolean inPlaceLandscape = !mOrientationState.canRecentsActivityRotate()
|
||||
boolean inPlaceLandscape = !mOrientationState.isRecentsActivityRotationAllowed()
|
||||
&& mOrientationState.getTouchRotation() != ROTATION_0;
|
||||
mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION, modalness < 1 && inPlaceLandscape);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user