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

This commit is contained in:
Adam Cohen
2013-10-11 23:22:11 +00:00
committed by Android (Google) Code Review
+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);