Build a number selector dialog with AlertDialog (similar to DatePickerDialog) - android

With the DatePickerDialog we can have a fancy interface to set the date as this
(source: androidpeople.com)
I like it but it can only be used to set date so how could I build a "DatePickerDialog-like" AlertDialog?
I mean users could click on the "plus" and "minus" button as well as put in the number with keyboard.
Instead of only being able to select a single date, I'd be able to select three different numbers using the three up/down/scroll controls.

Alright, here you go, check this out. Then, check out Android Custom Dialogs, which would allow you to make your own custom dialog.
Check out this project for more information

Make an EditText field that they can edit with a button to the right which says Pick a Date and pops up a dialog. If the user selects the popup dialog, fill in the EditText with the result.

You can make a custom view with a "+" button, an edittext and a "-" button. Make a custom dialog with that view. Read about Android Custom Dialog. I hope I helped.

Related

View Dialog Alert with input text

I am a new developer and I want to build an app for a personal purpose.
I would like to receive some input when the application load up on with dialog box with textbox for input only number and 1 button "Ok".
I tried to find solutions but could not so.
Thank you for all !
Android do built in alert dialog. What you need just inflate your custom layout to create alert dialog. You don't have to add your custom button which android also provite negative(some cancel action),positive(some comfirm action),neutral(which is something work like default) button for you. Which you just need to study the link.

Android Spinner with "Radio Buttons" and Cancel button

I am looking for some guidance on how to develop the following spinner dialog shown below in the screen shot. It is present in your your android phone's Settings->Display-> Font Size option.
I have been able to implement a spinner with a simple CheckedTextView for each row.
But I am looking to develop something more specific as shown below.
I have searched all over the place for custom spinners.. but most of the show me how to add images etc to each item in the dropdown.. but nothing specific like this... where I have to "pre select" an item based on what is already chosen.
Some questions I am grappling with are....
1) Are those simple radio buttons beside a text view?
2) How would I know which item to "set selected" when I open the spinner dialog? Because my code would reside in my adapter, where my spinner would be in my Activity/Fragment.
3) How would I put a cancal button in a spinner dialog which dismisses it?
Thanks.
I had created a custom DialogFragment and inside onCreateDialog i am creating AlertDialog and showing it.
use these as reference links
http://developer.android.com/reference/android/app/DialogFragment.html
http://www.cs.dartmouth.edu/~campbell/cs65/lecture13/lecture13.html

Does anything like Combo-box in android

I need something like comboBox in android that have DisplayMember and ValueMember but for RadioButtons. I have a form that user should select one item, and I want to save the selected item in database. (the code of selected Item).
What should I do?
Take a look at Spinner,
Here's example about it http://developer.android.com/guide/topics/ui/controls/spinner.html
If u want something like radiobutton but can choose only one, use RadioGrop.
Or you can create your own dialog with radio button.
You can use setSingleChoiceItems property of alert dialog, which have radio buttons as you needed in question.
Check this example, it may help you.
Here is another link

What is the right UI pattern for an optional date?

I am using a DialogFragment to show a DatePicker to choose a date. The point is that such date could be optional, so somewhere i should display a checkbox asking to use the date or not. So how would you do such an UI ?.
So far i tried adding a checkbox on the same DialogFragment but i believe the interaction wont be very intuitive because if you choose the checkbox "no date" i would have to block or disable the datepicker but i wasn't able to do that and even if i do i am not sure if it is the best approach.
Have you seen any application solving a problem like this and how does it solve it ?
Here's how I solved it in my app: make it clear on the button that launches the DialogFragment that a date is optional.
After a date is chosen, add the option to remove it. Clicking on the "x" restores the button to look like above.

popup windows in android?

Pretty new to android so excuse me if this is a really obvious question.
Say my application has a bunch of TextViews, each one showing the attributes of a certain product (name, price, etc). I have a button next to each of these TextViews labeled "modify".
How do I make it so that when I press the modify button next to a certain attribute, a popup window with a space to enter text into comes up so that the user can enter text into this box and then have the actual attribute listing on the original page change? Actually I just need a push in the right direction with creating this popup text field... not sure if there is already some built in functionality for this or if not, what would be the best way to create this kind of thing.
Thanks.
Why not have the modify button set TextEdit.setEnabled(true); and then change focus with TextEdit.setFocus? Note that both of these are inherited from view
If you really want a dialog you might want to looking into the AlertDialog.Builder. I know you can use it with buttons and radio buttons, but I'm not sure you can get it to work with a TextView.
Use a code like this for the input popup: Android dialog input text
In the positive button handler, set your edittext content programmatically like this:
myEditText.setText(value).
As simple as that. The only difference with a standard GUI framework is that you don't retrieve the value as a result of the popup function. Instead, you must provide an action handler.

Categories

Resources