Code example for AnimationSet

Methods: addAnimation, startAnimation

0
	private class TransShow implements OnClickListener {
 
		@Override 
		public void onClick(View arg0) {
			// TODO Auto-generated method stub 
			AnimationSet set = new AnimationSet(true);
			TranslateAnimation translate = new TranslateAnimation(
					Animation.RELATIVE_TO_SELF, 0.0f,		//xÖῪʼλÖÃ
					Animation.RELATIVE_TO_SELF, 0.5f,		//xÖá½áÊøλÖÃ
					Animation.RELATIVE_TO_SELF, 0.0f,		//yÖῪʼλÖÃ
					Animation.RELATIVE_TO_SELF, 0.5f);		//yÖá½áÊøλÖÃ
			translate.setDuration(3000);
			set.addAnimation(translate);
			TransDemoActivity.this.transImage.startAnimation(set);
		} 
	} 
	 
	@Override  
	public boolean onCreateOptionsMenu(Menu menu){
		menu.add(Menu.NONE,Menu.FIRST+1,1,"Return to Animation");
		return super.onCreateOptionsMenu(menu);