How to get the Google Now searchbar into my app?
Asked Answered
E

2

7

Google has just implemented their searchbar from Google Now into the play store application as you can see in the gif below.

google searchbar in action

How can I implement this actionbar searchbar into my own app? I'd like to have the

  • style
  • hamburger animation
  • acess from toolbar button
  • microphone button
  • ripple effect on lollipop devices

What I already have is

  • the layout for a list item
  • the "old" searchview inside the actionbar

Any ideas? thanks in advance

Electorate answered 23/2, 2015 at 11:45 Comment(1)
Can you explain how you achieved this in answers section, if so it will be useful for others too.Aquinas
C
7

I created this library to do this, the only thing it does not do is the ripples, but I expect you could implement them quite easily with other resources:

https://github.com/Quinny898/PersistentSearch

Here's a gif of its use:

Use

Cumuliform answered 15/3, 2015 at 10:36 Comment(4)
I would +1 if it was uploaded to Maven!Permeability
@Quinny898: Does it need compile 'com.balysv.materialmenu:material-menu:1.x.x' ? to work on...Aquinas
For those of us that need to get searchables from the internet, this is terrible to use. All searchables need to be specified beforehand, so it appears impossible to update the list as the user types. On top of that, the inability to simply set the search results yourself for a given query is extremely annoying.Euridice
You also cannot place it to tab bar, because when you navigate back with the search bar active, it gives exception. github.com/Quinny898/PersistentSearch/issues/67Downandout
A
-3

for that you need to use material search bar. Below is link for github.

Please download code. https://github.com/ManuelPeinado/GlassActionBar https://github.com/ManuelPeinado/GlassActionBar/tree/master/samples-stock

And modify this code as you want. it will help.

Aggrade answered 15/3, 2015 at 11:12 Comment(1)
This points to a repo that has an implementation of material in the toolbar/appbar, but doesn't specify or advise on how to create the inset auto-complete persistent search bar.Ethelind

© 2022 - 2024 — McMap. All rights reserved.