animation - Android Animated Vector Drawable: change rotation degree at runtime -
i'm trying make android vector animation, contains rotation on vectorial group. basically, if degree transition constant, use resources:
my vectordrawable:
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="64dp" android:height="64dp" android:viewportheight="600" android:viewportwidth="600"> <group android:name="myrotationgroup" android:pivotx="300.0" android:pivoty="300.0" android:rotation="0"> <path android:name="myname" android:fillcolor="#000000" android:pathdata="m300,70 l 0,-70 70,70 0,0 -70,70z"/> </group> </vector>
my animatedvectordrawable:
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/my_vector_drawable" > <target android:name="myrotationgroup" android:animation="@animator/my_rotation" /> </animated-vector>
and objectanimator:
<objectanimator android:duration="500" android:propertyname="rotation" android:valuefrom="0" android:valueto="360" />
however, can see above, final degree of rotation set in objectanimator resource, 360° instance.
for animation, how can change programmatically final value? rotation degree need computed other data, don't know target value before animation starts.
thank help!
Comments
Post a Comment