Dropdown list of buttons - android

First I want to mention that I am a beginner in android.
Basically I am trying to implement the Microsoft's calculator in android.For now I am implementing only the UI.
Is it possible to make a dropdown list of buttons?
Like in this picture when you select Bitwise a list of buttons appears.Also is it possible Bitwise also to be a button and if not to act like one?

Yes, it is possible.
you must use a custom spinner.
By custom spinner, you can add any layout you like to your spinner; so you can create a layout that has a button.
You can search for Android custom spinner and learn about that.
I will give you an educational link about that.
How to add Custom Spinner in android?

Related

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

how can I add a spinner in a category preference

I need to add a spinner in my PreferenceCategory with a text on its right is there a way to do that? plus when I create a checkboxpreference the text is on the left how can I make the text appear on the right?
thanks.
If you want to use these built in controls you have to use them the way they are designed. Its also good because it fits the android design that users expect.
If you need to do something different, just make your own preference screen. Its just a list view with click handlers, not too hard to make on your own. Then you get the styling you want.

something like dropdown in a android app?

I'm searching for a widget in a android app where the user can select a item from a specific list. it's only possible to select one and the list is defined by the app.
it's like a dropdown. I can't use a simple listView because I need at least 4 of there controls on one page. so what is a good solution?
I think, you are looking for something like Spinners
Spinners is what you are looking for.
You can use Spinner in android for dropdown.or you can use AlertDialog as like that of drodown.For using spinner read this.For using AlertDialog read this

Something similar to .net panels in Android

I apologize for yet, another beginner question. I have a .Net background and this is my first time with Android.
In .Net I could use panels to show/hide controls, and I'm looking to do the samething in Android.
This is what I'm trying to do: There will be two radio buttons on the top: Basic and Advanced. Depending on the radio button clicked, I want to show the relevant form. How can I possibly accomplish this?
Thanks!
you can use setvisibility for the view
you have to register for CheckedChangeListener using setOnCheckedChangeListener for the radiogroup
In the onCheckedChanged
you have to do
hidingView.setVisibiliity(View.GONE)
showingview.setVisibility(View.VISIBLE)
You could just put each one of your forms into its own FrameLayout and then use a conditional statement that checks for the state of the radio buttons. I dont know what kind of format your forms are in but Im imagining theyre probably a series of edittext boxes and TextViews. It would probably be easiest if you set it up your xml layout, declare the view to place one form and then add the other forms content to the FrameLayout dynamically in java according to the radio buttons pressed.

Custom Spinner Pop Up

I would like to modify the spinner pop up dialog . I would like to implement my own custom spinner pop up.
Is it possible or not ? Can anyone provide me solution to implement custom spinner pop up ?
This is an effort of uniformity for my various pop ups in my application.
see this here is the simple example which gives you the idea how to build custom spinner...
http://android-er.blogspot.com/2010/12/custom-spinner-with-icon.html

Categories

Resources