所以现在默认情况下,当对话框被解雇时,它正在做这个放大淡出效果dialog.dismiss();
我怎样才能将它覆盖为我自己的动画?
AlphaAnimation fadeOut = new AlphaAnimation(1, 0);
fadeOut.setDuration(600);
view.setAnimation(fadeOut);
view.startAnimation(fadeOut);
编辑:
感谢下面的答案,我能够弄清楚。我没有修改解雇,而是做了动画,然后像这样解雇了它。
public void fadeOutHUD(View view) {
AlphaAnimation fadeOut = new AlphaAnimation(1, 0);
fadeOut.setDuration(800);
view.setAnimation(fadeOut);
view.startAnimation(fadeOut);
fadeOut.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
dismiss();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
}
public void dismissHUD() {
fadeOutHUD(findViewById(R.id.progressHud));
}
并这样称呼它dialog.dismissHUD();