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

Commit 34958f4b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix folder preview animation when adding or removing icons." into tm-qpr-dev

parents b751033f 81cec527
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ public class PreviewItemManager {
    private int mPrevTopPadding = -1;
    private Drawable mReferenceDrawable = null;

    private int mNumOfPrevItems = 0;

    // These hold the first page preview items
    private ArrayList<PreviewItemDrawingParams> mFirstPageParams = new ArrayList<>();
    // These hold the current page preview items. It is empty if the current page is the first page.
@@ -254,7 +256,6 @@ public class PreviewItemManager {

    void buildParamsForPage(int page, ArrayList<PreviewItemDrawingParams> params, boolean animate) {
        List<WorkspaceItemInfo> items = mIcon.getPreviewItemsOnPage(page);
        int prevNumItems = params.size();

        // We adjust the size of the list to match the number of items in the preview.
        while (items.size() < params.size()) {
@@ -278,8 +279,9 @@ public class PreviewItemManager {
                    mReferenceDrawable = p.drawable;
                }
            } else {
                FolderPreviewItemAnim anim = new FolderPreviewItemAnim(this, p, i, prevNumItems, i,
                        numItemsInFirstPagePreview, DROP_IN_ANIMATION_DURATION, null);
                FolderPreviewItemAnim anim = new FolderPreviewItemAnim(this, p, i,
                        mNumOfPrevItems, i, numItemsInFirstPagePreview, DROP_IN_ANIMATION_DURATION,
                        null);

                if (p.anim != null) {
                    if (p.anim.hasEqualFinalState(anim)) {
@@ -318,7 +320,9 @@ public class PreviewItemManager {
    }

    void updatePreviewItems(boolean animate) {
        int numOfPrevItemsAux = mFirstPageParams.size();
        buildParamsForPage(0, mFirstPageParams, animate);
        mNumOfPrevItems = numOfPrevItemsAux;
    }

    void updatePreviewItems(Predicate<WorkspaceItemInfo> itemCheck) {