Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dialog.java #419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.gc.materialdesign.views.ButtonFlat;

public class Dialog extends android.app.Dialog{

boolean dismissInProgress = false;
Context context;
View view;
View backView;
Expand Down Expand Up @@ -187,32 +187,36 @@ public void setOnCancelButtonClickListener(

@Override
public void dismiss() {
Animation anim = AnimationUtils.loadAnimation(context, R.anim.dialog_main_hide_amination);
anim.setAnimationListener(new AnimationListener() {

@Override
public void onAnimationStart(Animation animation) {
}

@Override
public void onAnimationRepeat(Animation animation) {
}

@Override
public void onAnimationEnd(Animation animation) {
view.post(new Runnable() {
@Override
public void run() {
Dialog.super.dismiss();
}
});

}
});
Animation backAnim = AnimationUtils.loadAnimation(context, R.anim.dialog_root_hide_amin);

view.startAnimation(anim);
backView.startAnimation(backAnim);
if (!dismissInProgress) {
dismissInProgress = true;
Animation anim = AnimationUtils.loadAnimation(context, R.anim.dialog_main_hide_amination);
anim.setAnimationListener(new AnimationListener() {

@Override
public void onAnimationStart(Animation animation) {
}

@Override
public void onAnimationRepeat(Animation animation) {
}

@Override
public void onAnimationEnd(Animation animation) {
dismissInProgress = false;
view.post(new Runnable() {
@Override
public void run() {
Dialog.super.dismiss();
}
});

}
});
Animation backAnim = AnimationUtils.loadAnimation(context, R.anim.dialog_root_hide_amin);

view.startAnimation(anim);
backView.startAnimation(backAnim);
}
}


Expand Down