mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:38:21 +00:00
Merge "Fix adjacent page offset in landscape orientation" into ub-launcher3-rvc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3f20e33af6
@@ -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();
|
||||
}
|
||||
|
||||
@@ -214,6 +214,11 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
|
||||
return HORIZONTAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPrimaryTranslationDirectionFactor() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTaskDismissDirectionFactor() {
|
||||
return 1;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -211,6 +211,11 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
||||
return VERTICAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPrimaryTranslationDirectionFactor() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTaskDismissDirectionFactor() {
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user