设计一个银行app的最大额度控件

446 阅读1分钟

前言:

前几天看到掌上生活上一个好玩的最大额度提示的页面,作为程序员的我,不能光看别人做的效果,于是自己也撸了一个差不多的额度控件了。

掌上生活效果:

掌上生活额度控件.gif

今天就是这么个玩意是个主角了。好了,下面也来看看咋们要实现的结果:

自己撸的额度控件.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:

compile 'com.a1002326270:amountlibs:1.0'

代码传送门

更多你喜欢的文章

仿360手机助手下载按钮
仿苹果版小黄车(ofo)app主页菜单效果
设计一个银行app的最大额度控件
带你实现ViewGroup规定行数、item居中的流式布局
定制一个类似地址选择器的view
3D版翻页公告效果
一分钟搞定触手app主页酷炫滑动切换效果
快速利用RecyclerView的LayoutManager搭建流式布局
用贝塞尔曲线自己写的一个电量显示的控件
快速搞定一个自定义的日历