CheckableButton

Additional

Language
Java
Version
N/A
Created
Feb 15, 2017
Updated
Feb 27, 2017
Owner
Clemaurde Gumbs (clem44)
Contributor
Clemaurde Gumbs (clem44)
1
Activity
Badge
Generate
Download
Source code
APK file

Promotion

Checkablebutton

This is a customizable view that implements the checkable interface. You can adjust the color attributes for both checked and unchecked states.

Sample

OR download sample from repository Sample App download

What you can do

  • Adjust Border states (stroke, radius, color)
  • Background (unchecked, checked, disabled)
  • Set TextSize
  • Set Typeface
  • Adjust Text Color states (checked, unchecked)

Installation

[for now] clone the repository, and add the checkablebutton library to your project (in Android Studio as a module) (in Eclipse import the project and add as a dependency)

Usage

Include app namespace to the root element :

xmlns:app="http://schemas.android.com/apk/res-auto"

Basic usage :

Editable Attributes

xml Java Description
app:cb_checkedborderWidth setCheckedBorderWidth(int) border width in checked state
app:cb_checkedBorderColor setCheckedBorderColor(color) border color in checked state
app:cb_checkedColor setCheckedBackgroundColor(color) button color in checked state
app:cb_checkedTextColor setCheckedTextColor(color) text color in checked state
app:cb_radius setRadius(int) button corner radius
app:cb_text setText(String) button text
app:cb_textSize setDefaultTextSize(dimension) button text size
app:cb_borderWidth setBorderWidth(int) border width in uncheck state
app:cb_unCheckBorderColor setBorderColor(color) border color in uncheck state
app:cb_unCheckColor setUncheckedBackgroundColor(color) button color in uncheck state
app:cb_uncheckedTextColor setUncheckedTextColor(color) button text color in uncheck state

TODO

  • make available through jcenter
  • make provision for adding icon fonts
  • make provision for adding images
  • Add check state animations

Inspiration

Inspiration for this library came from toying around with Meydo's FancyButton https://github.com/medyo/Fancybuttons It's an awesome library and you should check his work out.

Licence

MIT http://opensource.org/licenses/MIT

Developed By

Clemaurde Gumbs

Connect @Clem on LinkedIn for new releases.