Android Question SearchView "dropdown" function

Rusty

Well-Known Member
Licensed User
Is there a way to add Searchview to a layout i.e. 100dip high; then when the view is touched, resize it to i.e. 500dip (or any percent etc.); allow the user to type/select result; then restore the SearchView back to its original height and display the selected value?
This is similar to a combobox with dropdown in Visual Studio...

I'd like to have multiple instances of SearchView; display cities list in one, states list in the other.
When the user gets focus on the cities, it would expand; allow entry; then contract back.
Focus would then move to the States list; when focus is gotten there, it would expand; allow entry; then contract back.

Any advice/example would be greatly appreciated :)
Rusty
 

MitchBu

Active Member
Licensed User
You can emulate a combobox dropdown with a button and a listview.

Make the listview front (use BringToFront if needed), and invisible.

When you need to view the dropdown, make it visible.

Use the ItemClick event to detect the user choice and hide the listview.

Since there is no Esc key to remove the dropdown, clicking on the button again should hide the dropdown when no choice is made.
 
Top