详解
前几天看到掌上生活上一个好玩的最大额度提示的页面,作为程序员的我,不能光看别人做的效果,于是自己也撸了一个差不多的额度控件了。
@H_403_12@掌上生活效果:今天就是这么个玩意是个主角了。好了,下面也来看看咋们要实现的结果:
xml:
<com.xiangcheng.amount.AmountView android:id="@+id/amount_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" app:hint_text="Max Amount" app:max_amount="30000" app:shadow_color="#FFD700" />
这里就定义了三个属性:
max_amount:最大的额度
shadow_color:背景颜色
code:
//代码中设置额度 public void setAmount(int amount) { }
//启动动画 public void start() { }
maven dependence:
<dependency> <groupId>com.a1002326270</groupId> <artifactId>amountlibs</artifactId> <version>1.0</version> <type>pom</type> </dependency>
gradle dependence:
implementation ‘com.a1002326270:amountlibs:1.0‘@H_403_12@源码地址:
https://github.com/xiangcman/AmountView-master
@H_403_12@最后感谢大家能耐着性子,看完这篇文章。
在这里我也分享一份自己收录整理的Android学习PDF+架构视频+面试文档+源码笔记,还有高级架构技术进阶脑图、Android开发面试专题资料,高级进阶架构资料帮助大家学习提升进阶,也节省大家在网上搜索资料的时间来学习,也可以分享给身边好友一起学习
如果你有需要的话,可以点赞,关注我,然后加入Android开发交流群(820198451)免费领取