Android timepicker not showing selected am/pm color

time picker dialogue image

Time picker styles

<style name="Theme.MyTheme.TimePicker" parent="android:Widget.Material.TimePicker">
    <item name="android:timePickerMode">clock</item>
    <item name="android:headerBackground">@color/header_color</item>
    <item name="android:numbersTextColor">@color/text_color_primary</item>
    <item name="android:numbersSelectorColor">@color/accent_color</item>
    <item name="android:numbersBackgroundColor">@color/button_color</item>
    <item name="android:background">@color/button_color</item>
    <item name="android:amPmTextColor">@color/delete_color</item>

It's not highlighting whether am is selected or pm

1 answer

  • answered 2021-05-17 07:07 Sunshine

    hourOfDay will always be 24 hours. If you open the dialog with is24HourView set to false, the user does not have to process the time in 24-hour format, but Android converts it to 24-hour format when onTimeSet() is called.