0

When I use TimePickerDialog in Android >= 5 all is OK. But in Android 4.4 text color for not chosen items is white (or transparent). What's wrong?

enter image description here

styles.xml

<!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

using

public class PickTimeDialog {

    public interface Callback {
        void onTimePicked(String timeStr);
    }

    private TimePickerDialog timePickerDialog;

    public PickTimeDialog(Context context, Callback callback) {
        timePickerDialog = new TimePickerDialog(context,
                (view, hourOfDay, minute) -> {
                    String timeStr = DateUtils.format(hourOfDay, minute, DateUtils.TIME_FORMAT);
                    callback.onTimePicked(timeStr);
        }, 0, 0, true);
    }

    public void show() {
        timePickerDialog.show();
    }
}
xskit
  • 421
  • 1
  • 8
  • 20
  • 1
    Please also include the code where you create the `TimePickerDialog` – ishmaelMakitla May 04 '16 at 13:34
  • done (class PickTimeDialog) – xskit May 04 '16 at 13:38
  • 1
    Try specifying the Theme when creating your picker dialog - use the constructor that accepts theme parameter. `DatePickerDialog(context, R.style.AppTheme, callback)...` – ishmaelMakitla May 04 '16 at 13:41
  • 1
    Please check out the selected answer [here](http://stackoverflow.com/questions/28738089/change-datepicker-dialog-color-for-android-5-0), and also check discussions/suggestions [here](http://stackoverflow.com/questions/11077530/how-to-change-the-default-color-of-datepicker-and-timepicker-dialog-in-android) as well as [here](http://stackoverflow.com/questions/30964343/how-to-change-the-default-color-scheme-timepicker-dialog-fragment). – ishmaelMakitla May 04 '16 at 14:14
  • there is no result – xskit May 04 '16 at 14:31
  • 1
    Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/111039/discussion-between-ishmaelmakitla-and-xskit). – ishmaelMakitla May 04 '16 at 18:34

0 Answers0