Stack Overflow archive
0 score

Animate custom Dialog programmatically

score
0
question views
4.6K
license
CC BY-SA 3.0

You can use DialogFragment and set the animation in onCreateDialog(Dialog) or onStart(). Example from here:

java
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.getWindow().getAttributes().windowAnimations = R.style.detailDialogAnimation;
    return dialog;
}

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.