The problem with the animation of the topic of dialogue

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?
Right view incorrect viewing after a set of topics

final AlertDialog.Builder builder = new AlertDialog.Builder(
            /*getContext()*/
            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.

+4
source share
1 answer

. ( ) , . , , , , .

android:background="@color/bg_white"

match_parent.

android:layout_width="match_parent"

+3

Source: https://habr.com/ru/post/1657076/


All Articles