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

Commit 250a0eda authored by Jeremy Sim's avatar Jeremy Sim Committed by Android (Google) Code Review
Browse files

Merge "Don't use flex split dim layers on tablets" into main

parents f347d10a e67ea9bc
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);