user8660130
user8660130

Reputation:

How to change timepicker theme without using TimePickerDialog

I am creating a timepicker inside a layout.I dont want to use a timepickerdialog.( i got how to change theme in timepicker dialog)

My question is how to change theme of timepicker created inside a layout. (Default theme is analog timepicker, but i want to have scrolling digital timepicker theme. i.e. theme 2 in timepickerdialog)

To change theme in this layout : enter image description here

To this theme (without dialog) : enter image description here

Upvotes: 1

Views: 1540

Answers (2)

brenthompson2
brenthompson2

Reputation: 411

As Marcos mentioned in his answer, it is now possible to set the TimePicker style back to the old layout. They implemented a timePickerMode attribute for the TimePicker which can be set in the XML layout resource file.

The TimePicker can be spinner or clock. While the DatePicker can be spinner or calander

Source: https://gitlab.com/SaberMod/pa-android-frameworks-base/commit/3053b2fdcf7486f2e2f572f9b05ce65dacdd2b4c

enter image description here

Upvotes: 0

Marcos Vasconcelos
Marcos Vasconcelos

Reputation: 18276

This is not exactly a Theme, it as a TimePickerMode

You can set in the XML with:

android:timePickerMode="spinner"

Upvotes: 2

Related Questions