adapting time picker in android to individual needs - android

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

Related

How can I creat like the picture?

enter image description here
Sorry for the language of that pics, it is korean.
I want to make a planner that can help me to be noticed my plan. As you can see the picture, it is a calender, and I can add some plan depend on a user. the korean meaning is my major of Uni. So it is just some schedule.
The problem is I don't have any idea how to make like that. The way to operate this app, I hope I can add my schedule on the specific dates like the pictures and, creat the interface like that. I can slide the planner and it leads the next dates. When the plan comes to me, it could notice me by sound.
I can't find the way how to code the function 'slide' and how change the months and dates automatically by sliding?
I have ever create an application like this picture for my job interview, you can use recyclerview to show the date as horizontal. Then you should create database to showing data by date selected. Then showing the data as vertical using recyclerview after selected date. This is really simple apps.. Below is picture i have
enter image description here

Using android timepicker as a number picker

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.

How to enable setCalendarViewShown or disable calendar in datepicker post API 24

I have a project where I use datepicker for the user to confirm a date
When the user selects confirm I wish to disable the datepicker so that they can't use it again
Unfortunatelly when I do something like this:
((DatePicker)findViewById(R.id.datepicker)).enabled = false;
only the spinner part gets disabled while the calendar can still be touched and used to alter the spinner
the only solution I found is using setCalendarViewShown(false) when the user confirms and then disabling the picker
unfortunatelly this seems to be deprecated so I wish to find some way to replace it
So my question is this
Is there a way to programmatically either disable ALL parts of the DatePicker or hide the calendar?
I know it can be done through xml but I wish to use it in code
Thanks in advance for any help you can provide
You can hide the datepicker with:
datepicker.setVisibility(View.INVISIBLE);
An option that you can choose to disabled all dates less one, is combine this two lines.
datepicker.setMinDate
datepicker.setMaxDate
So after the user pick one date, set the date like the min and the max of the calendar, and with this way, the user will not be able to choose a new one.
Something like:
datepicker.setMinDate(theDatePickedByUser)
datepicker.setMaxDate(theDatePickedByUser)
It should work...

Scrolling between dates in android

I am working on a project where i have to horizontally scroll between dates.I don't want to use a date picker.I would like to have two arrows for previous and next buttons.When i click on the next button the next date should be shown.Also each time a new date is selected i want to call a web service by passing the particular date.How do i go about doing this?
I have considered using a horizontal date picker library but i am not satisfied with the solutions which i am finding on the internet.
You can use ViewPager for the same.

numeric choice field:How to let the user set a value by incrementing/decrementing the displayed value

I have a range say,1-100 and i want the user to select a value from this range.Ofcourse showing this with a spinner will be awful.I want to use the functionality of date widget,where we can pick a date by pressing a +/- sign,the longer the press ,higher the iteration speed.
I found numberpicker.java that has the code the date widget uses to get this functionality, but do i have to paste that entire code to achieve this functionality!
Here is a tutorial on how to pull out NumberPicker; I've followed it myself: http://www.quietlycoding.com/?p=5
I found numberpicker.java that has the
code the date widget uses to get this
functionality, but do i have to paste
that entire code to achieve this
functionality!
Unfortunately, yes, plus perhaps some resources as well (I have not looked at that code recently). I am not aware of anyone who has pulled that out to make a reusable component, and it is not a widget in the SDK.
Sorry!

Categories

Resources