Home > OS >  Android Material ListView selected item color change
Android Material ListView selected item color change

Time:04-26

My flutter app calls native select list from webview and I need to change color of the selected item (blue radio circle/dot) to green. I already use following code to change datepicker color and this works:

<style name="CustomDatePickerDialogTheme" parent="android:Theme.Material.Light.Dialog">
    <item name="android:colorAccent">@color/custom_green</item>
</style>

However the list select stays blue. How can I pls change color of the selected list item too?

enter image description here

CodePudding user response:

You need to replace android:colorAccent by android:colorControlActivated and android:Theme.Material.Light.Dialog by android:Theme.DeviceDefault.Light.Dialog:

<style name="CustomDatePickerDialogTheme" parent="android:Theme.DeviceDefault.Light.Dialog">
    <item name="android:colorControlActivated">@color/custom_green</item>
</style>
  • Related