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

Commit 5b032429 authored by Michael Jurka's avatar Michael Jurka Committed by Android (Google) Code Review
Browse files

Merge "Fix one cause of slow scrolling in Recents"

parents f9b9ead5 67b03701
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -154,6 +154,13 @@ public class SwipeHelper implements Gefingerpoken {
        return Math.max(mMinAlpha, result);
    }

    private void updateAlphaFromOffset(View animView, boolean dismissable) {
        if (FADE_OUT_DURING_SWIPE && dismissable) {
            animView.setAlpha(getAlphaForOffset(animView));
        }
        invalidateGlobalRegion(animView);
    }

    // invalidate the view's own bounds all the way up the view hierarchy
    public static void invalidateGlobalRegion(View view) {
        invalidateGlobalRegion(
@@ -290,10 +297,7 @@ public class SwipeHelper implements Gefingerpoken {
        });
        anim.addUpdateListener(new AnimatorUpdateListener() {
            public void onAnimationUpdate(ValueAnimator animation) {
                if (FADE_OUT_DURING_SWIPE && canAnimViewBeDismissed) {
                    animView.setAlpha(getAlphaForOffset(animView));
                }
                invalidateGlobalRegion(animView);
                updateAlphaFromOffset(animView, canAnimViewBeDismissed);
            }
        });
        anim.start();
@@ -307,10 +311,12 @@ public class SwipeHelper implements Gefingerpoken {
        anim.setDuration(duration);
        anim.addUpdateListener(new AnimatorUpdateListener() {
            public void onAnimationUpdate(ValueAnimator animation) {
                if (FADE_OUT_DURING_SWIPE && canAnimViewBeDismissed) {
                    animView.setAlpha(getAlphaForOffset(animView));
                updateAlphaFromOffset(animView, canAnimViewBeDismissed);
            }
                invalidateGlobalRegion(animView);
        });
        anim.addListener(new AnimatorListenerAdapter() {
            public void onAnimationEnd(Animator animator) {
                updateAlphaFromOffset(animView, canAnimViewBeDismissed);
            }
        });
        anim.start();
@@ -347,10 +353,8 @@ public class SwipeHelper implements Gefingerpoken {
                        }
                    }
                    setTranslation(mCurrAnimView, delta);
                    if (FADE_OUT_DURING_SWIPE && mCanCurrViewBeDimissed) {
                        mCurrAnimView.setAlpha(getAlphaForOffset(mCurrAnimView));
                    }
                    invalidateGlobalRegion(mCurrView);

                    updateAlphaFromOffset(mCurrAnimView, mCanCurrViewBeDimissed);
                }
                break;
            case MotionEvent.ACTION_UP: