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

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