Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steelkiwi/centeredcontentbutton
Centered Content Button is Android library which contains button-like and toggle button-like components with centered content - icon and/or text.
https://github.com/steelkiwi/centeredcontentbutton
Last synced: 7 days ago
JSON representation
Centered Content Button is Android library which contains button-like and toggle button-like components with centered content - icon and/or text.
- Host: GitHub
- URL: https://github.com/steelkiwi/centeredcontentbutton
- Owner: steelkiwi
- License: apache-2.0
- Created: 2013-09-19T14:18:18.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-15T11:03:08.000Z (about 11 years ago)
- Last Synced: 2023-08-03T09:38:15.015Z (over 1 year ago)
- Language: Java
- Size: 617 KB
- Stars: 16
- Watchers: 6
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Centered Content Button Library
=======================================Centered Content Button is Android library which contains following classes:
- CenteredContentButton
- Represents a button-like component with centered content - icon and/or text.
Background and icon resources, text value, text style and typeface can be set in the XML layout file or with set() methods.See /demo folder for example how to use.
- CenteredContentToggleButton
- Represents a toggle button-like component with centered content - icon and/or text.
Background selector is used to represent selected and not selected states of a button.See /toggle-demo folder for example how to use.
- CenteredContentToggleGroup
- Represents a group for toggle button-like components (like RadioGroup for RadioButtons).
Can be used to simulate tabs behavior.See /tabs-demo folder for example how to use.
How to use
----------
A button component is defined in the XML layout file as followed:
```xml
```
* android:layout_width - you can also set size in dp
* android:layout_height - you can also set size in dp
* ccb:btnBg - background drawable (or selector)
* ccb:btnIcon - button icon
* ccb:btnText - button text
* ccb:btnTextStyle - button text style
A group of toggle buttons is defined in the XML layout file as followed:
```xml
```
* ccb:btnBg - background selector
* ccb:btnChecked - set button to "checked" state
In order to use components attributes add a namespace definition to the root layout in your XML layout file:
```xml
xmlns:ccb="http://schemas.android.com/apk/res-auto"
```
Button background and icon resources, text value, text style and typeface can also be defined with set() methods.