Is it possible to have an animated drawable?

后端 未结 7 1034
野的像风
野的像风 2020-12-28 10:34

Is it possible to create a drawable that has some sort of animation, whether it is a frame by frame animation, rotation, etc, that is defined as a xml drawable and can be re

相关标签:
7条回答
  • 2020-12-28 11:07
    private ValueAnimator rotateDrawable(RotateDrawable drawable, int fromDegree, int toDegree) {
        drawable.setFromDegrees(fromDegree);
        drawable.setToDegrees(toDegree);
        return ObjectAnimator.ofInt(drawable, "level", 0, 10000);
    }
    

    level is the interpulting value from 0 to 100000. the actual animation values are set by the setter methods

    0 讨论(0)
提交回复
热议问题