一个不错的loading加载效果,弹性收缩,效果不错,学习android动画的朋友可以下载来研究研究
本例子其实由SeekBar实现,由MetaballView,MetaballDebugView实现动画效果.
当滑动到有一个位置的时候设置选中和未选中状态.
metaballView.setPaintMode();

debugMetaballView.setPaintMode();
设置SeekBar 的进度debugMetaballView.setMaxDistance(progress);

布局引入:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#001d30"
android:clipChildren="false"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity">

<com.dodola.animview.MetaballView
android:id="@+id/metaball"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" />

<com.dodola.animview.MetaballDebugView
android:id="@+id/debug_metaball"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/metaball"
android:layout_alignRight="@+id/metaball"
android:layout_below="@+id/metaball"
android:layout_marginTop="20dp" />

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/debug_metaball"
android:text="Debug test"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@android:color/white" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:clickable="true"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="最大间距"
android:textColor="@android:color/white" />

<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:max="400" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="贝塞尔曲线角度"
android:textColor="@android:color/white" />

<SeekBar
android:id="@+id/seekBar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="200" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="贝塞尔曲线控制点长度比率"
android:textColor="@android:color/white" />

<SeekBar
android:id="@+id/seekBar3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="500" />
</LinearLayout>
</RelativeLayout>

主要代码如下:

packagecom.dodola.animview;importandroid.support.v7.app.AppCompatActivity;importandroid.os.Bundle;importandroid.view.Menu;importandroid.view.MenuItem;importandroid.widget.ProgressBar;importandroid.widget.SeekBar;publicclassMainActivityextendsAppCompatActivityimplementsSeekBar.OnSeekBarChangeListener{privateMetaballViewmetaballView;privateMetaballDebugViewdebugMetaballView;privateSeekBarseekBar,seekBar2,seekBar3;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);metaballView=(MetaballView)this.findViewById(R.id.metaball);debugMetaballView=(MetaballDebugView)findViewById(R.id.debug_metaball);seekBar=(SeekBar)findViewById(R.id.seekBar);seekBar2=(SeekBar)findViewById(R.id.seekBar2);seekBar3=(SeekBar)findViewById(R.id.seekBar3);seekBar.setOnSeekBarChangeListener(this);seekBar2.setOnSeekBarChangeListener(this);seekBar3.setOnSeekBarChangeListener(this);}@OverridepublicbooleanonCreateOptionsMenu(Menumenu){//Inflatethemenu;thisaddsitemstotheactionbarifitispresent.getMenuInflater().inflate(R.menu.menu_main,menu);returntrue;}@OverridepublicbooleanonOptionsItemSelected(MenuItemitem){//Handleactionbaritemclickshere.Theactionbarwill//automaticallyhandleclicksontheHome/Upbutton,solong//asyouspecifyaparentactivityinAndroidManifest.xml.intid=item.getItemId();//noinspectionSimplifiableIfStatementif(id==R.id.action_fill){metaballView.setPaintMode(1);debugMetaballView.setPaintMode(1);returntrue;}elseif(id==R.id.action_strock){metaballView.setPaintMode(0);debugMetaballView.setPaintMode(0);returntrue;}returnsuper.onOptionsItemSelected(item);}@OverridepublicvoidonProgressChanged(SeekBarseekBar,intprogress,booleanfromUser){switch(seekBar.getId()){caseR.id.seekBar:debugMetaballView.setMaxDistance(progress);break;caseR.id.seekBar2:debugMetaballView.setMv(progress/100f);break;caseR.id.seekBar3:debugMetaballView.setHandleLenRate(progress/100f);break;}}@OverridepublicvoidonStartTrackingTouch(SeekBarseekBar){}@OverridepublicvoidonStopTrackingTouch(SeekBarseekBar){}}

自定义页面MetaballDebugView,主要代码如下

packagecom.dodola.animview;importandroid.content.Context;importandroid.graphics.Canvas;importandroid.graphics.Paint;importandroid.graphics.Path;importandroid.graphics.RectF;importandroid.util.AttributeSet;importandroid.util.Log;importandroid.view.MotionEvent;importandroid.view.View;importandroid.view.animation.AccelerateDecelerateInterpolator;importandroid.view.animation.Animation;importandroid.view.animation.Transformation;importjava.util.ArrayList;importjava.util.Arrays;/***Createdbydodolaon15/7/27.*/publicclassMetaballDebugViewextendsView{privatePaintpaint=newPaint();privatefloathandleLenRate=2f;privatefinalfloatradius=60;privatefinalfloatSCALE_RATE=0.3f;privateArrayList<Circle>circlePaths=newArrayList<>();privatefloatmv=0.6f;privatefloatmaxDistance=radius*4;publicMetaballDebugView(Contextcontext){super(context);init();}publicMetaballDebugView(Contextcontext,AttributeSetattrs){super(context,attrs);init();}publicMetaballDebugView(Contextcontext,AttributeSetattrs,intdefStyleAttr){super(context,attrs,defStyleAttr);init();}publicfloatgetMv(){returnmv;}publicvoidsetMv(floatmv){this.mv=mv;invalidate();}publicfloatgetMaxDistance(){returnmaxDistance;}publicvoidsetMaxDistance(floatmaxDistance){this.maxDistance=maxDistance;invalidate();}publicfloatgetHandleLenRate(){returnhandleLenRate;}publicvoidsetHandleLenRate(floathandleLenRate){this.handleLenRate=handleLenRate;invalidate();}privateclassCircle{float[]center;floatradius;}publicvoidsetPaintMode(intmode){paint.setStyle(mode==0?Paint.Style.STROKE:Paint.Style.FILL);invalidate();}privatevoidinit(){paint.setColor(0xff4db9ff);paint.setStyle(Paint.Style.FILL);paint.setAntiAlias(true);}privatevoidinitMetaballs(){CirclecirclePath=newCircle();circlePath.center=newfloat[]{(radius),radius};circlePath.radius=radius;circlePaths.add(circlePath);circlePath=newCircle();circlePath.center=newfloat[]{this.getMeasuredWidth()/2,this.getMeasuredHeight()/3};circlePath.radius=radius;circlePaths.add(circlePath);}privatefloat[]getVector(floatradians,floatlength){floatx=(float)(Math.cos(radians)*length);floaty=(float)(Math.sin(radians)*length);returnnewfloat[]{x,y};}/***@paramcanvas画布*@paramj*@parami*@paramv控制两个圆连接时候长度,间接控制连接线的粗细,该值为1的时候连接线为直线*@paramhandle_len_rate*@parammaxDistance*/privatevoidmetaball(Canvascanvas,intj,inti,floatv,floathandle_len_rate,floatmaxDistance){finalCirclecircle1=circlePaths.get(i);finalCirclecircle2=circlePaths.get(j);RectFball1=newRectF();ball1.left=circle1.center[0]-circle1.radius;ball1.top=circle1.center[1]-circle1.radius;ball1.right=ball1.left+circle1.radius*2;ball1.bottom=ball1.top+circle1.radius*2;RectFball2=newRectF();ball2.left=circle2.center[0]-circle2.radius;ball2.top=circle2.center[1]-circle2.radius;ball2.right=ball2.left+circle2.radius*2;ball2.bottom=ball2.top+circle2.radius*2;float[]center1=newfloat[]{ball1.centerX(),ball1.centerY()};float[]center2=newfloat[]{ball2.centerX(),ball2.centerY()};floatd=getDistance(center1,center2);floatradius1=ball1.width()/2;floatradius2=ball2.width()/2;floatpi2=(float)(Math.PI/2);floatu1,u2;if(d>maxDistance){canvas.drawCircle(ball2.centerX(),ball2.centerY(),circle2.radius,paint);}else{floatscale2=1+SCALE_RATE*(1-d/maxDistance);radius2*=scale2;canvas.drawCircle(ball2.centerX(),ball2.centerY(),radius2,paint);}Log.d("Metaball_radius","radius1:"+radius1+",radius2:"+radius2);if(radius1==0||radius2==0){return;}if(d>maxDistance||d<=Math.abs(radius1-radius2)){return;}elseif(d<radius1+radius2){u1=(float)Math.acos((radius1*radius1+d*d-radius2*radius2)/(2*radius1*d));u2=(float)Math.acos((radius2*radius2+d*d-radius1*radius1)/(2*radius2*d));}else{u1=0;u2=0;}Log.d("Metaball","center2:"+Arrays.toString(center2)+",center1:"+Arrays.toString(center1));float[]centermin=newfloat[]{center2[0]-center1[0],center2[1]-center1[1]};floatangle1=(float)Math.atan2(centermin[1],centermin[0]);floatangle2=(float)Math.acos((radius1-radius2)/d);floatangle1a=angle1+u1+(angle2-u1)*v;floatangle1b=angle1-u1-(angle2-u1)*v;floatangle2a=(float)(angle1+Math.PI-u2-(Math.PI-u2-angle2)*v);floatangle2b=(float)(angle1-Math.PI+u2+(Math.PI-u2-angle2)*v);Log.d("Metaball","angle1:"+angle1+",angle2:"+angle2+",angle1a:"+angle1a+",angle1b:"+angle1b+",angle2a:"+angle2a+",angle2b:"+angle2b);float[]p1a1=getVector(angle1a,radius1);float[]p1b1=getVector(angle1b,radius1);float[]p2a1=getVector(angle2a,radius2);float[]p2b1=getVector(angle2b,radius2);float[]p1a=newfloat[]{p1a1[0]+center1[0],p1a1[1]+center1[1]};float[]p1b=newfloat[]{p1b1[0]+center1[0],p1b1[1]+center1[1]};float[]p2a=newfloat[]{p2a1[0]+center2[0],p2a1[1]+center2[1]};float[]p2b=newfloat[]{p2b1[0]+center2[0],p2b1[1]+center2[1]};Log.d("Metaball","p1a:"+Arrays.toString(p1a)+",p1b:"+Arrays.toString(p1b)+",p2a:"+Arrays.toString(p2a)+",p2b:"+Arrays.toString(p2b));float[]p1_p2=newfloat[]{p1a[0]-p2a[0],p1a[1]-p2a[1]};floattotalRadius=(radius1+radius2);floatd2=Math.min(v*handle_len_rate,getLength(p1_p2)/totalRadius);d2*=Math.min(1,d*2/(radius1+radius2));Log.d("Metaball","d2:"+d2);radius1*=d2;radius2*=d2;float[]sp1=getVector(angle1a-pi2,radius1);float[]sp2=getVector(angle2a+pi2,radius2);float[]sp3=getVector(angle2b-pi2,radius2);float[]sp4=getVector(angle1b+pi2,radius1);Log.d("Metaball","sp1:"+Arrays.toString(sp1)+",sp2:"+Arrays.toString(sp2)+",sp3:"+Arrays.toString(sp3)+",sp4:"+Arrays.toString(sp4));Pathpath1=newPath();path1.moveTo(p1a[0],p1a[1]);path1.cubicTo(p1a[0]+sp1[0],p1a[1]+sp1[1],p2a[0]+sp2[0],p2a[1]+sp2[1],p2a[0],p2a[1]);path1.lineTo(p2b[0],p2b[1]);path1.cubicTo(p2b[0]+sp3[0],p2b[1]+sp3[1],p1b[0]+sp4[0],p1b[1]+sp4[1],p1b[0],p1b[1]);path1.lineTo(p1a[0],p1a[1]);path1.close();canvas.drawPath(path1,paint);}privatefloatgetLength(float[]b){return(float)Math.sqrt(b[0]*b[0]+b[1]*b[1]);}privatefloatgetDistance(float[]b1,float[]b2){floatx=b1[0]-b2[0];floaty=b1[1]-b2[1];floatd=x*x+y*y;return(float)Math.sqrt(d);}//测试用@OverridepublicbooleanonTouchEvent(MotionEventevent){Circlecircle=circlePaths.get(0);circle.center[0]=event.getX();circle.center[1]=event.getY();invalidate();returntrue;}@OverrideprotectedvoidonDraw(Canvascanvas){super.onDraw(canvas);if(circlePaths.size()==0){initMetaballs();}finalCirclecircle1=circlePaths.get(0);RectFball1=newRectF();ball1.left=circle1.center[0]-circle1.radius;ball1.top=circle1.center[1]-circle1.radius;ball1.right=ball1.left+circle1.radius*2;ball1.bottom=ball1.top+circle1.radius*2;canvas.drawCircle(ball1.centerX(),ball1.centerY(),circle1.radius,paint);for(inti=1;i<circlePaths.size();i++){metaball(canvas,i,0,mv,handleLenRate,maxDistance);}}}

自定义MetaballView,主要代码如下
控制两个圆连接时候长度,间接控制连接线的粗细,该值为1的时候连接线为直线
文章原创《IT蓝豹》http://www.itlanbao.com/

packagecom.dodola.animview;importandroid.annotation.TargetApi;importandroid.content.Context;importandroid.graphics.Canvas;importandroid.graphics.Color;importandroid.graphics.LightingColorFilter;importandroid.graphics.Paint;importandroid.graphics.Path;importandroid.graphics.RectF;importandroid.os.Build;importandroid.util.AttributeSet;importandroid.util.Log;importandroid.view.MotionEvent;importandroid.view.View;importandroid.view.animation.AccelerateDecelerateInterpolator;importandroid.view.animation.Animation;importandroid.view.animation.Transformation;importjava.util.ArrayList;importjava.util.Arrays;importjava.util.Random;/***Createdbydodolaon15/7/27.*/publicclassMetaballViewextendsView{privatePaintpaint=newPaint();privatefloathandle_len_rate=2f;privatefloatradius=30;privatefinalintITEM_COUNT=6;privatefinalintITEM_DIVIDER=60;privatefinalfloatSCALE_RATE=0.3f;privatefloatmaxLength;privateArrayList<Circle>circlePaths=newArrayList<>();privatefloatmInterpolatedTime;privateMoveAnimationwa;privateCirclecircle;publicMetaballView(Contextcontext){super(context);init();}publicMetaballView(Contextcontext,AttributeSetattrs){super(context,attrs);init();}publicMetaballView(Contextcontext,AttributeSetattrs,intdefStyleAttr){super(context,attrs,defStyleAttr);init();}privateclassCircle{float[]center;floatradius;}publicvoidsetPaintMode(intmode){paint.setStyle(mode==0?Paint.Style.STROKE:Paint.Style.FILL);invalidate();}privatevoidinit(){paint.setColor(0xff4db9ff);paint.setStyle(Paint.Style.FILL);paint.setAntiAlias(true);CirclecirclePath=newCircle();circlePath.center=newfloat[]{(radius+ITEM_DIVIDER),radius*(1f+SCALE_RATE)};circlePath.radius=radius/4*3;circlePaths.add(circlePath);for(inti=1;i<ITEM_COUNT;i++){circlePath=newCircle();circlePath.center=newfloat[]{(radius*2+ITEM_DIVIDER)*i,radius*(1f+SCALE_RATE)};circlePath.radius=radius;circlePaths.add(circlePath);}maxLength=(radius*2+ITEM_DIVIDER)*ITEM_COUNT;}privatefloat[]getVector(floatradians,floatlength){floatx=(float)(Math.cos(radians)*length);floaty=(float)(Math.sin(radians)*length);returnnewfloat[]{x,y};}privateclassMoveAnimationextendsAnimation{@OverrideprotectedvoidapplyTransformation(floatinterpolatedTime,Transformationt){super.applyTransformation(interpolatedTime,t);mInterpolatedTime=interpolatedTime;invalidate();}}/***@paramcanvas画布*@paramj*@parami*@paramv控制两个圆连接时候长度,间接控制连接线的粗细,该值为1的时候连接线为直线*@paramhandle_len_rate*@parammaxDistance*/privatevoidmetaball(Canvascanvas,intj,inti,floatv,floathandle_len_rate,floatmaxDistance){finalCirclecircle1=circlePaths.get(i);finalCirclecircle2=circlePaths.get(j);RectFball1=newRectF();ball1.left=circle1.center[0]-circle1.radius;ball1.top=circle1.center[1]-circle1.radius;ball1.right=ball1.left+circle1.radius*2;ball1.bottom=ball1.top+circle1.radius*2;RectFball2=newRectF();ball2.left=circle2.center[0]-circle2.radius;ball2.top=circle2.center[1]-circle2.radius;ball2.right=ball2.left+circle2.radius*2;ball2.bottom=ball2.top+circle2.radius*2;float[]center1=newfloat[]{ball1.centerX(),ball1.centerY()};float[]center2=newfloat[]{ball2.centerX(),ball2.centerY()};floatd=getDistance(center1,center2);floatradius1=ball1.width()/2;floatradius2=ball2.width()/2;floatpi2=(float)(Math.PI/2);floatu1,u2;if(d>maxDistance){//canvas.drawCircle(ball1.centerX(),ball1.centerY(),circle1.radius,paint);canvas.drawCircle(ball2.centerX(),ball2.centerY(),circle2.radius,paint);}else{floatscale2=1+SCALE_RATE*(1-d/maxDistance);floatscale1=1-SCALE_RATE*(1-d/maxDistance);radius2*=scale2;//radius1*=scale1;//canvas.drawCircle(ball1.centerX(),ball1.centerY(),radius1,paint);canvas.drawCircle(ball2.centerX(),ball2.centerY(),radius2,paint);}//Log.d("Metaball_radius","radius1:"+radius1+",radius2:"+radius2);if(radius1==0||radius2==0){return;}if(d>maxDistance||d<=Math.abs(radius1-radius2)){return;}elseif(d<radius1+radius2){u1=(float)Math.acos((radius1*radius1+d*d-radius2*radius2)/(2*radius1*d));u2=(float)Math.acos((radius2*radius2+d*d-radius1*radius1)/(2*radius2*d));}else{u1=0;u2=0;}//Log.d("Metaball","center2:"+Arrays.toString(center2)+",center1:"+Arrays.toString(center1));float[]centermin=newfloat[]{center2[0]-center1[0],center2[1]-center1[1]};floatangle1=(float)Math.atan2(centermin[1],centermin[0]);floatangle2=(float)Math.acos((radius1-radius2)/d);floatangle1a=angle1+u1+(angle2-u1)*v;floatangle1b=angle1-u1-(angle2-u1)*v;floatangle2a=(float)(angle1+Math.PI-u2-(Math.PI-u2-angle2)*v);floatangle2b=(float)(angle1-Math.PI+u2+(Math.PI-u2-angle2)*v);//Log.d("Metaball","angle1:"+angle1+",angle2:"+angle2+",angle1a:"+angle1a+",angle1b:"+angle1b+",angle2a:"+angle2a+",angle2b:"+angle2b);float[]p1a1=getVector(angle1a,radius1);float[]p1b1=getVector(angle1b,radius1);float[]p2a1=getVector(angle2a,radius2);float[]p2b1=getVector(angle2b,radius2);float[]p1a=newfloat[]{p1a1[0]+center1[0],p1a1[1]+center1[1]};float[]p1b=newfloat[]{p1b1[0]+center1[0],p1b1[1]+center1[1]};float[]p2a=newfloat[]{p2a1[0]+center2[0],p2a1[1]+center2[1]};float[]p2b=newfloat[]{p2b1[0]+center2[0],p2b1[1]+center2[1]};//Log.d("Metaball","p1a:"+Arrays.toString(p1a)+",p1b:"+Arrays.toString(p1b)+",p2a:"+Arrays.toString(p2a)+",p2b:"+Arrays.toString(p2b));float[]p1_p2=newfloat[]{p1a[0]-p2a[0],p1a[1]-p2a[1]};floattotalRadius=(radius1+radius2);floatd2=Math.min(v*handle_len_rate,getLength(p1_p2)/totalRadius);d2*=Math.min(1,d*2/(radius1+radius2));//Log.d("Metaball","d2:"+d2);radius1*=d2;radius2*=d2;float[]sp1=getVector(angle1a-pi2,radius1);float[]sp2=getVector(angle2a+pi2,radius2);float[]sp3=getVector(angle2b-pi2,radius2);float[]sp4=getVector(angle1b+pi2,radius1);//Log.d("Metaball","sp1:"+Arrays.toString(sp1)+",sp2:"+Arrays.toString(sp2)+",sp3:"+Arrays.toString(sp3)+",sp4:"+Arrays.toString(sp4));Pathpath1=newPath();path1.moveTo(p1a[0],p1a[1]);path1.cubicTo(p1a[0]+sp1[0],p1a[1]+sp1[1],p2a[0]+sp2[0],p2a[1]+sp2[1],p2a[0],p2a[1]);path1.lineTo(p2b[0],p2b[1]);path1.cubicTo(p2b[0]+sp3[0],p2b[1]+sp3[1],p1b[0]+sp4[0],p1b[1]+sp4[1],p1b[0],p1b[1]);path1.lineTo(p1a[0],p1a[1]);path1.close();canvas.drawPath(path1,paint);}privatefloatgetLength(float[]b){return(float)Math.sqrt(b[0]*b[0]+b[1]*b[1]);}privatefloatgetDistance(float[]b1,float[]b2){floatx=b1[0]-b2[0];floaty=b1[1]-b2[1];floatd=x*x+y*y;return(float)Math.sqrt(d);}//测试用//@Override//publicbooleanonTouchEvent(MotionEventevent){//switch(event.getAction()){//caseMotionEvent.ACTION_DOWN://break;//caseMotionEvent.ACTION_MOVE://Circlecircle=circlePaths.get(0);//circle.center[0]=event.getX();//circle.center[1]=event.getY();//invalidate();//break;//caseMotionEvent.ACTION_UP://break;//}////returntrue;//}@OverrideprotectedvoidonDraw(Canvascanvas){super.onDraw(canvas);circle=circlePaths.get(0);circle.center[0]=maxLength*mInterpolatedTime;RectFball1=newRectF();ball1.left=circle.center[0]-circle.radius;ball1.top=circle.center[1]-circle.radius;ball1.right=ball1.left+circle.radius*2;ball1.bottom=ball1.top+circle.radius*2;canvas.drawCircle(ball1.centerX(),ball1.centerY(),circle.radius,paint);for(inti=1,l=circlePaths.size();i<l;i++){metaball(canvas,i,0,0.6f,handle_len_rate,radius*4f);}}@OverrideprotectedvoidonMeasure(intwidthMeasureSpec,intheightMeasureSpec){setMeasuredDimension(resolveSizeAndState((int)(ITEM_COUNT*(radius*2+ITEM_DIVIDER)),widthMeasureSpec,0),resolveSizeAndState((int)(2*radius*1.4f),heightMeasureSpec,0));}privatevoidstopAnimation(){this.clearAnimation();postInvalidate();}privatevoidstartAnimation(){wa=newMoveAnimation();wa.setDuration(2500);wa.setInterpolator(newAccelerateDecelerateInterpolator());wa.setRepeatCount(Animation.INFINITE);wa.setRepeatMode(Animation.REVERSE);startAnimation(wa);}@OverrideprotectedvoidonVisibilityChanged(ViewchangedView,intvisibility){super.onVisibilityChanged(changedView,visibility);if(visibility==GONE||visibility==INVISIBLE){stopAnimation();}else{startAnimation();}}@OverrideprotectedvoidonAttachedToWindow(){super.onAttachedToWindow();startAnimation();}@OverrideprotectedvoidonDetachedFromWindow(){stopAnimation();super.onDetachedFromWindow();}}

文章来源《IT蓝豹》www.itlanbao.com

更多相关文章

  1. Android(安卓)SO逆向-流程控制语句及表达式运算
  2. android小记之Animation4种动画效果(贴上了GIF图)
  3. 使用Vitamio打造自己的Android万能播放器(2)—— 手势控制亮度、音
  4. maven 学习笔记(二)创建一个简单的 eclipse+android+maven 工程
  5. Android(安卓)ApiDemos示例解析(12):App->Activity->Redirection
  6. Android之 VersionCode,VersionName(1)版本号和版本名称的重要性介
  7. Android(安卓)实现屏幕底部弹出Dialog
  8. kinect手势识别后,利用识别效果控制鼠标
  9. Android修改源代码控制永不锁屏

随机推荐

  1. Android之SQLite开发(2)—SQLiteOpenHelper
  2. android屏幕的适配
  3. android的tabHost的使用
  4. Android : gen already exists but is no
  5. Android Volley完全解析(三),定制自己的Re
  6. android开发之Android ActionBar完全解析
  7. android 键对应的号码
  8. 深入Activity
  9. Android侧滑菜单DrawerLayout的使用
  10. android ndk 调用第三方so