Android 标签数字自定义控件

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012162503/article/details/53502260

每天一篇开源推荐。今天给要推荐是自定义标签数字。以前总是网页上见到过那种js实现时间日历翻页的显示时间的方式。看到这个很激动,所以分享给大家.
直接看图:
这里写图片描述
这里写图片描述

使用:

Gradle:

compile ‘com.xenione.libs:tab-digit:1.0.2’

在布局中添加tabdigit,您可以通过xml设置属性,如背景或文本颜色,文本大小和填充,如图所示。

 <com.xenione.digit.TabDigit
     xmlns:digit="http://schemas.android.com/apk/res-auto"
        android:id="@+id/charView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_weight="1"
        digit:backgroundColor="#000000"
        digit:padding="10dp"
        digit:textColor="#ffffff"
        digit:textSize="60dp" />

开始动画调用开始。

tabDigit1.start();

每秒增加数字:

ViewCompat.postOnAnimationDelayed(tabDigit1, this, 1000);

@Override
    public void run() {
        tabDigit1.start();
        ViewCompat.postOnAnimationDelayed(tabDigit1, this, 1000);
    }

好了以上就是关于这个开源项目的使用和介绍。

喜欢的可以关注微信公众号,哪里每天都会推荐一篇开源项目Git项目地址在里欢迎订阅

这里写图片描述

猜你喜欢

转载自blog.csdn.net/u012162503/article/details/53502260