Android Animation ---TranslateAnimation

时间:2022-12-29 06:02:53
if(stopBtn.getVisibility()==View.VISIBLE){
Animation animation_stop = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, 0.0f,Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 0.0f,Animation.RELATIVE_TO_PARENT, 1.0f
); Animation animation_flage = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, 0.0f,Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 0.0f,Animation.RELATIVE_TO_PARENT, 1.0f
);
animation_stop.(1000);
stopBtn.startAnimation(animation_stop);
animation_flage.setDuration(500);
flagBtn.startAnimation(animation_flage);
}