How to grey out spinner in Android? - android

I use two Spinner in my App. One of them is initially disabled because I need the user to select something in the first spinner to load the content of the second one.
I would like to change the design of the second spinner to show the user that the spinner is not active, eg. grey the spinner out. How can I achieve this?
If this is not possible how would you change this dialog to make it clear to the user that she has to select something in the first spinner?

The Spinner doesn't gray out when disabled, it's a bug that we fixed in FroYo (next version of Android.)

Further to setting as disabled, I don't know any other way to grey out.
Hide the second spinner until the first has no selection.
Or until it's in disabled state, the first visible option should show text related to the required selection eg: Select a Continent first

Related

Prevent Spiner.setOnItemSelectedListener to change selection

I am developing a VIP future in my application. When user clicks on a vip option from spinner I want to show him a popup rather than changing spinner selection.
How would you solve it?
Note that I don't want to disable setOnItemSelectedListener, just for vip options.
Save your current selected position/item in a variable.
In your OnItemSelectedListener:
a. if a VIP item is selected show your popup and reset your selection to saved position.
b. else proceed normally.

get value of selected text on one tap in a textview

How can i get the text selected on one tap from a textview. I want user to have cursor to modify the automatic selection. It's fine if it's easy with edittext, i can make it non-editable.
There shouldn't be any contextual menu. Though there are solutions available but it's not complete and clear. Like when to use spannable, disabling contextual menus.

multiselect spinner without a dialog

I have a requirement where i have to implement a multiple - select spinner in android.
I want a normal spinner( which appears as a drop down) with check boxes for multiple - select option. The selected options should appear as comma separated values after selection.
I don't want a dialog to pop up when i select a spinner.I want spinner as a drop down.
I have gone through many example in the net, all examples pop up a dialog with check boxes or radio buttons for multiple select option.
Can anyone please help me with this.
Is it possible to do?
I think your best bet would be to inflate a Popup Window at the position of your text.
In that popup window you could have checkboxes for multiple select option.

Android custom spinner doesn't show the dropdown arrow

http://www.coderzheaven.com/2011/07/18/customizing-a-spinner-in-android/
In this example above, before an item is selected it shows text and dropdown arrow on the right. When the user clicks it (displaymode = dropdown?) it shows the prompt with an arrow as well. This is the behavior I want my customer spinner to do, but it's not. Primarily I want the spinner to load with wtih the normal dropdown arrow as first item. The prmpt issue I can at least get text to appear if i set displaymode=dialog on the spinner. For this post I mostly would like to get the default item issue resolved first...
Info:
I do not have android theme on my app. My parent systel is AppTheme butno parent above that. I have custom spinner like so:
List<LanguageSelection> nativeLanguagesData = getSupportedLanguageList();
LanguageSelectionListAdapter nativeAdapter = new LanguageSelectionListAdapter (this, R.layout.fragment_language_selection, nativeLanguagesData);
nativeAdapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
Spinner uxNativeLanguageSpinner = (Spinner)findViewById(R.id.uxNativeLanguageSpinner);
uxNativeLanguageSpinner.setAdapter(nativeAdapter);
and for xml:
<Spinner android:id="#+id/uxNativeLanguageSpinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:padding="0dp"
android:spinnerMode="dropdown"
android:prompt="#string/status_prompt"
android:layout_below="#id/uxNativeLanguageSelectLabel"
android:popupBackground="#android:color/transparent" />
Attached is what appears. I've scoured the internet trying to figure out why this thing doesn't show first item with arrow. I also have the android simple_spinner_dropdown_item.xml in my code base instead of referencing andorid.r.*. Any ideas? I'd like to get rid of my ugly label just above the spinner indicating the user needs to select something and instead use the common dropdown arrow on the first item. Just doesn't show when I create a custom spinner though. Again, the items in the list appear correctly it's just that i want the first item be something like in the link at the top where there is Select and iten and down arrow icon to the right indicating it's dropdown.
[http://tinypic.com/r/2r7927o/5][1]
And this is image link below shows exactly what I'm talking about. I circled in red the dropdown arrow I want to appear. I want my list to appear just like this and it except for the dropdown arrow. The actual list of items when clicked appear just fine...
tinypic.com/r/2ekj6mv/5 (sorry, can't hyperlink because i need 10 reps to post two links)

How to disable the orange highlight of checkbox when pressing

I have a checkbox in the a listview. I disabled the highlighting of listview upon pressing. Also, I disabled the focus of the listview as I have buttons in the row itself.
This worked perfect. However the problem is that the checkbox still shows Orange highlight.
Is there anyway to disable this orange highlight of the check box (whether it is through the list view or some way through the checkbox itself?
Thank you
I believe that the only way to disable the highlight of the checkbox is to create your own drawable without the on pressed xml and leave use that, but I dont think there is any checkbox xml attribute that stops highlighting.....
I cannot add comments yet, but you should be able to use the link that I provided & programatically set styles to the checkbox to hide the orange highlight, right?

Categories

Resources