2015-05-18 30 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()));