How to get the Google Now searchbar into my app?

瘦欲@ 提交于 2019-12-20 10:47:38

问题


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

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


回答1:


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:




回答2:


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.



来源:https://stackoverflow.com/questions/28673056/how-to-get-the-google-now-searchbar-into-my-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!