2015-05-18 34 views
2

我想的動畫添加到我的應用程序,它不一樣的Play商店:實施Play商店像動畫SearchWidget

before animation

after animation

搜索小工具從右邊增長填充整個ToolBar。我使用搜索小工具解釋here。 到目前爲止,我還沒有真正找到解決方案。也許有人有更多的經驗,可以幫助我。謝謝...

回答

2

我已經放在一起如何創建搜索欄和一些其他工具欄示例的示例。它位於FloatingSearchToolbar文件下。您需要在主工具欄上顯示視圖,並將浮動工具欄設置爲View.GONE。

https://github.com/EugeneHoran/Android-Hard-Toolbar-with-many-different-elements

至於你需要從右上角配置視圖動畫動畫。下面的視圖動畫來自google上可以找到的樣本。

https://github.com/googlesamples/android-RevealEffectBasic/

Animator animator = ViewAnimationUtils.createCircularReveal(
       View v **Your view here**, 
       0, 
       0, 
       0, 
       (float) Math.hypot(shape.getWidth(), shape.getHeight()));