Text Picker Component - android

Does something exist for Android? I am looking for something equivalent to HTML's tag. I see things like NumberPicker, but I can't see any way to have a basic drop down selector.
I am aware of ListPreference, but I want to use it outside the context of a PreferenceActivity and inside arbitrary views. Anyone?

Are you looking for the spinner, maybe?

Related

Android spinner doesn't look right

I want to change the appearance of my spinner. Here's how it currently looks like
Here's how I want to look like -
Please suggest me how can I make this change?
You need to implement your own style for your spinner.
There is no another way to change somethings in it design.
How to do that, you can find as example there

Is there UISwitch settings control in Android like iOS

I took a look at the preference activity that Android use for settings. i'm looking for something like UISwitch as shown in below image, does Android have one like this.
I can see the nearest control on Android preference settings is "list preference"
There is ToggleButton and CompoundButton (one extends the other).
But those have a different default display widget then what you are looking for. However either could be used along with your own drawable resources to create the "switch" type control that you are after.
But by default no the system does not include a widget that serves this function and looks the way you want it to.
No, In Android its called ToggleButton.
But still it can be developed by extending RadioButton placed in RadioGroup and giving its UI way you wanted.

Spinner Dropdown instead of Pop up with an overlay?

I would like to have my spinner drop down just like a web form. I don't want the options to pop up in a modal style window. Is this possible, and if so, how?
The feature you're looking for is the spinnerMode attribute which has "popup" and "dropdown" modes, which you should set to "dropdown" in order to get what you want. Just add
android:spinnerMode="dropdown"
to the declaration in your layout XML.
Looks like you could just use MODE_DROPDOWN with the spinner.
This is not supported in SDK as far as I know, so I guess you will have to write your own Spinner to get this functionality. It would be nice though :)

Android - Is it possible to change a property specifically for each ListPreference entry?

I have an ordinary Android ListPreference defined in my code -
<ListPreference
android:title="Font"
android:summary="Choose the font of the reader"
android:key="fontList"
android:entries="#array/fonts"
android:entryValues="#array/fontValues">
</ListPreference>
It gives a list of a couple of different font types that the user can pick from, nothing special. What I wondering is, is there a way to set each list item's font to the font that it displays? This would be a nice feature as it would allow the user to see what they have to pick from before having to test it out.
I can't see any obvious way of doing it, or at least a way that wouldn't destroy the nice default UI.
Any help would be appreciated.
The best way to do it would be to extend the ListPreference class and implement your own preference. From memory I think you need to override the onCreateDialogView, onBindDialogView, onSetInitialValue and onDialogClosed methods. Best place to look is at the List Preference page on developer.android.com
like he said for fonts u will need custom one. But what I found that there are alot of different default android:theme="#android:style/Theme....."
try the once that are available ... there are 9-10 of them.
maybe u will get somewhat closer to what u need that extending your own custom UI.

Creating a standard Android preferences dialog

New Android developer here - I'm hoping this is simple.
I want to create a "row-based" prefs dialog, like you see in most standard apps. You know, black background, fading-line separators, bigger/bold label text for each entry, smaller description text, perhaps a checkbox/down arrow.
Is there a standard object in the Android API for this? If not, how do people usually create these?
Yes, there is a special Activity for that kind of view called PreferenceActivity.
You can find a full example here.
HTH
Thomas
EDIT: this example is a code based preference dialog, but there is another way to do with the xml layout file.

Categories

Resources