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

Commit b2c3d4f5 authored by Pat Manning's avatar Pat Manning Committed by Automerger Merge Worker
Browse files

Merge "Animate clear all button's alpha after last task has scrolled beyond...

Merge "Animate clear all button's alpha after last task has scrolled beyond its edge." into tm-dev am: 08a40840

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17319410



Change-Id: I9e0c88c8902022e2764d96911b6df58d818f56ca
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a4ce1fb6 08a40840
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -141,7 +141,10 @@ public class ClearAllButton extends Button {
        }
        applyPrimaryTranslation();
        applySecondaryTranslation();
        mScrollAlpha = 1 - shift / orientationSize;
        float clearAllSpacing =
                recentsView.getPageSpacing() + recentsView.getClearAllExtraPageSpacing();
        clearAllSpacing = mIsRtl ? -clearAllSpacing : clearAllSpacing;
        mScrollAlpha = Math.max((clearAllScroll + clearAllSpacing - scroll) / clearAllSpacing, 0);
        updateAlpha();
    }

+6 −5
Original line number Diff line number Diff line
@@ -1289,10 +1289,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
                    return;
                }
                TaskView taskView = getTaskViewAt(mNextPage);
                // Only snap to fully visible focused task.
                if (taskView == null
                        || !taskView.isFocusedTask()
                        || !isTaskViewFullyVisible(taskView)) {
                // Snap to fully visible focused task and clear all button.
                boolean shouldSnapToFocusedTask = taskView != null && taskView.isFocusedTask()
                        && isTaskViewFullyVisible(taskView);
                boolean shouldSnapToClearAll = mNextPage == indexOfChild(mClearAllButton);
                if (!shouldSnapToFocusedTask && !shouldSnapToClearAll) {
                    return;
                }
            }
@@ -4535,7 +4536,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
                ? getClearAllExtraPageSpacing() : 0;
    }

    private int getClearAllExtraPageSpacing() {
    protected int getClearAllExtraPageSpacing() {
        return showAsGrid()
                ? Math.max(mActivity.getDeviceProfile().overviewGridSideMargin - mPageSpacing, 0)
                : 0;