Reputation: 308
I'm working on an application where i want to give user the ability of just to select Hours and AM/PM but Minutes widget should be fixed as i mentioned. I am using TimePickerDialog. Is there any possibility of doing that?
Upvotes: 1
Views: 3068
Reputation: 12399
I am not sure but you can use Android wheel with Timepicker.
and also check out this link:
http://code.google.com/p/android-wheel/
Upvotes: 2
Reputation: 40380
There's no direct way. TimePickerDialog doesn't even give you TimePicker that it's using. So you'd have to copy code from TimePickerDialog.java to suit your own needs.
Another part is that TimePicker doesn't give you access to its sub-views (id's are not public), so you'd also need to copy time_picker.xml from Android sources, and create your own TimePicker view.
Good news is that you can copy from Android source code, and both mentioned sources are rather short, so it's relatively easy task to make this work.
Upvotes: 0