Do not hidde action buttons on FixedLandscape

Also, I moved some of the boolean expressions to a method in the
rotation handler to avoid repeating code and to make the expressions
more legible.

Bug: 401483343
Flag: com.android.launcher3.one_grid_specs
Test: RecentOrientedStateTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0a7bf1db572262d3263f623a1a41fe75076858e4)
Merged-In: I84c1a6e90ede827fd93ec44c3937acaf45f02413
Change-Id: I84c1a6e90ede827fd93ec44c3937acaf45f02413
This commit is contained in:
Sebastian Franco authored and Android Build Coastguard Worker committed 2025-06-24 19:48:49 -07:00
1 parent 8150c5e116
commit 0579ceb4e4
5 files changed
+347 -264

No files matched your search

@@ -419,6 +419,20 @@ public class RecentsOrientedState implements LauncherPrefChangeListener {
| FLAG_HOME_ROTATION_FORCE_ENABLED_FOR_TESTING)) != 0;
}
/**
* Returns if we should show the action buttons on the recent view based on the orientation
* state.
*/
public boolean shouldHideActionButtons() {
// In fixed landscape always show the action buttons
return !isLauncherFixedLandscape()
// When not in fixed landscape, do not show actions buttons when using
// fake landscape which happens when the rotation is not ROTATION_0 unless
// rotation is allowed
&& (getTouchRotation() != ROTATION_0 || getRecentsActivityRotation() != ROTATION_0)
&& !isRecentsActivityRotationAllowed();
}
/**
* Enables or disables the rotation watcher for listening to rotation callbacks
*/
@@ -19,7 +19,6 @@ package com.android.quickstep.views;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.os.Trace.traceBegin;
import static android.os.Trace.traceEnd;
import static android.view.Surface.ROTATION_0;
import static android.view.View.MeasureSpec.EXACTLY;
import static android.view.View.MeasureSpec.makeMeasureSpec;
@@ -2346,10 +2345,10 @@ public abstract class RecentsView<
}
}
boolean isInLandscape = mOrientationState.getTouchRotation() != ROTATION_0
|| mOrientationState.getRecentsActivityRotation() != ROTATION_0;
mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION,
!mOrientationState.isRecentsActivityRotationAllowed() && isInLandscape);
mActionsView.updateHiddenFlags(
HIDDEN_NON_ZERO_ROTATION,
mOrientationState.shouldHideActionButtons()
);
// Recalculate DeviceProfile dependent layout.
updateSizeAndPadding();
@@ -6600,9 +6599,10 @@ public abstract class RecentsView<
getCurrentPageTaskView().setModalness(modalness);
}
// Only show actions view when it's modal for in-place landscape mode.
boolean inPlaceLandscape = !mOrientationState.isRecentsActivityRotationAllowed()
&& mOrientationState.getTouchRotation() != ROTATION_0;
mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION, modalness < 1 && inPlaceLandscape);
mActionsView.updateHiddenFlags(
HIDDEN_NON_ZERO_ROTATION, modalness < 1
&& mOrientationState.shouldHideActionButtons()
);
}
@Nullable