This is a simple CheckBox for Android with cool animation.
dependencies {
...
compile 'com.example.checkbox:checkbox:1.02'
}
** in project build.gradle **
maven {
url 'https://dl.bintray.com/bigmercu/maven/'
}
...
** in module build.gradle **
dependencies {
...
compile 'com.bigmercu.bCheckbox:BCheckbox:1.05'
}
|attr|format| |---|:---|:---:| |stroke_width|dimension| |color_before|color| |color_after|color| |check_text|string| |check_style|fork/hook| |show_border|boolean|
<com.bigmercu.bCheckbox.BBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
or
<com.example.checkbox.BBox
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:check_text="算法"
app:show_border="true"
app:color_after="@color/colorAccent"
app:color_before="@color/colorPrimary"
app:check_style="hook"
android:id="@+id/BBox3" />
mBBox = (BBox) findViewById(R.id.BBox3);
mBBox.setChecked(true);
mBBox.setOnCheckedChangeListener(new BBox.OnCheckedChangeListener() {
@Override
public void onChange(boolean checked) {
Toast.makeText(getApplicationContext(),"click",Toast.LENGTH_SHORT).show();
}
});
- 新浪微博@bigmercu
- Email: [email protected]
##License
Copyright 2016 bigmercu
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.