Xamarin : Android special style radio buttons - android

I would like to implement radio button selection for my application settings the same way it is implemented in android settings part of the android operating system.
The radio buttons I mean is displayed in images below.
Current selected value for the "Sleep" option is "After 2 Minutes of inactivity"
When User taps on "Sleep", radio buttons list appears as below to make the new selection
Any idea what is this kind of view (control)? or is it custom implemented?

I found out this could be achieved using Dialogs, there is a very nice article about doing this on this blog post
http://blog.ostebaronen.dk/2013/02/using-dialogs-in-mono-for-android.html

Related

Android : Editing values using alert dialog

In my application I currently have an xml layout that is re-used to enter information 6 times (these are turns in a game). This works fine. At the end of the round I present a screen that has a summary of each turn. I want to implement a button beside each turn to "edit" that turn. There are 3 possible things that can be edited. Ideally an alert dialog or something like a "popup" would be idea for this.
Would I be best off to have 3 buttons per "turn" for editing or is there a way to do this with a popup?
Thanks for your input on this matter.
You could list each turn and it's information with a single edit button next to each. When the edit button is pressed, create a new activity (intent) that prompts for all three pieces of data.
You have several options (and probably more I'm not thinking about). If these are in a ListView (or even if not) you could use a ContextMenu. You could have options in here to change the selected item or others. This would show a popup when the user long clicks the item
A PopupMenu can give you a similar effect that can pop up a list of options when the user clicks on a Button. Note that this requires API >= 11
You also could use an AlertDialog, as you mentioned. But just from what little I know about what you are trying to do I'm not sure this is what you would want.
Again, I don't know enough details about what you have or want but I would say that one of the first two options would suit you best. As far as one Button or multiple Buttons, that depends on the layout that will work best for your app, I suppose. You certainly could have one "Edit" Button which uses something like a PopupMenu and allows the user to choose what to edit. I hope this helped a little.

Displaying various options on a button click

I want to design a button such that when it is clicked, I get various options, from which I finally select one.
This is the same as using the concept as in text messages. For example: If we press and hold a, then we get various options for the various accents of 'a' in small buttons just above/below the button clicked.
How do I implement this in Android? Do I have to use context menus? How do I get the various options in small buttons? For that, will I have to use an OnTouchlistener?
Take a look at KeybordView.java from the 2.2_r1.1 release. That is the class that implements the keyboard handling. Pay special attention to the Handler around line 246 and the openPopupIfRequired method that displays the popup for the key if there is a long press.
Good luck.

is it possible ui pickerview like Iphone in android

i am using default android spinner for drop down selection from multiple items array ,but i see the ui in Iphone it looks cool then android then is it possible to make like iphone ui picker view in android means a dropdown would be open with bottom to top animation with a "done" button on upper side of picker view and when i choose one and press "done" then that item should be selected as in iphone...
i think android must have this feature bcoz android is more better then Iphone as in cost and newer version of android capture the whole market ,
so pls any one help me..
thanks in advance
Check the following: http://android-devblog.blogspot.com/2010/05/wheel-ui-contol-backgrounds.html
Introduction to the Wheel control
The Wheel control layouts
Scrolling the wheel control
Ideas for the future
Do not forget to check "See Also"
Usually they use Spinner in Android
If you want a wheel thingy like in iPhone use this

UI Component for Launching ListView with onActivityResult

I have this SearchMenuActivity that has a bunch of options the user can select. Two of the options fires an intent to a ListView where the user can select a value and then it reports back to the SearchMenuActivity. I also have another option like this except it allows the user to select multiply options. The problem that I am having is choosing a UI component that will launch the ListActivity and hold the results when it reports back via onActivityResult. I have come up with a couple solutions here they are ...
Solution 1
Use a button which default text is "Choose item a". This will launch the ListView and then when the user selects an item the text of the button will become the selection.
Solution 2
Use a spinner. The problem with this is that spinners do not support multi selection items. It would also complicate things because the items in the list view are being pulled from a server backend and displaying a loading message on top of the spinner would look ugly.
Solution 3
Have a clickable textview which default text is "Click here to select item". This will launch the ListView and then when the user selects an item the text of the textview will become the selection.
Right now I am implemented solution 3. The "Click here to select item" seems intrusive. Anyone have any ideas as to what is the best method to solve this problem?
Option 3 is the best
However it is not very nice for changing his choice. I think you must add a small icon to the right of the TextView that allows the user to re-select.

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