Fix one cause of slow scrolling in Recents
Bug: 8208782 Change-Id: I8153001d1cea0c01f929d3091a722fed842038fa
This commit is contained in:
@ -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));
|
||||
}
|
||||
invalidateGlobalRegion(animView);
|
||||
updateAlphaFromOffset(animView, canAnimViewBeDismissed);
|
||||
}
|
||||
});
|
||||
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:
|
||||
|
Reference in New Issue
Block a user