Note: I have seen this and this question, and my question is not their duplicate (They do not solve my confusion).
From the Android Material Design specification for search,
The search text field is presented inside of an inset search box, ready to receive focus.
and this picture is shown:
They have also shown this kind of SearchView
s at many different places in the material design specification e.g. here
But I can't locate a guide/tutorial describing how to make something like this. From my web search, I have found this SO answer, but they are using an EditText
and ImageView
, they are not even using a SearchView
widget.
The biggest question in this case is that what about the Search Framework the Android API's provide, which is explained in this guide. This builtin search framework provides a very easy way to implement all the functionality associated with providing Search in an app, i.e. it provides a way to integrate our search with the Android system so that the system handles the user's search queries into SearchView
, delivers them to the Searchable Activity, provides a way to add the voice search and search suggestions functionality, etc.
So now in order to use the Material design "inset search box", do we have to write code to handle user input into the SearchView
/EditText
, enable voice search, recent suggestions and suggestions from app's data? or is there a way to integrate the EditText
(we are using as the search widget) with the system to have assisted search?