Android各类交互良好动画集锦(持续更新)

来源:互联网 发布:论坛软件群发 编辑:程序博客网 时间:2024/06/15 02:34

如何让我们的客户端变得更加有趣、交互更加良好呢?加动画永远是性价比最高的手段!

下面我收集了工作中遇到的一些实现很简单,却效果很赞的动画,赶快加到你的项目中去吧!


1、菜单图标变化为箭头图标的动画

应用:知乎安卓客户端

code:https://github.com/keklikhasan/LDrawer



2、一款基础动画合集的应用

code:https://github.com/z56402344/BaseAnimation

blog:http://blog.csdn.net/duguang77/article/details/18230867 BaseAnimation是基于开源的APP,致力于收集各种动画效果(最新版本1.3)3、

3、日/夜模式换肤框架

应用:同花顺

code:https://github.com/dersoncheng/MultipleTheme


4、列表折纸效果

应用:facebook paper

blog:http://blog.jobbole.com/68689/

code:https://github.com/alexvasilkov/FoldableLayout




5、layout中布局变化时的动画

blog:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/0318/1594.html

code:https://github.com/alexvasilkov/FoldableLayout



使用方法:

在activity的xml中,设置android:animateLayoutChanges属性:

1
2
3
4
<LinearLayout android:id="@+id/container"
    android:animateLayoutChanges="true"
    ...
/>

这样,当该LinearLayout中的布局发生变化时,将会有动画效果。

什么情况下布局会在运行时改变呢,一般都是你的代码中调用了addView 之类的方法:

1
2
3
4
5
6
7
private ViewGroup mContainerView;
...
private void addItem() {
    View newView;
    ...
    mContainerView.addView(newView, 0);
}

好了,这个东西很简单,只是平时很少注意到,只要记得android自带这个功能就行了,免得到时候自己去实现


0 0
原创粉丝点击