![4f969cfd217802f980952eeb3a5cd17a.png](https://i-blog.csdnimg.cn/blog_migrate/7dd669cd87773cb4e85a539e6b2f4c5f.jpeg)
详解
前几天看到掌上生活上一个好玩的最大额度提示的页面,作为程序员的我,不能光看别人做的效果,于是自己也撸了一个差不多的额度控件了。
第一次看我文章的小伙伴可以关注一下我,顺便关注一下我的专栏:Android高级开发架构,每天更新各种技术干货,分享更多最热程序员圈内事。Android高级开发架构zhuanlan.zhihu.com
![766316d4af26c8f22f46959a33a561f9.png](https://i-blog.csdnimg.cn/blog_migrate/44f59e7802002f5946393053568c2b7a.jpeg)
掌上生活效果:
![73f3680460d7743d487a2610b5cbfdb7.gif](https://i-blog.csdnimg.cn/blog_migrate/593f1433ec79fba9872e4d0b96c51114.gif)
今天就是这么个玩意是个主角了。好了,下面也来看看咱们要实现的结果:
![ae9dc2d15ecd8986f28e7ad1c8b9beb0.gif](https://i-blog.csdnimg.cn/blog_migrate/b0269947738cf8623acc65f31600e178.gif)
使用:
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" />
这里就定义了三个属性:
hint_text:提示文字
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'
源码地址:
https://github.com/xiangcman/AmountView-master
Android学习PDF+架构视频+面试文档+源码笔记shimo.im最后
感谢大家能耐着性子,看完这篇文章。
在这里我也分享一份自己收录整理的Android学习PDF+架构视频+面试文档+源码笔记,还有高级架构技术进阶脑图、Android开发面试专题资料,高级进阶架构资料帮助大家学习提升进阶,也节省大家在网上搜索资料的时间来学习,也可以分享给身边好友一起学习
如果你有需要的话,可以点赞+转发,关注我,然后私信我【进阶】我发给你
![d039ffe4345f703e62056c6322520831.png](https://i-blog.csdnimg.cn/blog_migrate/15686c8a5e162105a256585fb011ac85.jpeg)
![4556ee66af2ba5b5fb94b341e9f1eada.png](https://i-blog.csdnimg.cn/blog_migrate/e8b6d6fffe14d6e21ed533e2335fa18e.jpeg)
“做程序员,圈子很重要”因为有了圈子可以让你少走弯路,拓宽人脉,拓展思路,学习他人失败和成功的经验,获取最新经验与信息,抱团取暖等!圈子的高度决定人生的高度!
我建立了一个纯程序员的交流社群(无广告),有想法加入的朋友可以私信我【社群】