Merge "Fix adjacent page offset in landscape orientation" into ub-launcher3-rvc-qpr-dev am: 3f20e33af6

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12327711

Change-Id: I8f2da96439372a9f6671469c3c41e4c0a43a4067
This commit is contained in:
TreeHugger Robot
2020-08-07 00:10:05 +00:00
committed by Automerger Merge Worker
4 changed files with 14 additions and 1 deletions
@@ -1890,7 +1890,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();
}
@@ -215,6 +215,11 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
return HORIZONTAL;
}
@Override
public int getPrimaryTranslationDirectionFactor() {
return -1;
}
@Override
public int getTaskDismissDirectionFactor() {
return 1;
@@ -75,6 +75,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);
@@ -212,6 +212,11 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
return VERTICAL;
}
@Override
public int getPrimaryTranslationDirectionFactor() {
return 1;
}
@Override
public int getTaskDismissDirectionFactor() {
return -1;