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

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

Merge "Fix bug where app icons are clipped when transitioning from app to...

Merge "Fix bug where app icons are clipped when transitioning from app to home." into ub-launcher3-qt-r1-dev
parents 092b6f8c 857b3fbb
Loading
Loading
Loading
Loading
+37 −3
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
package com.android.quickstep.util;

import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.view.View;
import android.view.ViewGroup;
@@ -29,6 +31,7 @@ import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager.AnimationConfig;
import com.android.launcher3.R;
import com.android.launcher3.ShortcutAndWidgetContainer;
import com.android.launcher3.Workspace;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.anim.SpringObjectAnimator;
@@ -79,9 +82,19 @@ public class StaggeredWorkspaceAnim {
                .getDimensionPixelSize(R.dimen.swipe_up_max_workspace_trans_y);

        DeviceProfile grid = launcher.getDeviceProfile();
        ShortcutAndWidgetContainer currentPage = ((CellLayout) launcher.getWorkspace()
                .getChildAt(launcher.getWorkspace().getCurrentPage()))
                .getShortcutsAndWidgets();
        Workspace workspace = launcher.getWorkspace();
        CellLayout cellLayout = (CellLayout) workspace.getChildAt(workspace.getCurrentPage());
        ShortcutAndWidgetContainer currentPage = cellLayout.getShortcutsAndWidgets();

        boolean workspaceClipChildren = workspace.getClipChildren();
        boolean workspaceClipToPadding = workspace.getClipToPadding();
        boolean cellLayoutClipChildren = cellLayout.getClipChildren();
        boolean cellLayoutClipToPadding = cellLayout.getClipToPadding();

        workspace.setClipChildren(false);
        workspace.setClipToPadding(false);
        cellLayout.setClipChildren(false);
        cellLayout.setClipToPadding(false);

        // Hotseat and QSB takes up two additional rows.
        int totalRows = grid.inv.numRows + (grid.isVerticalBarLayout() ? 0 : 2);
@@ -111,6 +124,27 @@ public class StaggeredWorkspaceAnim {

        addWorkspaceScrimAnimationForState(launcher, BACKGROUND_APP, 0);
        addWorkspaceScrimAnimationForState(launcher, NORMAL, ALPHA_DURATION_MS);

        AnimatorListener resetClipListener = new AnimatorListenerAdapter() {
            int numAnimations = mAnimators.size();

            @Override
            public void onAnimationEnd(Animator animation) {
                numAnimations--;
                if (numAnimations > 0) {
                    return;
                }

                workspace.setClipChildren(workspaceClipChildren);
                workspace.setClipToPadding(workspaceClipToPadding);
                cellLayout.setClipChildren(cellLayoutClipChildren);
                cellLayout.setClipToPadding(cellLayoutClipToPadding);
            }
        };

        for (Animator a : mAnimators) {
            a.addListener(resetClipListener);
        }
    }

    /**
+4 −1
Original line number Diff line number Diff line
@@ -96,7 +96,10 @@ public class SpringObjectAnimator<T> extends ValueAnimator {
            }
        });

        mSpring.addUpdateListener((animation, value, velocity) -> mSpringEnded = false);
        mSpring.addUpdateListener((animation, value, velocity) -> {
            mSpringEnded = false;
            mEnded = false;
        });
        mSpring.addEndListener((animation, canceled, value, velocity) -> {
            mSpringEnded = true;
            tryEnding();