Skip to content

Commit

Permalink
Rename the dismiss() to dismissWithAnimation()
Browse files Browse the repository at this point in the history
So that we can still use the default super.dismiss() to sync-ly dismiss the dialog
  • Loading branch information
UglyTroLL committed Nov 24, 2014
1 parent e26eaeb commit e033cd7
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,10 @@ protected void onStart() {
playAnimation();
}

public void dismiss() {
/**
* The real Dialog.dismiss() will be invoked async-ly after the animation finishes.
*/
public void dismissWithAnimation() {
mConfirmButton.startAnimation(mOverlayOutAnim);
mDialogView.startAnimation(mModalOutAnim);
}
Expand All @@ -316,13 +319,13 @@ public void onClick(View v) {
if (mCancelClickListener != null) {
mCancelClickListener.onClick(SweetAlertDialog.this);
} else {
dismiss();
dismissWithAnimation();
}
} else if (v.getId() == R.id.confirm_button) {
if (mConfirmClickListener != null) {
mConfirmClickListener.onClick(SweetAlertDialog.this);
} else {
dismiss();
dismissWithAnimation();
}
}
}
Expand Down

0 comments on commit e033cd7

Please sign in to comment.