Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/rubensousa/RaiflatButton

A raised button that lowers down to 0dp of elevation
https://github.com/rubensousa/RaiflatButton

Last synced: about 1 month ago
JSON representation

A raised button that lowers down to 0dp of elevation

Awesome Lists containing this project

README

        

# RaiflatButton

A raised button that lowers down to 0dp of elevation. From my blog post: https://rubensousa.github.io/2016/10/raiflatbutton

It behaves like a normal button on APIs < 21

## Build

```groovy
dependencies {
compile 'com.github.rubensousa:raiflatbutton:0.1'
}
```

## How to

Just add the following xml to your layout:

```xml

```

If you want to resume the normal button behavior, just use:

```java
button.setFlatEnabled(false);
```

## Styling

Since RaiflatButton and RaiflatImageButton both extend AppCompatButton and AppCompatImageButton, you can reuse the same AppCompat styles.

Example:

```xml

<item name="android:colorControlNormal">?attr/colorPrimary</item>

```

## License

Copyright 2016 Rúben Sousa

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.