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

Commit e67ea9bc authored by Jeremy Sim's avatar Jeremy Sim
Browse files

Don't use flex split dim layers on tablets

Since tablet apps dont' go offscreen even in flex split mode, we shouldn't dim them.

Fixes: 402308662
Flag: com.android.wm.shell.enable_flexible_two_app_split
Test: Manual
Change-Id: Iabd111bcb2083ed50d04a0a4ee04cd997ea66e55
parent afcc09c3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -57,6 +57,11 @@ public class FlexParallaxSpec implements ParallaxSpec {
     * @return 0f = no dim applied. 1f = full black.
     */
    public float getDimValue(int position, DividerSnapAlgorithm snapAlgorithm) {
        // On tablets, apps don't go offscreen, so only dim for dismissal.
        if (!snapAlgorithm.areOffscreenRatiosSupported()) {
            return ParallaxSpec.super.getDimValue(position, snapAlgorithm);
        }

        int startDismissPos = snapAlgorithm.getDismissStartTarget().getPosition();
        int firstTargetPos = snapAlgorithm.getFirstSplitTarget().getPosition();
        int middleTargetPos = snapAlgorithm.getMiddleTarget().getPosition();
+1 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ public class FlexParallaxSpecTests {
        when(mockSnapAlgorithm.getMiddleTarget()).thenReturn(mockMiddleTarget);
        when(mockSnapAlgorithm.getLastSplitTarget()).thenReturn(mockLastTarget);
        when(mockSnapAlgorithm.getDismissEndTarget()).thenReturn(mockEndEdge);
        when(mockSnapAlgorithm.areOffscreenRatiosSupported()).thenReturn(true);

        when(mockStartEdge.getPosition()).thenReturn(0);
        when(mockFirstTarget.getPosition()).thenReturn(250);