First, you have to create two animation resources in res/anim dir
slide_up.xml
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="@android:integer/config_mediumAnimTime"
android:fromYDelta="100%"
android:interpolator="@android:anim/accelerate_interpolator"
android:toXDelta="0">
</translate>
</set>
slide_bottom.xml
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="@android:integer/config_mediumAnimTime"
android:fromYDelta="0%p"
android:interpolator="@android:anim/accelerate_interpolator"
android:toYDelta="100%p">
</translate>
</set>
then you have to create a style
<style name="DialogAnimation">
<item name="android:windowEnterAnimation">@anim/slide_up</item>
<item name="android:windowExitAnimation">@anim/slide_bottom</item>
</style>
and add this line to your class
dialog.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation; //style id
Based in http://www.devexchanges.info/2015/10/showing-dialog-with-animation-in-android.html