詳解
前幾天看到掌上生活上一個好玩的最大額度提示的頁面,作爲程序員的我,不能光看別人做的效果,於是自己也擼了一個差不多的額度控件了。
掌上生活效果:
今天就是這麼個玩意是個主角了。好了,下面也來看看咋們要實現的結果:
使用:
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+架構視頻+面試文檔+源碼筆記,還有高級架構技術進階腦圖、Android開發面試專題資料,高級進階架構資料幫助大家學習提升進階,也節省大家在網上搜索資料的時間來學習,也可以分享給身邊好友一起學習
如果你有需要的話,可以點贊,關注我,然後加入Android開發交流羣(820198451)免費領取