Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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.