Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android search: customize suggestion layout

Tags:

I've been following along with the directions here for both SearchView and dialog implementations. Both are visible below. There are many questions on SO that focus on customizing the search box, but few that are about customizing the UI of the suggestions. (The ones that do are about color/font, the defaults for which are fine for me.) I would like to be able to widen the suggestions to take up the whole width of the screen. Is there any way to customize the width using either dialog or SearchView implementations. I'd prefer not to use a library unless that is the only option. If this is possible or easier with one of the implementations that is fine.

Here's what the dialog implementation looks like for me: enter image description here

Here's what the SearchView implementation looks like for me: enter image description here

like image 301
lf215 Avatar asked Jan 15 '16 01:01

lf215


People also ask

How do I create a search bar in XML?

To add a SearchView widget to the app bar, create a file named res/menu/options_menu. xml in your project and add the following code to the file. This code defines how to create the search item, such as the icon to use and the title of the item.


1 Answers

Here is the the repository which picks the place from google address search. It has implementation of full screen search list.

Customized Searchview

customized searchview

like image 70
ravidl Avatar answered Sep 22 '22 14:09

ravidl