Как изменить фрейм Base.Theme.AppCompat.Dialog.Alert? - PullRequest
0 голосов
/ 17 апреля 2019

У меня странная проблема, мои диалоги предупреждений стали выглядеть так: enter image description here Я

Не знаю, почему - в предыдущих версиях они выглядели нормально - без этой странной, широкой черной рамки. Как это изменить? Мой код стиля:

    <style name="AlertDialogStyle" parent="Base.Theme.AppCompat.Dialog.Alert"> <!-- This theme has black settings icons -->
    <item name="colorPrimary">@color/app_mint</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/blackColor</item>
    <item name="android:windowBackground">@color/whiteColor</item>
    <item name="android:background">@color/app_main_color</item>
    <item name="android:fontFamily">@font/dosis_light</item>
    <!-- active thumb & track color (30% transparency) -->
    <item name="colorControlActivated">#46bdbf</item>
    <item name="android:titleTextStyle">@style/eventInfoTextLarge</item>
    <!-- inactive thumb color -->
    <item name="colorSwitchThumbNormal">#f1f1f1</item>
    <!-- inactive track color (30% transparency) -->
    <item name="android:colorForeground">#42221f1f</item>
    <item name="android:textColorPrimary">@color/blackColor</item>
</style>

И код в действии:

    private void showDeleteConfirmationDialog() {
    // Create an AlertDialog.Builder and set the message, and click listeners
    // for the positive and negative buttons on the dialog.
    AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AlertDialogStyle);
    builder.setMessage(livewind.example.andro.liveWind.R.string.delete_dialog_msg);
    builder.setPositiveButton(livewind.example.andro.liveWind.R.string.delete, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            // Windsurfer clicked the "Delete" button, so delete the event and remove 5 points.
            deleteEvent();
        }
    });
    builder.setNegativeButton(livewind.example.andro.liveWind.R.string.cancel, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            // Windsurfer clicked the "Cancel" button, so dismiss the dialog
            // and continue editing.
            if (dialog != null) {
                dialog.dismiss();
            }
        }
    });

    // Create and show the AlertDialog
    AlertDialog alertDialog = builder.create();
    alertDialog.show();
}

Спасибо за помощь.

...