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

Commit 31d5b01e authored by fbaron's avatar fbaron
Browse files

Fix folder animation clipping and RTL issue

Fix: 341433475
Test: NONE
Flag: EXEMPT bugfix
Change-Id: I05c1ca65efea2fdcebb6ff9435fda1f4bbafb9f1
parent 59fd8cbf
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -242,11 +242,26 @@ public class FolderAnimationManager {
        // Create reveal animator for the folder content (capture the top 4 icons 2x2)
        int width = mDeviceProfile.folderCellLayoutBorderSpacePx.x
                + mDeviceProfile.folderCellWidthPx * 2;
        int rtlExtraWidth = 0;
        int height = mDeviceProfile.folderCellLayoutBorderSpacePx.y
                + mDeviceProfile.folderCellHeightPx * 2;
        int page = mIsOpening ? mContent.getCurrentPage() : mContent.getDestinationPage();
        // In RTL we want to move to the last 2 columns of icons in the folder.
        if (Utilities.isRtl(mContext.getResources())) {
            page = (mContent.getPageCount() - 1) - page;
            CellLayout clAtPage = mContent.getPageAt(page);
            if (clAtPage != null) {
                int numExtraRows = clAtPage.getCountX() - 2;
                rtlExtraWidth = (int) Math.max(numExtraRows * (mDeviceProfile.folderCellWidthPx
                        + mDeviceProfile.folderCellLayoutBorderSpacePx.x), rtlExtraWidth);
            }
        }
        int left = mContent.getPaddingLeft() + page * lp.width;
        Rect contentStart = new Rect(left, 0, left + width, height);
        Rect contentStart = new Rect(
                left + rtlExtraWidth,
                0,
                left + width + mContent.getPaddingRight() + rtlExtraWidth,
                height);
        Rect contentEnd = new Rect(left, 0, left + lp.width, lp.height);
        play(a, shapeDelegate.createRevealAnimator(
                mFolder.getContent(), contentStart, contentEnd, finalRadius, !mIsOpening));