I created a dialog using a class AlertDialog. With custom view. I want to set an input and output animation for it. when I try to make this dialog, it transforms into a small black background. How to get an animation with the correct presentation?

final AlertDialog.Builder builder = new AlertDialog.Builder(
new android.support.v7.view.ContextThemeWrapper(getContext(), R.style.StyleDialog));
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_email, null);
builder.setView(view);
builder.setCancelable(false);
alert = builder.create();
alert.show();
These are styles
<style name="StyleDialog" parent="@android:style/Theme.Dialog">
<item name="android:windowAnimationStyle">@style/DialogAnimation</item>
</style>
<style name="DialogAnimation">
<item name="android:windowEnterAnimation">@anim/fadein</item>
<item name="android:windowExitAnimation">@anim/fadeout</item>
</style>
tried both android.support.v7.view.ContextThemeWrapper, and android.view.ContextThemeWrapper, but no difference.
Using a class android.app.AlertDialog.
source
share