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: about 1 month ago
JSON representation
A raised button that lowers down to 0dp of elevation
- Host: GitHub
- URL: https://github.com/rubensousa/RaiflatButton
- Owner: rubensousa
- License: apache-2.0
- Created: 2016-10-29T14:45:57.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-28T17:15:50.000Z (almost 8 years ago)
- Last Synced: 2024-11-07T12:45:11.323Z (about 1 month ago)
- Language: Java
- Homepage:
- Size: 1.3 MB
- Stars: 330
- Watchers: 13
- Forks: 39
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-github-android-ui - RaiflatButton - 凸起的按钮 (按钮)
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.