抛硬币动画--我的第一个开源项目
2016-01-18 16:51
786 查看
前言
最近在项目里要实现一个抛硬币的效果,在网上搜了搜,没有找到很合适的开源项目。这时想到了郭霖博客里的签名:每当你在感叹,如果有这样一个东西就好了的时候,请注意,其实这是你的机会。所以就有了它 https://github.com/binbincivil/TossImageView使用
布局
<com.bbcivil.toss.TossImageView android:id="@+id/tiv" android:layout_width="100dp" android:layout_height="100dp"/>
播放动画
mTossImageView.startToss();
配置动画
如果默认的动画效果不能满足你的需求,TossImageView支持xml或者java代码两种方式配置动画:<com.bbcivil.toss.TossImageView android:id="@+id/tiv" android:layout_width="100dp" android:layout_height="100dp" android:layout_centerInParent="true" toss:circleCount="@integer/toss_default_circleCount" toss:duration="@integer/toss_default_duration" toss:frontDrawable="@drawable/front" toss:result="front" toss:reverseDrawable="@drawable/reverse" toss:startOffset="@integer/toss_default_startOffset" toss:xAxisDirection="clockwise" toss:yAxisDirection="clockwise" toss:zAxisDirection="clockwise" />
和其他动画混合使用
TossImageView提供了方法,可以实现和其他View Animation一起使用。可以轻松实现如下的效果
鼓励鼓励我
https://github.com/binbincivil/TossImageView这是我人生的第一次。。。写开源项目,代码是看了一遍又一遍,最后才战战兢兢的点了push。如果这个项目能对你有所帮助,我将会感到莫大的欣慰。如果你能在github上为我点个star,我将会感激不尽的。
相关文章推荐
- TiDB 点滴
- 用JS获取地址栏参数的方法
- public,protect,private,
- Android LayoutInflater深度解析
- C++11特性:auto关键字
- C++11特性:decltype关键字
- QT信号槽机制
- 非常规手法求1+2+…+n的值。
- C++ 自由存储区是否等价于堆?
- GC基本算法及C++GC机制
- 智能指针小分析
- 关于传值与传引用的讨论
- C++编译期多态与运行期多态
- OpenWRT的ipk编译方法
- 团队项目最终评审平均分
- python数组的使用
- 【Java】List集合按数量分组
- 纯JavaScript基于notie.js插件实现消息提示特效
- iptables 学习笔记总结
- 工厂方法模式与抽象工厂模式