Merge "Add listener once for volume row animation" into udc-dev

This commit is contained in:
Hongguang Chen
2023-06-02 23:26:49 +00:00
committed by Android (Google) Code Review

View File

@@ -2006,14 +2006,14 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
if (row.anim == null) {
row.anim = ObjectAnimator.ofInt(row.slider, "progress", progress, newProgress);
row.anim.setInterpolator(new DecelerateInterpolator());
row.anim.addListener(
getJankListener(row.view, TYPE_UPDATE, UPDATE_ANIMATION_DURATION));
} else {
row.anim.cancel();
row.anim.setIntValues(progress, newProgress);
}
row.animTargetProgress = newProgress;
row.anim.setDuration(UPDATE_ANIMATION_DURATION);
row.anim.addListener(
getJankListener(row.view, TYPE_UPDATE, UPDATE_ANIMATION_DURATION));
row.anim.start();
} else {
// update slider directly to clamped value