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:
Alan Viverette
2015-09-02 13:33:58 -04:00
parent 3d21421a44
commit 3da32b7688
12 changed files with 175 additions and 65 deletions

View File

@@ -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);
}