Я не силен в стилях и работе с UI, поэтому возник вопрос как поменять цвет текста в списке показываемом в AlertDialog, с помощью стилей?
Код:
Код: Выделить всё
new AlertDialog.Builder(getActivity(), R.style.CountrySelect_Dialog) //
.setSingleChoiceItems(adapter, 0),
(dialog, which) -> {
// do something
})
.create().show();
Код: Выделить всё
<style name="CountrySelect_Dialog" parent="Theme.AppCompat.Light.Dialog.Alert">
<!--item RadioButton or CheckBox color-->
<item name="colorControlNormal">@color/colorPrimary</item>
<item name="colorControlActivated">@color/colorPrimary</item>
<!--item text color-->
<item name="android:textColorAlertDialogListItem">@android:color/black</item>
<item name="textColorAlertDialogListItem">@android:color/black</item>
<item name="android:textColorPrimaryDisableOnly">@android:color/black</item>
<!--buttons color-->
<item name="colorAccent">@color/colorPrimary</item>
<!--title and message color-->
<item name="android:textColorPrimary">@color/black</item>
<!--dialog background-->
<item name="android:windowBackground">@color/white</item>
</style>