Code example for AnimationSet

Methods: addAnimation, startAnimation

0
	private class ScaleShow implements OnClickListener {
 
		@Override 
		public void onClick(View arg0) {
			// TODO Auto-generated method stub 
			AnimationSet set = new AnimationSet(true);// ¶¨ÒåÒ»¸ö¶¯»­¼¯
			ScaleAnimation scale = new ScaleAnimation(1, 0.0f, 1, 0.0f,		//x,yÖá·Ö±ð´ÓÂúÆÁËõСµ½ÎÞ
					Animation.RELATIVE_TO_SELF, 0.5f,			//ÒÔ×ÔÉí0.5¿í¶ÈΪÖáËõ·Å
					Animation.RELATIVE_TO_SELF, 0.5f);			//ÒÔ×ÔÉí0.5¸ß¶ÈΪÖáËõ·Å
			scale.setDuration(3000);
			set.addAnimation(scale);							//Ôö¼Ó¶¯»­
			ScaleDemoActivity.this.scaleImage.startAnimation(set);//Æô¶¯¶¯»­
		} 
	} 
	 
	@Override 
	public boolean onCreateOptionsMenu(Menu menu){
		menu.add(Menu.NONE,Menu.FIRST+1,1,"Return to Animation");
		return super.onCreateOptionsMenu(menu);
	}