Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1226be43 authored by Adam Cohen's avatar Adam Cohen Committed by Android (Google) Code Review
Browse files

Merge "Fix custom content scroll effects bug (recent regression) (issue...

Merge "Fix custom content scroll effects bug (recent regression) (issue 11188769)" into jb-ub-now-indigo-rose
parents dc734ef2 a45de07e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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);