am 1226be43: Merge "Fix custom content scroll effects bug (recent regression) (issue 11188769)" into jb-ub-now-indigo-rose

* commit '1226be4398d848fe59ddf9718d9a2939ae5b8e43':
  Fix custom content scroll effects bug (recent regression) (issue 11188769)
This commit is contained in:
Adam Cohen
2013-10-11 16:24:30 -07:00
committed by Android Git Automerger
+5 -5
View File
@@ -1431,11 +1431,11 @@ public class Workspace extends SmoothPagedView
if (hasCustomContent()) {
int index = mScreenOrder.indexOf(CUSTOM_CONTENT_SCREEN_ID);
int scrollDelta = getScrollForPage(index + 1) - getScrollX() +
getLayoutTransitionOffsetForPage(index + 1);
translationX = scrollDelta;
progress = (1.0f * scrollDelta) /
(getScrollForPage(index + 1) - getScrollForPage(index));
int scrollDelta = getScrollX() - getScrollForPage(index) -
getLayoutTransitionOffsetForPage(index);
float scrollRange = getScrollForPage(index + 1) - getScrollForPage(index);
translationX = scrollRange - scrollDelta;
progress = (scrollRange - scrollDelta) / scrollRange;
if (isLayoutRtl()) {
translationX = Math.min(0, translationX);