一个精致的打钩小动画,模仿轻芒杂志标记已读的动画
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
dependencies {
compile 'com.github.ChengangFeng:TickView:v1.0.2'
}
<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);