Reputation: 933
I'm developping an Android app and right now I'm having an issue with a part of my UI: a TimePickerDialog. I'd like the top part of the Dialog to be orange instead of the classic
I know that I could create a custome theme, but my boss want it developp in 4.0 (API 15) so that it covers almost every device.. I don't know how to set a color with using settings covered by API 21 and up..
Upvotes: 1
Views: 990
Reputation: 25194
TimePickerDialog appearance is very different in the API levels you are testing on. The biggest redesign was probably made in Lollipop (API 21), where the default dialog has a totally different (circular) look:
If you are testing on API21+, you are probably seeing this one. The background color AFAIK can be changed by tweaking the android:color*
attributes in your theme. I'm not sure which one (could be android:colorAccent
, android:colorPrimary
...), but it is easy to determine.
However, since you are going to deploy down to API 15, and default time picker there is quite different, I would recommend using an external library to give each user the same look and feel of Lollipop.
The most used is probably this one, and allows you to style the dialog in terms of colors and much more.
Upvotes: 2
Reputation: 1320
API>=21:You can define <item name="colorPrimary">xxxx</item>
in your style of theme
API<21:Use libary for example material libary
Upvotes: 1