I would like to set some animations to my custom dialog and I would like to do it programmatically. I know I can do it like this with xml animations:
<style name="DialogAnimation">
<item name="android:windowEnterAnimation">@anim/slide_up_dialog</item>
<item name="android:windowExitAnimation">@anim/slide_out_down</item>
</style>
Dialog imageDiaglog= new Dialog(MainActivity.this,R.style.DialogAnimation);
But I would like to do it programmatically. How can I set my programmatically created animations to Dialog's show() and hide() methods?
Thank you.
You cant because the dialog uses the style element for the animation transition. And You cannot set the style elements programmatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With