-1

enter image description here

I have a SeachView object.

What I want to implement is what is presented from the picture here at the top.

I want to keep it simple and only load data from an Arraylist of Strings, not need for some fancy local storage fetching etc - leave that for me to deal with it later.

How can I add to my SearchView a dropdown suggestions as seen in the picture that is being filled with data from an Arraylist?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Alon Shlider
  • 1,187
  • 1
  • 16
  • 46
  • 1
    you could do it with autocompletetextview https://medium.com/@droidbyme/autocomplete-textview-in-android-a1bf5fc112f6 – denvercoder9 Nov 20 '19 at 10:53
  • 1
    use autoCompleteTextView and implement Filterable. [ https://stackoverflow.com/questions/16782288/autocompletetextview-with-custom-adapter-and-filter][1] – bidhu Nov 20 '19 at 11:04
  • How can I add the magnifying glass icon to autocompletetextview ? – Alon Shlider Nov 20 '19 at 11:48
  • plus, there are some functionalities of SearchViews that I need more - the "search" button in the keyboard, the "X" button in the edittext and the `setOnQueryTextListener` method. Is there a way to get the functionality that I need using SearchView? – Alon Shlider Nov 20 '19 at 12:00

1 Answers1

0

You can simply add recycler view below your navigation bar. Initially, the visibility of this recycler view will be GONE but when the user starts typing you can simply set its visibility to visible.