Fix custom content scroll effects bug (recent regression) (issue 11188769)

Change-Id: Ib90c024daf64baac2ccd1cfd04897d18cd35e111
This commit is contained in:
Adam Cohen
2013-10-11 16:07:47 -07:00
parent f7d458543e
commit a45de07ece

View File

@@ -1409,11 +1409,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);