Github 在Dribbble上找到的一个清单效果 RippleCheckBox

作者: androidproject 发布时间: 2019-09-05 浏览: 2365 次 编辑

简洁,舒服,波纹动画,勾选动画,高度可控的波纹CheckBox

设计参考:dribbble

Screenshot

下载案例Apk

使用该控件的开源项目:玩清单

Dependencies

implementation 'com.github.xujiaji:ripple-checkbox:0.0.2'

Use

px: 值为像素单位;
0x: 值为颜色,如黑色0xFF000000
(0-360): 值的范围0-360

作用方法xml属性
选中状态setChecked(boolean)rcbChecked
选中状态,第二个
参数是否开启动画效果
setChecked(boolean,boolean)
是否被选中isChecked()
切换选中和未选中toggle()
中心圆半径setCenterCircleRadius(int) (px)rcbCenterCircleRadius
中心圆线条粗细setCenterCircleStrokeWidth(float)rcbCenterCircleStrokeWidth
中心圆颜色setCenterCircleColor(int) (0x)rcbCenterCircleColor
“√”的粗细setRightStrokeWidth(float)rcbRightStrokeWidth
“√”的颜色setRightColor(int) (0x)rcbRightColor
“√”的绘制时间setRippleDuration(int) (ms)rcbRightDuration
“√”的启始角度setRightStartDegree(int) (0-360)rcbRightStartDegree
“√”的中间点setRightCenterDegree(int) (0-360)rcbRightCenterDegree
“√”的结束点setRightEndDegree(int) (0-360)rcbRightEndDegree
“√”的拐角平滑度setRightCorner(int) (px)rcbRightCorner
波纹圆粗细setRippleStrokeWidth(float)rcbRippleStrokeWidth
波纹圆颜色setRippleColor(int) (0x)rcbRippleColor
波纹外边距setRippleMargin(int) (px)rcbRippleMargin
波纹扩散时长setRippleDuration(int) (ms)rcbRippleDuration

xml使用案例:

<com.xujiaji.library.RippleCheckBox    
    android:id="@+id/rippleCheckBox2"
    android:layout_width="100dp"
    android:layout_height="100dp"
    app:rcbCenterCircleColor="@color/colorPrimary"
    app:rcbCenterCircleRadius="12dp"
    app:rcbChecked="true"
    app:rcbRightColor="@color/colorPrimary"
    app:rcbRightStrokeWidth="2dp"
    app:rcbRippleColor="@color/colorPrimaryDark"
    app:rcbRippleStrokeWidth="3dp" />

License

   Copyright 2018 XuJiaji

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

项目地址:https://github.com/xujiaji/RippleCheckBox