android雪花-九游会j9娱乐平台
① android 鑳藉湪灞忓箷涓婄粯涓寮犲皬鍥劇墖錛岀劧鍚庨忔槑鑳屾櫙錛岃繕鑳芥搷浣滆兘鐪嬪埌鐨勮儗鏅妗岄潰鍥炬爣鎴栫▼搴忋
package com.qdsx.cml;
import android.app.activity;
import android.os.bundle;
import android.view.view;
import android.view.animation.alphaanimation;
import android.view.animation.animation;
//import android.view.animation.animationutils;
import android.view.animation.rotateanimation;
import android.view.animation.scaleanimation;
import android.view.animation.translateanimation;
import android.widget.imageview;
public class testdonghuaactivity extends activity {
private imageview tweenmm;
// private animation animation;
@override
public void oncreate(bundle savedinstancestate) {
super.oncreate(savedinstancestate);
setcontentview(r.layout.main);
tweenmm =(imageview)findviewbyid(r.id.imageview1);
}
//娓愬彉
public void btnalphaonclick(view view){
//this.dostartanimation(r.anim.alpha_animation);
animation b = new alphaanimation(0.1f, 1.0f);
b.setduration(2000);
tweenmm.startanimation(b);
}
//鏃嬭漿
public void btnrotateonclick(view view){
//this.dostartanimation(r.anim.rotate_animation);
animation c = new rotateanimation(0, 360,animation.relative_to_self,0.5f,animation.relative_to_self,0.5f);
c.setduration(3000);
tweenmm.startanimation(c);
}
//緙╂斁
public void btnscaleonclick(view view){
//this.dostartanimation(r.anim.scale_animation);
animation d = new scaleanimation(0f, 1f, 0f, 1f, animation.relative_to_self,0.5f, animation.relative_to_self,0.5f);
d.setduration(3000);
tweenmm.startanimation(d);
}
//浣嶇щ
public void btntransalteonclick(view view){
//this.dostartanimation(r.anim.translate_animation);
animation a= new translateanimation(0, 100, 0, 100);
a.setduration(5000);
a.setfillafter(true);//浣垮浘鐗囩щ鍔ㄥ悗鍥哄畾
tweenmm.startanimation(a);
}
//寮濮嬪姩鐢繪柟娉
/* private void dostartanimation(int animid){
animation = animationutils.loadanimation(this, animid);
animation.setfillafter(true);//浣垮浘鐗囩щ鍔ㄥ悗鍥哄畾
tweenmm.startanimation(animation);
}*/
}