diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 66d441056..edc5fce97 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -1409,11 +1409,11 @@ private void updateStateForCustomContent(int screenCenter) { 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);