Ecosyste.ms: Awesome

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

https://github.com/rubensousa/RaiflatButton

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

Last synced: 1 day ago
JSON representation

A raised button that lowers down to 0dp of elevation

Lists

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.