Android三种动画View Animation(补间动画) 、Drawable Animation(帧动画) 、Property Animation(属性动画)(上)

十种进度条用css3做 效果图 html代码 jiang loading... ... 阅读详情
转载:http://blog.youkuaiyun.com/lmj623565791/article/details/38067475/

三种动画的优缺点:

(1)Frame Animation(帧动画)主要用于播放一帧帧准备好的图片,类似GIF图片,优点是使用简单方便、缺点是需要事先准备好每一帧图片;

(2)Tween Animation(补间动画)仅需定义开始与结束的关键帧,而变化的中间帧由系统补上,优点是不用准备每一帧,缺点是只改变了对象绘制,而没有改变View本身属性。因此如果改变了按钮的位置,还是需要点击原来按钮所在位置才有效。

(3)Property Animation(属性动画)是3.0后推出的动画,优点是使用简单、降低实现的复杂度、直接更改对象的属性、几乎可适用于任何对象而仅非View类,缺点是需要3.0以上的API支持,限制较大!但是目前国外有个开源库,可以提供低版本支持!



1、概述

Android提供了几种动画类型:View Animation 、Drawable Animation 、Property Animation 。View Animation相当简单,不过只能支持简单的缩放、平移、旋转、透明度基本的动画,且有一定的局限性。比如:你希望View有一个颜色的切换动画;你希望可以使用3D旋转动画;你希望当动画停止时,View的位置就是当前的位置;这些View Animation都无法做到。这就是Property Animation产生的原因,本篇博客详细介绍Property Animation的用法。至于Drawable Animation,嗯,略~

2、相关API

Property Animation故名思议就是通过动画的方式改变对象的属性了,我们首先需要了解几个属性:

Duration动画的持续时间,默认300ms。

Time interpolation:时间差值,乍一看不知道是什么,但是我说LinearInterpolator、AccelerateDecelerateInterpolator,大家一定知道是干嘛的了,定义动画的变化率。

Repeat count and behavior:重复次数、以及重复模式;可以定义重复多少次;重复时从头开始,还是反向。

Animator sets: 动画集合,你可以定义一组动画,一起执行或者顺序执行。

Frame refresh delay:帧刷新延迟,对于你的动画,多久刷新一次帧;默认为10ms,但最终依赖系统的当前状态;基本不用管。

相关的类

ObjectAnimator  动画的执行类,后面详细介绍

ValueAnimator 动画的执行类,后面详细介绍 

AnimatorSet 用于控制一组动画的执行:线性,一起,每个动画的先后执行等。

AnimatorInflater 用户加载属性动画的xml文件

TypeEvaluator  类型估值,主要用于设置动画操作属性的值。

TimeInterpolator 时间插值,上面已经介绍。

总的来说,属性动画就是,动画的执行类来设置动画操作的对象的属性、持续时间,开始和结束的属性值,时间差值等,然后系统会根据设置的参数动态的变化对象的属性。

3、ObjectAnimator实现动画

之所以选择ObjectAnimator为第一个~~是因为,这个实现最简单~~一行代码,秒秒钟实现动画,下面看个例子:
布局文件:

[html]  view plain  copy
  1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  2.     xmlns:tools="http://schemas.android.com/tools"  
  3.     android:layout_width="match_parent"  
  4.     android:layout_height="match_parent"  
  5.     android:id="@+id/id_container" >  
  6.   
  7.     <ImageView  
  8.         android:id="@+id/id_ball"  
  9.         android:layout_width="wrap_content"  
  10.         android:layout_height="wrap_content"  
  11.         android:layout_centerInParent="true"  
  12.         android:src="@drawable/mv"   
  13.         android:scaleType="centerCrop"  
  14.         android:onClick="rotateyAnimRun"  
  15.         />  
  16.   
  17. </RelativeLayout>  

很简单,就一张妹子图片~
Activity代码:

[java]  view plain  copy
  1. package com.example.zhy_property_animation;  
  2.   
  3. import android.animation.ObjectAnimator;  
  4. import android.app.Activity;  
  5. import android.os.Bundle;  
  6. import android.view.View;  
  7.   
  8. public class ObjectAnimActivity extends Activity  
  9. {  
  10.     @Override  
  11.     protected void onCreate(Bundle savedInstanceState)  
  12.     {  
  13.         super.onCreate(savedInstanceState);  
  14.         setContentView(R.layout.xml_for_anim);  
  15.     }  
  16.   
  17.     public void rotateyAnimRun(View view)  
  18.     {  
  19.          ObjectAnimator//  
  20.          .ofFloat(view, "rotationX", 0.0F, 360.0F)//  
  21.          .setDuration(500)//  
  22.          .start();  
  23.     }  
  24.   
  25. }  

效果:

是不是一行代码就能实现简单的动画~~

对于ObjectAnimator

1、提供了ofInt、ofFloat、ofObject,这几个方法都是设置动画作用的元素、作用的属性、动画开始、结束、以及中间的任意个属性值。

当对于属性值,只设置一个的时候,会认为当然对象该属性的值为开始(getPropName反射获取),然后设置的值为终点。如果设置两个,则一个为开始、一个为结束~~~

动画更新的过程中,会不断调用setPropName更新元素的属性,所有使用ObjectAnimator更新某个属性,必须得有getter(设置一个属性值的时候)和setter方法~

2、如果你操作对象的该属性方法里面,比如上例的setRotationX如果内部没有调用view的重绘,则你需要自己按照下面方式手动调用。

[java]  view plain  copy
  1. anim.addUpdateListener(new AnimatorUpdateListener()  
  2.         {  
  3.             @Override  
  4.             public void onAnimationUpdate(ValueAnimator animation)  
  5.             {  
  6. //              view.postInvalidate();  
  7. //              view.invalidate();  
  8.             }  
  9.         });  
3、看了上面的例子,因为设置的操作的属性只有一个,那么如果我希望一个动画能够让View既可以缩小、又能够淡出(3个属性scaleX,scaleY,alpha),只使用ObjectAnimator咋弄?

想法是不是很不错,可能会说使用AnimatorSet啊,这一看就是一堆动画塞一起执行,但是我偏偏要用一个ObjectAnimator实例实现呢~下面看代码:

[java]  view plain  copy
  1. public void rotateyAnimRun(final View view)  
  2. {  
  3.     ObjectAnimator anim = ObjectAnimator//  
  4.             .ofFloat(view, "zhy", 1.0F,  0.0F)//  
  5.             .setDuration(500);//  
  6.     anim.start();  
  7.     anim.addUpdateListener(new AnimatorUpdateListener()  
  8.     {  
  9.         @Override  
  10.         public void onAnimationUpdate(ValueAnimator animation)  
  11.         {  
  12.             float cVal = (Float) animation.getAnimatedValue();  
  13.             view.setAlpha(cVal);  
  14.             view.setScaleX(cVal);  
  15.             view.setScaleY(cVal);  
  16.         }  
  17.     });  
  18. }  

把设置属性的那个字符串,随便写一个该对象没有的属性,就是不管~~咱们只需要它按照时间插值和持续时间计算的那个值,我们自己手动调用~

效果:

这个例子就是想说明一下,有时候换个思路不要被API所约束,利用部分API提供的功能也能实现好玩的效果~~~

比如:你想实现抛物线的效果,水平方向100px/s,垂直方向加速度200px/s*s ,咋实现呢~~可以自己用ObjectAnimator试试~

4、其实还有更简单的方式,实现一个动画更改多个效果:使用propertyValuesHolder

[java]  view plain  copy
  1. public void propertyValuesHolder(View view)  
  2.     {  
  3.         PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat("alpha", 1f,  
  4.                 0f, 1f);  
  5.         PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("scaleX", 1f,  
  6.                 0, 1f);  
  7.         PropertyValuesHolder pvhZ = PropertyValuesHolder.ofFloat("scaleY", 1f,  
  8.                 0, 1f);  
  9.         ObjectAnimator.ofPropertyValuesHolder(view, pvhX, pvhY,pvhZ).setDuration(1000).start();  
  10.     }  


 4、ValueAnimator实现动画

和ObjectAnimator用法很类似,简单看一下用view垂直移动的动画代码:

[java]  view plain  copy
  1. public void verticalRun(View view)  
  2.     {  
  3.         ValueAnimator animator = ValueAnimator.ofFloat(0, mScreenHeight  
  4.                 - mBlueBall.getHeight());  
  5.         animator.setTarget(mBlueBall);  
  6.         animator.setDuration(1000).start();  
  7.     }  

给你的感觉是不是,坑爹啊,这和ValueAnimator有毛线区别~但是仔细看,你看会发现,没有设置操作的属性~~也就是说,上述代码是没有任何效果的,没有指定属性~

这就是和ValueAnimator的区别之处:ValueAnimator并没有在属性上做操作,你可能会问这样有啥好处?我岂不是还得手动设置?

好处:不需要操作的对象的属性一定要有getter和setter方法,你可以自己根据当前动画的计算值,来操作任何属性,记得上例的那个【我希望一个动画能够让View既可以缩小、又能够淡出(3个属性scaleX,scaleY,alpha)】吗?其实就是这么个用法~

实例:

布局文件:

[html]  view plain  copy
  1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  2.     xmlns:tools="http://schemas.android.com/tools"  
  3.     android:layout_width="match_parent"  
  4.     android:layout_height="match_parent"   
  5.     android:id="@+id/id_container"  
  6.     
  7.     >  
  8.   
  9.     <ImageView  
  10.         android:id="@+id/id_ball"  
  11.         android:layout_width="wrap_content"  
  12.         android:layout_height="wrap_content"  
  13.         android:src="@drawable/bol_blue" />  
  14.   
  15.     <LinearLayout  
  16.         android:layout_width="fill_parent"  
  17.         android:layout_height="wrap_content"  
  18.         android:layout_alignParentBottom="true"  
  19.         android:orientation="horizontal" >  
  20.   
  21.         <Button  
  22.             android:layout_width="wrap_content"  
  23.             android:layout_height="wrap_content"  
  24.             android:onClick="verticalRun"  
  25.             android:text="垂直" />  
  26.   
  27.         <Button  
  28.             android:layout_width="wrap_content"  
  29.             android:layout_height="wrap_content"  
  30.             android:onClick="paowuxian"  
  31.             android:text="抛物线" />  
  32.   
  33.     </LinearLayout>  
  34.   
  35. </RelativeLayout>  
左上角一个小球,底部两个按钮~我们先看一个自由落体的代码:

[java]  view plain  copy
  1. /** 
  2.      * 自由落体 
  3.      * @param view 
  4.      */  
  5.     public void verticalRun( View view)  
  6.     {  
  7.         ValueAnimator animator = ValueAnimator.ofFloat(0, mScreenHeight  
  8.                 - mBlueBall.getHeight());  
  9.         animator.setTarget(mBlueBall);  
  10.         animator.setDuration(1000).start();  
  11. //      animator.setInterpolator(value)  
  12.         animator.addUpdateListener(new AnimatorUpdateListener()  
  13.         {  
  14.             @Override  
  15.             public void onAnimationUpdate(ValueAnimator animation)  
  16.             {  
  17.                 mBlueBall.setTranslationY((Float) animation.getAnimatedValue());  
  18.             }  
  19.         });  
  20.     }  

与ObjectAnimator不同的就是我们自己设置元素属性的更新~虽然多了几行代码,但是貌似提高灵活性~

下面再来一个例子,如果我希望小球抛物线运动【实现抛物线的效果,水平方向100px/s,垂直方向加速度200px/s*s 】,分析一下,貌似只和时间有关系,但是根据时间的变化,横向和纵向的移动速率是不同的,我们该咋实现呢?此时就要重写TypeValue的时候了,因为我们在时间变化的同时,需要返回给对象两个值,x当前位置,y当前位置:

代码:

[java]  view plain  copy
  1. /** 
  2.      * 抛物线 
  3.      * @param view 
  4.      */  
  5.     public void paowuxian(View view)  
  6.     {  
  7.   
  8.         ValueAnimator valueAnimator = new ValueAnimator();  
  9.         valueAnimator.setDuration(3000);  
  10.         valueAnimator.setObjectValues(new PointF(0, 0));  
  11.         valueAnimator.setInterpolator(new LinearInterpolator());  
  12.         valueAnimator.setEvaluator(new TypeEvaluator<PointF>()  
  13.         {  
  14.             // fraction = t / duration  
  15.             @Override  
  16.             public PointF evaluate(float fraction, PointF startValue,  
  17.                     PointF endValue)  
  18.             {  
  19.                 Log.e(TAG, fraction * 3 + "");  
  20.                 // x方向200px/s ,则y方向0.5 * 10 * t  
  21.                 PointF point = new PointF();  
  22.                 point.x = 200 * fraction * 3;  
  23.                 point.y = 0.5f * 200 * (fraction * 3) * (fraction * 3);  
  24.                 return point;  
  25.             }  
  26.         });  
  27.   
  28.         valueAnimator.start();  
  29.         valueAnimator.addUpdateListener(new AnimatorUpdateListener()  
  30.         {  
  31.             @Override  
  32.             public void onAnimationUpdate(ValueAnimator animation)  
  33.             {  
  34.                 PointF point = (PointF) animation.getAnimatedValue();  
  35.                 mBlueBall.setX(point.x);  
  36.                 mBlueBall.setY(point.y);  
  37.   
  38.             }  
  39.         });  
  40.     }  
可以看到,因为ofInt,ofFloat等无法使用,我们自定义了一个TypeValue,每次根据当前时间返回一个PointF对象,(PointF和Point的区别就是x,y的单位一个是float,一个是int;RectF,Rect也是)PointF中包含了x,y的当前位置~然后我们在监听器中获取,动态设置属性:

效果图:


有木有两个铁球同时落地的感觉~~对,我应该搞两个球~~ps:物理公式要是错了,就当没看见哈

自定义TypeEvaluator传入的泛型可以根据自己的需求,自己设计个Bean。

好了,我们已经分别讲解了ValueAnimator和ObjectAnimator实现动画;二者区别;如何利用部分API,自己更新属性实现效果;自定义TypeEvaluator实现我们的需求;但是我们并没有讲如何设计插值,其实我觉得把,这个插值默认的那一串实现类够用了~~很少,会自己去设计个超级变态的~嗯~所以:略。

5、监听动画的事件

对于动画,一般都是一些辅助效果,比如我要删除个元素,我可能希望是个淡出的效果,但是最终还是要删掉,并不是你透明度没有了,还占着位置,所以我们需要知道动画如何结束。

所以我们可以添加一个动画的监听:

[java]  view plain  copy
  1. public void fadeOut(View view)  
  2.     {  
  3.         ObjectAnimator anim = ObjectAnimator.ofFloat(mBlueBall, "alpha", 0.5f);  
  4.           
  5.         anim.addListener(new AnimatorListener()  
  6.         {  
  7.   
  8.             @Override  
  9.             public void onAnimationStart(Animator animation)  
  10.             {  
  11.                 Log.e(TAG, "onAnimationStart");  
  12.             }  
  13.   
  14.             @Override  
  15.             public void onAnimationRepeat(Animator animation)  
  16.             {  
  17.                 // TODO Auto-generated method stub  
  18.                 Log.e(TAG, "onAnimationRepeat");  
  19.             }  
  20.   
  21.             @Override  
  22.             public void onAnimationEnd(Animator animation)  
  23.             {  
  24.                 Log.e(TAG, "onAnimationEnd");  
  25.                 ViewGroup parent = (ViewGroup) mBlueBall.getParent();  
  26.                 if (parent != null)  
  27.                     parent.removeView(mBlueBall);  
  28.             }  
  29.   
  30.             @Override  
  31.             public void onAnimationCancel(Animator animation)  
  32.             {  
  33.                 // TODO Auto-generated method stub  
  34.                 Log.e(TAG, "onAnimationCancel");  
  35.             }  
  36.         });  
  37.         anim.start();  
  38.     }  

这样就可以监听动画的开始、结束、被取消、重复等事件~但是有时候会觉得,我只要知道结束就行了,这么长的代码我不能接收,那你可以使用AnimatorListenerAdapter

[java]  view plain  copy
  1. anim.addListener(new AnimatorListenerAdapter()  
  2. {  
  3.     @Override  
  4.     public void onAnimationEnd(Animator animation)  
  5.     {  
  6.         Log.e(TAG, "onAnimationEnd");  
  7.         ViewGroup parent = (ViewGroup) mBlueBall.getParent();  
  8.         if (parent != null)  
  9.             parent.removeView(mBlueBall);  
  10.     }  
  11. });  

AnimatorListenerAdapter继承了AnimatorListener接口,然后空实现了所有的方法~

效果图:


animator还有cancel()和end()方法:cancel动画立即停止,停在当前的位置;end动画直接到最终状态。

6、AnimatorSet的使用

实例:

布局文件:

[html]  view plain  copy
  1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  2.     xmlns:tools="http://schemas.android.com/tools"  
  3.     android:layout_width="match_parent"  
  4.     android:layout_height="match_parent"   
  5.     android:id="@+id/id_container"  
  6.      
  7.     >  
  8.   
  9.     <ImageView  
  10.         android:id="@+id/id_ball"  
  11.         android:layout_width="wrap_content"  
  12.         android:layout_height="wrap_content"  
  13.         android:layout_centerInParent="true"  
  14.         android:src="@drawable/bol_blue" />  
  15.   
  16.     <LinearLayout  
  17.         android:layout_width="fill_parent"  
  18.         android:layout_height="wrap_content"  
  19.         android:layout_alignParentBottom="true"  
  20.         android:orientation="horizontal" >  
  21.   
  22.         <Button  
  23.             android:layout_width="wrap_content"  
  24.             android:layout_height="wrap_content"  
  25.             android:onClick="togetherRun"  
  26.             android:text="简单的多动画Together" />  
  27.   
  28.         <Button  
  29.             android:layout_width="wrap_content"  
  30.             android:layout_height="wrap_content"  
  31.             android:onClick="playWithAfter"  
  32.             android:text="多动画按次序执行" />  
  33.           
  34.   
  35.     </LinearLayout>  
  36.   
  37. </RelativeLayout>  

继续玩球~

代码:

[java]  view plain  copy
  1. package com.example.zhy_property_animation;  
  2.   
  3. import android.animation.AnimatorSet;  
  4. import android.animation.ObjectAnimator;  
  5. import android.app.Activity;  
  6. import android.os.Bundle;  
  7. import android.view.View;  
  8. import android.view.animation.LinearInterpolator;  
  9. import android.widget.ImageView;  
  10.   
  11. public class AnimatorSetActivity extends Activity  
  12. {  
  13.     private ImageView mBlueBall;  
  14.   
  15.     @Override  
  16.     protected void onCreate(Bundle savedInstanceState)  
  17.     {  
  18.         super.onCreate(savedInstanceState);  
  19.         setContentView(R.layout.anim_set);  
  20.   
  21.         mBlueBall = (ImageView) findViewById(R.id.id_ball);  
  22.   
  23.     }  
  24.   
  25.     public void togetherRun(View view)  
  26.     {  
  27.         ObjectAnimator anim1 = ObjectAnimator.ofFloat(mBlueBall, "scaleX",  
  28.                 1.0f, 2f);  
  29.         ObjectAnimator anim2 = ObjectAnimator.ofFloat(mBlueBall, "scaleY",  
  30.                 1.0f, 2f);  
  31.         AnimatorSet animSet = new AnimatorSet();  
  32.         animSet.setDuration(2000);  
  33.         animSet.setInterpolator(new LinearInterpolator());  
  34.         //两个动画同时执行  
  35.         animSet.playTogether(anim1, anim2);  
  36.         animSet.start();  
  37.     }  
  38.   
  39.     public void playWithAfter(View view)  
  40.     {  
  41.         float cx = mBlueBall.getX();  
  42.   
  43.         ObjectAnimator anim1 = ObjectAnimator.ofFloat(mBlueBall, "scaleX",  
  44.                 1.0f, 2f);  
  45.         ObjectAnimator anim2 = ObjectAnimator.ofFloat(mBlueBall, "scaleY",  
  46.                 1.0f, 2f);  
  47.         ObjectAnimator anim3 = ObjectAnimator.ofFloat(mBlueBall,  
  48.                 "x",  cx ,  0f);  
  49.         ObjectAnimator anim4 = ObjectAnimator.ofFloat(mBlueBall,  
  50.                 "x", cx);  
  51.           
  52.         /** 
  53.          * anim1,anim2,anim3同时执行 
  54.          * anim4接着执行 
  55.          */  
  56.         AnimatorSet animSet = new AnimatorSet();  
  57.         animSet.play(anim1).with(anim2);  
  58.         animSet.play(anim2).with(anim3);  
  59.         animSet.play(anim4).after(anim3);  
  60.         animSet.setDuration(1000);  
  61.         animSet.start();  
  62.     }  
  63. }  

写了两个效果:

第一:使用playTogether两个动画同时执行,当然还有playSequentially依次执行~~

第二:如果我们有一堆动画,如何使用代码控制顺序,比如1,2同时;3在2后面;4在1之前等~就是效果2了

有一点注意:animSet.play().with();也是支持链式编程的,但是不要想着狂点,比如 animSet.play(anim1).with(anim2).before(anim3).before(anim5); 这样是不行的,系统不会根据你写的这一长串来决定先后的顺序,所以麻烦你按照上面例子的写法,多写几行:

效果图:



好了,由于篇幅~~关于属性动画还有点知识:

1、xml文件创建属性动画

2、布局动画

3、View的animate方法等。

那就考虑写到下一篇了,不过核心的功能就这些了~~

对了,如果使用11以下的SDK ,请导入nineoldandroids动画库,用法基本完全一致~


源码点击下载


Android动画之一:Drawable Animation 准备写几篇博客讲解Android的动画,首先介绍Android动画的整体轮廓。 Android动画主要分为三大类 View Animation Drawable AnimationProperty Animation 其中Drawable Animations对大多数人来说是三者中最容易理解的,其实它就是很多书籍中提到的逐帧动画(frame-by-frame animation)。 阅读详情

相关推荐

Android 动画↑

1.Android动画 Android系统的动画主要分为三大类: ①View Animation 视图动画:在古老的Android版本系统中就已经提供了,只能被用来设置View的动画。 ②Drawable Animation (也叫Frame动画、帧动画):专门用来一个一个的显示Drawable的resources,就像放幻灯片一样。 ③Property Animation属性动画:只对Android 3.0(API 11)以上版本的Android系统才有效,这种动画可以设置给任何Object,包.

zenmela2011的专栏 1768

Eclipse官网地址

http://www.eclipse.org/downloads/eclipse-packages/

It_BeeCoder的博客 2万+

Android原生动画工程化实践:XML与Property Animation深度优化

Android动画是UI响应性与用户体验的核心技术,其本质涉及View绘制机制、属性变更原理及系统渲染管线协同。View Animation通过修改绘制参数实现轻量级动效,适合装饰性场景;Property Animation则直接操作对象属性,保障交互一致性,是用户可操作组件的首选方案。二者在内存占用、兼容性与性能上存在显著差异,需结合设备能力(如低端机降级策略)、系统版本(Android 5.0+硬件加速行为变化)和生命周期管理(防泄漏、防ANR)进行工程化选型。XML动画作为可版本化、可复用的资源资产,

weixin_34405557的博客 382

Android 属性动画(Property Animation) 完全解析 (上)

转载请标明出处:http://blog.youkuaiyun.com/lmj623565791/article/details/380674751、概述Android提供了几种动画类型:View Animation 、Drawable Animation 、Property Animation 。View Animation相当简单,不过只能支持简单的缩放、平移、旋转、透明度基本的动画,且有一定的局限性。...

weixin_30917213的博客 1127

eclipse-jee-2018-09-win32-x86_64.zip

eclipse-jee-2018-09-win32-x86_64.zip

furry-octo-wight

Java 快速入门指南 本指南将引导您在 Deis 上部署 Java 应用程序。 用法 $ deis create Creating application... done, created gifted-turbojet Git remote deis added $ git push deis master Counting objects: 81, done. Delta compression using up to 8 threads. Compressing objects: 100% (60/60), done. Writing objects: 100% (81/81), 19.19 KiB | 0 bytes/s, done. Total 81 (delta 31), reused 0 (delta 0) -----> Fetching custom buildpack

Android三种动画View Animation(补间动画) 、Drawable Animation(帧动画) 、Property Animation(属性动画)(下)

转载:http://blog.youkuaiyun.com/lmj623565791/article/details/38092093 上一篇Android 属性动画(Property Animation) 完全解析 (上)已经基本展示了属性动画的核心用法: ObjectAnimator实现动画,ValueAnimator实现动画,AnimatorSet的使用等~ 当然了属性动画还有

Levin的专栏 687

帧动画素材(两套)(png文件)

两套帧动画的素材,豹子和姑娘跑啊跑。仅仅是素材,不含代码。

Android Framework 窗口子系统 (07)窗口动画之Animation & Animator

系列文章解读&说明: Android Framework 窗口子系统 的 分析主要分为以下部分: Android Framework 窗口子系统 (01)WindowMangerService基础知识 Android Framework 窗口子系统 (02) 应用进程和WMS之间的关系 Android Framework 窗口子系统 (03) 窗口显示次序 Android Fra...

wangdsh的博客 2312

Win10系统下Protel 99 SE元件库导入报错?3步搞定File is not recognized问题

本文详细介绍了在Win10系统下解决Protel 99 SE元件库导入报错'File is not recognized'的3步终极方案。通过手动修改配置文件、使用专用工具和优化系统兼容性设置,帮助用户快速解决这一经典PCB设计软件的兼容性问题,提升工作效率。

m3n5b7v8c9x的博客 796

拉曼光谱仪的原理与应用——TFN 7G F660手持式拉曼光谱识别仪

拉曼光谱仪的原理与应用——TFN 7G F660手持式拉曼光谱识别仪

TFN_yzgd的博客 928

android startanimation 回调,Android Animation解析

在app中增加一些动画效果能使我们的app更加绚丽,本文主要总结android中的AnimationAndroid中的Animation可以分为三种,View Animation,Drawable Animation ,Property Animation,其中第一种比较简单,只能实现一些简单的平移,缩放,旋转,透明度渐变的基本动画效果,第二种可以实现一种逐帧动画效果,而第三种属性动画比较复杂,A...

weixin_32211739的博客 1167

LTspice 导入 PSpice 模型实战指南 --(解决语法兼容性与模型优化问题)

本文提供了将PSpice模型成功导入LTspice的详细实战指南。针对两者间的语法兼容性问题,文章以TI UCC23513为例,逐步讲解模型获取、符号创建、常见语法错误修改及仿真验证方法,并分享了模型优化与个人库管理技巧,帮助用户高效解决模型导入与仿真难题。

weixin_28278377的博客 823

android属性动画的两种放是,Android 动画——属性动画Property Animation

Android在3.0之前只提供了两种动画:View Animation 、Drawable Animation 。也就是我们在《Android 动画——Frame Animation与Tween Animation 》讲解的逐帧动画和补间动画。Android在3.0之后又增加了一种动画类型:Property Animation属性动画 。View Animation相当简单,不过只能支持简单的缩...

weixin_33880392的博客 226

深入解析MTK DRM初始化流程:从KMS模块到组件框架

本文深入解析了联发科(MTK)平台上DRM显示框架的初始化流程。从内核模块加载、Component框架管理依赖,到核心的mtk_drm_bind函数构建KMS对象(CRTC、Plane、Encoder、Connector),最终完成DRM设备注册并创建用户空间接口。文章结合调试经验,为开发者梳理了从驱动启动到屏幕点亮的完整路径与关键排查点。

onion的博客 768

Cadence IC618与Spectre231安装配置全攻略:License、环境变量与依赖检查

EDA工具部署中,License管理与环境变量隔离是核心难点。FlexLM作为通用授权机制,通过守护进程和端口配置实现工具授权;环境变量则控制工具路径与库加载顺序,避免版本冲突。合理配置可确保IC618与Spectre231稳定运行,提升仿真效率。典型应用场景包括模拟IC设计、高校实验室及企业级EDA环境。本文聚焦Cadence IC618与Spectre231的安装实践,详解License配置、环境隔离及依赖检查,助你快速搭建可靠设计环境。

weixin_28721917的博客 330

android动画详解

在android 3.0以前只支持两种动画模式:一种为补间动画(tween animation)另一种为帧动画(frame animation)。在android3.0之后,系统又引入了一种新的动画系统:属性动画(property animation),对于3.0之前的系统,我们可以通过引用nineoldAndroids.jar来达到在系统中使用属性动画的目的。这三种动画模式在SDK中分别被称为p

xlzhang1988的专栏 667

2025.1.16——五、LoveSQL1 sqlmap文件类|万能密码

题目来源:BUUCTF[极客大挑战2019]LoveSQL1。

2402_87387800的博客 1067

动画——View Animation,Drawable Animation,Property Animation,LayoutTransition

View AnimationView Animation(Tween Animation):补间动画,给出两个关键帧,通过一些算法将给定属性值在给定的时间内在两个关键帧间渐变。View animation只能应用于View对象,而且只支持一部分属性,如支持缩放旋转而不支持背景颜色的改变。而且对于View animation,它只是改变了View对象绘制的位置,而没有改变View对象本身,比如,你有一

chenmeng911的博客 937

T527 uart串口配置导致系统进不去

T527 s_uart串口配置导致系统进不去。

Linux驱动开发工程师,熟悉Linux/Android底层驱动、TP、显示、IIC、网络等通用外设调试适配,Linux上层应用开发。常用平台瑞芯微、全志、恩智浦等。 676

实战封神!YOLOv7 轻量化部署全攻略:ONNX格式转换+TensorRT极致加速(速度直接提升3-5倍,精度无损)

部署核心链路,这是YOLO系列部署的最优解,速度提升3~5倍,精度无损;ONNX是桥梁:解决模型兼容性问题,简化后能去掉冗余节点,是TensorRT加速的前提;TensorRT是核心:NVIDIA显卡的极致加速引擎,FP16量化是速度与精度的最优平衡,无需手动配置,一键开启;轻量化终极组合YOLOv7-tiny + 416尺寸 + TensorRT FP16,速度提升5~8倍,满足所有实时检测场景;避坑核心:转换参数必加,推理尺寸必须一致,engine文件显卡专属。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 308

Drawable资源--属性动画Property Animation资源

实例-实现不断渐变的背景色 res文件夹下建立animator文件夹,在该文件夹下建立 color_anim.xml     android:propertyName="backgroundColor"     android:duration="3000"     android:valueFrom="#FF8080"     android:valueTo="#80

865

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

Android动画

res/animator/下存放定义属性动画的xml文件/res/anim/下存放定义补间动画的xml文件。

1177

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

android 同根动画_Android中动画的种类和实现

Android 中的动画有三种类型:View Animation(补间动画):只能设置给View,可以进行位置,大小,旋转,透明四种变化。(xml = anim)Drawable Animation(帧动画):用来一个个的显示图片资源,类似于幻灯片一帧一帧地播放。(xml = drawable)Property Animation(属性动画):Android3.0以上系统中使用,这种动画可以设置给...

weixin_39713317的博客 131

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Android开发者指南-动画-Animation[原创译文]

Animation 英文原文:http://developer.android.com/guide/topics/graphics/animation.html 版本:Android 4.0 r1 - 22 Mar 2012 0:35 参阅 Property 动画 View 动画 Drawable 动画 Android 框架提供了两种动画系统:pr

houyu_1983的专栏 928
上一篇: AngularJS中ng-Src指令替代src 解决console的url请求404错误
下一篇: Android三种动画View Animation(补间动画) 、Drawable Animation(帧动画) 、Property Animation(属性动画)(下)
oLevin
博客等级 码龄14年 80粉丝 90原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值