am 2f3ecab0: am 51b9f6a5: Merge "Refactor RTL wallpaper code to use getLayoutTransitionOffsetForPage" into jb-ub-now-jetsonic

* commit '2f3ecab0e2dc5ad47a9875582b4d01f4065791db':
  Refactor RTL wallpaper code to use getLayoutTransitionOffsetForPage
This commit is contained in:
Michael Jurka authored and Android Git Automerger committed 2014-02-14 20:37:02 +00:00
commit 0c0e543a17
2 files changed
+2 -10

No files matched your search

+1 -3
View File
@@ -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