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

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

Merge "Small tweaks to custom content management" into jb-ub-now-jolly-elf

parents bf292a0b 84a465aa
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -902,6 +902,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        int verticalPadding = getPaddingTop() + getPaddingBottom();

        LayoutParams lp = (LayoutParams) getChildAt(startIndex).getLayoutParams();
        LayoutParams nextLp;

        int childLeft = offsetX + (lp.isFullScreenPage ? 0 : getPaddingLeft());
        if (mPageScrolls == null || getChildCount() != mChildCountOnLastLayout) {
@@ -931,7 +932,24 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc

                int scrollOffsetLeft = lp.isFullScreenPage ? 0 : getPaddingLeft();
                mPageScrolls[i] = childLeft - scrollOffsetLeft - offsetX;
                childLeft += childWidth + mPageSpacing;

                int pageGap = mPageSpacing;
                int next = i + delta;
                if (next != endIndex) {
                    nextLp = (LayoutParams) getPageAt(next).getLayoutParams();
                } else {
                    nextLp = null;
                }

                // Prevent full screen pages from showing in the viewport
                // when they are not the current page.
                if (lp.isFullScreenPage) {
                    pageGap = getPaddingLeft();
                } else if (nextLp != null && nextLp.isFullScreenPage) {
                    pageGap = getPaddingRight();
                }

                childLeft += childWidth + pageGap;
            }
        }

+1 −1
Original line number Diff line number Diff line
@@ -1481,7 +1481,7 @@ public class Workspace extends SmoothPagedView
                mState == State.NORMAL &&
                !mIsSwitchingState &&
                !isInOverscroll) {
            for (int i = 0; i < getChildCount(); i++) {
            for (int i = numCustomPages(); i < getChildCount(); i++) {
                CellLayout child = (CellLayout) getChildAt(i);
                if (child != null) {
                    float scrollProgress = getScrollProgress(screenCenter, child, i);