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

Commit 3b9d5843 authored by Tony Wickham's avatar Tony Wickham
Browse files

Fix adjacent page offset in landscape orientation

Before, the adjacent tasks were coming in from the top and bottom
of the screen rather than the sides.

Bug: 149934536
Change-Id: Id6e57dcbc1967d70869df06068d25717de116934
parent ffc06198
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1853,7 +1853,9 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
                    : i < modalMidpoint
                            ? modalLeftOffsetSize
                            : modalRightOffsetSize;
            getChildAt(i).setTranslationX(translation + modalTranslation);
            float totalTranslation = translation + modalTranslation;
            mOrientationHandler.getPrimaryViewTranslate().set(getChildAt(i),
                    totalTranslation * mOrientationHandler.getPrimaryTranslationDirectionFactor());
        }
        updateCurveProperties();
    }
+5 −0
Original line number Diff line number Diff line
@@ -214,6 +214,11 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
        return HORIZONTAL;
    }

    @Override
    public int getPrimaryTranslationDirectionFactor() {
        return -1;
    }

    @Override
    public int getTaskDismissDirectionFactor() {
        return 1;
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ public interface PagedOrientationHandler {
    int getScrollOffsetStart(View view, Rect insets);
    int getScrollOffsetEnd(View view, Rect insets);
    SingleAxisSwipeDetector.Direction getOppositeSwipeDirection();
    int getPrimaryTranslationDirectionFactor();
    int getTaskDismissDirectionFactor();
    int getTaskDragDisplacementFactor(boolean isRtl);
    ChildBounds getChildBounds(View child, int childStart, int pageCenter, boolean layoutChild);
+5 −0
Original line number Diff line number Diff line
@@ -211,6 +211,11 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
        return VERTICAL;
    }

    @Override
    public int getPrimaryTranslationDirectionFactor() {
        return 1;
    }

    @Override
    public int getTaskDismissDirectionFactor() {
        return -1;