how to implement right to left spinner like slider in android - android

I am working in one project in which i need spinner which include list of country for selection. when user click on country selection box i want to make a spinner like right to left slider shown in below image. so user can select any country from this slider type spinner.
How can i implement this type of custom spinner?
I know how to implement custom spinner by making a custom layout for spinner but i don't have idea how to implement this type of spinner.
Thanks in advance

Related

Android: drop down input with left and right icons

I have an android application with a drop down list which have left and right icon, I try to use spinner with left and right drawable, but does not work, what I need is look like below where user can only enter (select) from the list, which mean autocomplete text is not useful, also dropped list does not contain image, How can I achieve that?
So after better understanding your idea, this is the steps you need.
create a custom adapter (this should take the list of string you want to display and the list of icons )
list item is one edit text like
<EditText
...
android:drawableLeft="#drawable/my_icon" />
create your spinner and set the adapter
Spinner sp = findViewById(R.id.spinner);
sp.setAdapter(your custom adapter)
add the item selected listener and you are done.
More info on adapters
You need to use a custom spinner With Image And Text and a card view back ground for spinner. check this link how to add drop-down menu spinner. https://stackoverflow.com/a/24422359/2546742

How to add animation in spinner drop down menu list in android?

I can't found any solution for animated spinner. I want to translate spinner list from bottom like dialog box.
Please help me.

Customize dropdown (Picker) list in xamarin.forms

I am working on xamarin.forms. I am creating an app for android. In app I have a dropdown list. I am using Picker for it. I customized it to look like dropdown. Now I need to make the first Index item to nonselactable. Means user can not select the first item. If user click on it nothing should happen. But currently when user click on the first index dropdown gets collapsed.
One more thing that I have to add in dropdown is a Cross button at index 1. Means at index 1, on left side there will be Cross button and at center there will be text like Select item. And this whole row should not be selctable. If user click at cross button dropdown should collapsed.
Anyone have idea how I can do this?
You can use listview for dropdown and control its visibility as per need.I faced similar situation where I customized list view to enact dropdown.There is another thing I want to know about Picker.Does your picker accepts or adds string only or you could customize it to accept views or controls?

Dropdown list like Spinner in Android

I am trying to implement a dropdown list that looks like the web drop down list.. But what i could implement was only the spinner which can select an item but it doesn't give the idea of drop down..anyone who knows a work around it?..
Thanks in advance.
Web like drop down means, do you think about like lable on top "Select Value" and below a list of values ?
If yes then you can do it by creating a custom Spinner. Just create a lable, on click of it open a Dialog and bind list values to the dialog. So it will behave completely same as Spinner.
Hope it helps
Create a dummy button similar like dropdown. Just below it use invisible/gone scrollview. Inside scrollview use listview. On click, make it visible.

Multiple Selection Spinner

I have a spinner that acts like a filter for searching among several categories. But the problem is that the spinner allows only one category to select from. Is there a way to obtain a multiple selection behavior for the spinner, or what other alternatives exists?
S spinner is designed to show one item at a time. You might get away by making a spinner of checkboxes, but it will be probably an awful user experience.
I would suggest you a ListView instead and CHOICE_MODE_MULTIPLE. You can add a listview to a dialog as shown in this answer: is it possible to create listview inside dialog?
Android provides Spinner widget which has functionality similar to drop-down list. But Spinner accepts single selection. so we select only one item at a time.so We can achieve multi-select feature using a custom Pop-up Window with a multi-select list.
Pop-up window is similar to Dialogs except that a pop-up window can be positioned.
When the drop-down button is clicked a list will be displayed(as drop-down), then you can select multiple values. The selected values will be displayed in a Text box above the list.
for reference you can prefer this link:
http://asnehal.wordpress.com/2012/04/03/multi-select-drop-down-list-in-android/

Categories

Resources