How to implement Android Material "Insert Search Box" design using Android's built-in search framework?

Note. I have seen this and this question and my question is not a duplicate of them (they do not solve my confusion).

From the Android Material Design spec for search ,

The search text box is presented inside the insert search box, ready to receive focus.

and this image is shown:

enter image description here

They also showed this type SearchView

in many different places in the material specification for example. here

But I cannot find a manual / tutorial describing how to do something like this . From my web search I found this SO answer , but they use EditText

and ImageView

, they don't even use the widget SearchView

.

The biggest question in this case is what about the search engine offered by the Android API , which is explained in this tutorial . This built-in search framework provides a very simple way to implement all the functionality related to providing search in an application, i.e. it provides the ability to integrate our search with the Android system so that the system will process user requests for SearchView

, deliver them to the search action, provide a way to add voice search functionality, and search for offers, etc.

So now, in order to use the "search construct" in the material, do I need to write code to enter user data in SearchView

/ EditText

, enable voice searches, recent sentences and suggestions from application data? or is there a way to integrate EditText

(we use it as a search widget) for the system to help search?

+3


source to share





All Articles