标签:文件中 多少 nim 宽度 平移动画 等于 支付 apk 动作
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportHeight="32"
android:viewportWidth="32">
<path
android:fillColor= "#ffaaaa"
android:pathData= "M20.5,9.5
c-1.955,0,-3.83,1.268,-4.5,3
c-0.67,-1.732,-2.547,-3,-4.5,-3
C8.957,9.5,7,11.432,7,14
c0,3.53,3.793,6.257,9,11.5
c5.207,-5.242,9,-7.97,9,-11.5
C25,11.432,23.043,9.5,20.5,9.5z" />
</vector><vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="200dp"
android:width="200dp"
android:viewportHeight="100"
android:viewportWidth="100" >
<path
android:fillColor="@color/yellow"
android:pathData="@string/path_circle"/>
<path
android:name="eye_left"
android:strokeColor="@android:color/black"
android:strokeWidth="4"
android:strokeLineCap="round"
android:pathData="@string/path_eye_left_sad"/>
<path
android:name="eye_right"
android:strokeColor="@android:color/black"
android:strokeWidth="4"
android:strokeLineCap="round"
android:pathData="@string/path_eye_right_sad"/>
<path
android:name="mouth"
android:strokeColor="@android:color/black"
android:strokeWidth="4"
android:strokeLineCap="round"
android:pathData="@string/path_face_mouth_sad"/>
</vector><objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="3000" android:propertyName="pathData" android:valueFrom="@string/path_eye_left_sad" android:valueTo="@string/path_eye_left_happy" android:valueType="pathType" android:interpolator="@android:anim/accelerate_interpolator"/>下面是右眼的属性动画定义文件anim_smile_eye_right.xml:
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="3000" android:propertyName="pathData" android:valueFrom="@string/path_eye_right_sad" android:valueTo="@string/path_eye_right_happy" android:valueType="pathType" android:interpolator="@android:anim/accelerate_interpolator"/>下面是嘴巴的属性动画定义文件anim_smile_mouth.xml:
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="3000" android:propertyName="pathData" android:valueFrom="@string/path_face_mouth_sad" android:valueTo="@string/path_face_mouth_happy" android:valueType="pathType" android:interpolator="@android:anim/accelerate_interpolator"/>
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/vector_face_eye" >
<target
android:name="mouth"
android:animation="@anim/anim_smile_mouth" />
<target
android:name="eye_left"
android:animation="@anim/anim_smile_eye_left" />
<target
android:name="eye_right"
android:animation="@anim/anim_smile_eye_right" />
</animated-vector> private void startVectorSmile() {
iv_vector_smile.setImageResource(R.drawable.animated_vector_smile_eye);
Drawable drawable = iv_vector_smile.getDrawable();
if (drawable instanceof AnimatedVectorDrawable) {
((AnimatedVectorDrawable) drawable).start();
}
}<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="100dp"
android:viewportHeight="100"
android:viewportWidth="100"
android:width="100dp" >
<path
android:name="circle"
android:pathData="
M 10,50
A 40 40 0 1 0 10 49"
android:strokeAlpha="1"
android:strokeColor="@color/blue_sky"
android:strokeLineCap="round"
android:strokeWidth="3" />
</vector>下面是打勾的矢量图形(含圆圈图形)定义文件vector_pay_success.xml:<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="100dp"
android:viewportHeight="100"
android:viewportWidth="100"
android:width="100dp" >
<path
android:name="circle"
android:pathData="
M 10,50
A 40 40 0 1 0 10 49"
android:strokeAlpha="1"
android:strokeColor="@color/blue_sky"
android:strokeLineCap="round"
android:strokeWidth="3" />
<path
android:name="hook"
android:pathData="
M 30,50
L 45 65
L 75 35"
android:strokeAlpha="1"
android:strokeColor="@color/blue_sky"
android:strokeLineCap="butt"
android:strokeWidth="3" />
</vector><objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:interpolator="@android:interpolator/linear"
android:propertyName="trimPathEnd"
android:valueFrom="0"
android:valueTo="1"
android:valueType="floatType" /><animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/vector_pay_circle">
<target
android:name="circle"
android:animation="@anim/anim_pay" />
</animated-vector>下面这个用来播放圆圈动画后继的打勾动画:<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/vector_pay_success">
<target
android:name="hook"
android:animation="@anim/anim_pay" />
</animated-vector>标签:文件中 多少 nim 宽度 平移动画 等于 支付 apk 动作
原文地址:http://blog.csdn.net/aqi00/article/details/54944816