一个精致带感的打钩小动画

TickView

项目地址:ChengangFeng/TickView 

简介:一个精致带感的打钩小动画

更多:作者   提 Bug   

标签:

一个精致的打钩小动画,模仿轻芒杂志标记已读的动画

效果图

使用

Step 1

allprojects {
  repositories {
    ...
    maven { url 'https://www.jitpack.io' }
  }
}

Step 2

dependencies {
    compile 'com.github.ChengangFeng:TickView:v1.0.2'
}

Step 3

xml 配置

<com.github.chengang.library.TickView
    android:id="@+id/tick_view_accent"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:check_base_color="@color/colorAccent"
    app:rate="normal" />

点击事件回调

tickView.setOnCheckedChangeListener(new TickView.OnCheckedChangeListener() {
    @Override
    public void onCheckedChanged(TickView tickView, boolean isCheck) {
        //do something here
    }
});

模拟点击效果

tickView.toggle();

手动更改控件状态

tickView.setChecked(true);

思路实现

优化思路

猜你喜欢

转载自blog.csdn.net/u014608640/article/details/84643163