mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Refactor RTL wallpaper code to use getLayoutTransitionOffsetForPage
Bug: 11157913
This commit is contained in:
@@ -1199,10 +1199,8 @@ public class Workspace extends SmoothPagedView
|
||||
// TODO: do different behavior if it's a live wallpaper?
|
||||
// Sometimes the left parameter of the pages is animated during a layout transition;
|
||||
// this parameter offsets it to keep the wallpaper from animating as well
|
||||
int offsetForLayoutTransitionAnimation = isLayoutRtl() ?
|
||||
getPageAt(getChildCount() - 1).getLeft() - getFirstChildLeft() : 0;
|
||||
int adjustedScroll =
|
||||
getScrollX() - firstPageScrollX - offsetForLayoutTransitionAnimation;
|
||||
getScrollX() - firstPageScrollX - getLayoutTransitionOffsetForPage(0);
|
||||
float offset = Math.min(1, adjustedScroll / (float) scrollRange);
|
||||
offset = Math.max(0, offset);
|
||||
// Don't use up all the wallpaper parallax until you have at least
|
||||
|
||||
Reference in New Issue
Block a user