Search code examples
androidsearchandroid-custom-viewsearchview

Search view or dialog with submenus?


I would like to implement functionality when I click on top search toolbar in application, the few buttons appear below search input field, allowing me to select different multi selection sub-menus which are dynamically populated from API, before I submit search. What is the most common way to implement this. What android components should I use. I've tried using dialog for search view container, but I am not sure how to display sub-menu when clicked.enter image description here


Solution

  • What I ended up doing was to make FragmentDialog which pops up when search icon in top action bar is clicked. FragmentDialog has gravity set to top and hides the main content like in picure. Dialog has its own layout with searchView and filters below it. It is programatically setting UI components visibility. There is multi selection list view with fixed height, 200dp, and I populate it with different data, depending which button is clicked. They are stacked on top of each other in relative layout and I hide them on back button and Submit button clicks.