My general problem is that I need to set a preference with a number from a finite list using something like a step size of 10 (or whatever). I know I can do this with the classic NumberPicker but I like the look of the TimePicker and was wondering if anyone has some idea of how to customize it to act as a more of a general number picker. It's probably fine with 12 values but it would be even better if you could have an arbitrary number of choices. Maybe there's a different widget that would get me something similar...
Here's a crude mockup of a dialog example
see How to create a number picker dialog?
you could set the timepicker to 24h format and get 1-24 range. But I wouldn't recommend it. The Bottom line is you pretty much need to design the xml and java class for your custom number picker.
Related
I have a calendar view and I want to customize individual days (say change color) under specific condition that I have. For example change the color of days if day is odd number or even number. Is there a way to do that?
I think maybe you can just modify android calender source code from here : https://github.com/android/platform_packages_apps_calendar
As I know, if you use calenderview, you can just use it, not modify it
I am sure,I think my question is something different in android.I goggled 100s of sites i saw the date picker in android, all are same type, no one give the different date picker.
My Task is to design custom date picker. Please find this below screen shot.
https://docs.google.com/file/d/0B_c-SDSO63obZzVreHpmdnZBYzg/edit?usp=sharing
For that I goggled, I didn't find any solution. I think, For android solutions this is the best site.
coming to my date picker it is totally dialog box. In that red symbol,name,close mark,submit i can do it. But i want that sun,man,tue,web In red color and on the top month and year. In below dates with green color picker. so Please tell me how can I do that task.
All advices are accepted.
Thanks&Regards
Shankar
Clite
I can only suggest how I would have gone for such a calendar. By the UI it is clear that it has to come as a pop-up or to better say a dialog. Now you have to google the opensource calendars if any or just using the calendar API provided by java you can get the calendar for a month year etc. and move it across previous month by normal java function calls.
Now that you have got the data to populate in your calendar. You have to design a custom layout xml create ~30-40 boxes or a grid with dynamic textviews or a webview with <table>, <tr>, <td> the choice is completely yours.
AFAIK
If you can't find anything opensource then I would suggest you should do these things by the suggested approach.
I'm creating an app which will have a countdown timer.
I would like to choose the time by TimePicker (after clicking a button).
I would like to have only a few choices. It is 15,30,45 minutes.
Unfortunately TimePicker is not exactly what I wanted.
Is there any possibility to edit TimePicker, to show only a custom set of values?
Thanks in advance!
Rather than showing a TimePicker for choosing 15, 30 or 45 minutes, you should use a Spinner
If you don't know how to use a spinner tell me in the comment!
It is possible to do that using reflection. I am not sure if it is a right thing to do though.
Here's an example of how it could be done. Line 60 replaces the 24-hour spinner with 12 Japanese symbols in android earlier than 3.0. Lines 74-76 do the same for 3.0+.
It might be better to create your own dialog with spinners, but for my code I wanted to mimic the native TimePicker.
I need to get alarm start/end time from the user and would like to use the time picker dialog. However I checked the tutorial and I don't understand what I have to do to adapt it to my needs - like for instance in the alarm on Android with different TextViews and buttons.
I have not found a tutorial that shows how to adapt the time picker - could you please provide a link or an example on how to adapt the time picker.
CLARIFICATION:
All I need is the dialog that allows the user to provide hour and minute in the way the time picker does - everything else I would like to adapt. Eg add another TextView which changes value, depending on the hour + minute the user just selected (without pressing OK). I do not want the AM/PM field.
Or is it simply the best to just put two individualized number pickers or number sliders (if this exists) next to each other ? Then I need to handle all details like range etc myself! Possibly there is a sample for this somewhere?
Many thanks
I am looking around for a number picker in a 10-key style, ideally as a dialog... but called as an activity is fine too. I want to offer the user an interface that is a little more directed toward entering $ for an invoice amount field. I have seen adjustments to the date and time pickers but they looked awkward for this application. I have also seem someone call the built-in calculator, which would be fine, but I don't know how they were capturing a returned value (if they were). Any ideas? Yes, I can fall back to a regular edit field and the standard android keyboard... I was just hoping for something a little more slick. Thanks!
Have you tried setting the attribute android:numeric on the TextView?
TextView documentation