Use floating-point value for Drawable level
This allows us to run fine-grained level animations. Backwards compatibility: Another CL will add DrawableCompat.setLevel(float) to forward calls to the existing integer-based method. For callbacks, developers can override onLevelChanged(int) and use DrawableCompat.getLevelFloat() to obtain the floating-point level. Overriding onLevelChanged(float) will only work on current API. Bug: 23566299 Change-Id: I431fe6f3679c8f23f9cf3c2bb1f92a4059ee68e3
This commit is contained in:
@@ -217,7 +217,7 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable2 {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onLevelChange(int level) {
|
||||
protected boolean onLevelChange(float level) {
|
||||
return mAnimatedVectorState.mVectorDrawable.setLevel(level);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user