Creating a TimePickerDialog with a custom style in Android

I would like to create a DialogFragment or Dialog with a TimePicker inside, as in the following figure. The problem is that my application uses the Holo.Light theme, and then it sets me up from there, but I can not find anything related to TimePicker .

enter image description here

Can I assign a TimePicker style TimePicker custom style? I did not find anything in the official documentation for Android.

The following image is what I got so far, but nonetheless the TimePicker not in the color I want (it is the same orange as in the header separator), even in the XML that I have as follows:

 <TimePicker android:id="@+id/picker" style="@style/Checkmark" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" /> 

enter image description here

Any ideas please? Thank you very much in advance

+4
source share
1 answer

I use HoloEverywhere https://github.com/Prototik/HoloEverywhere to have Holo elements embedded in Android 2.2 and higher. You can easily style the collector if you use this library as it is open source and you get full access to the code.

You probably don't need the whole library, it may be useful to get only TimePicker elements (beware of hellish hell)

+3
source

Source: https://habr.com/ru/post/1496777/


All Articles