Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hoang8f/android-flat-button
FButton - a flat button library for Android
https://github.com/hoang8f/android-flat-button
android fbutton
Last synced: 3 days ago
JSON representation
FButton - a flat button library for Android
- Host: GitHub
- URL: https://github.com/hoang8f/android-flat-button
- Owner: hoang8f
- License: apache-2.0
- Created: 2014-05-10T05:10:10.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-10-25T12:22:08.000Z (over 6 years ago)
- Last Synced: 2024-07-31T18:16:29.759Z (6 months ago)
- Topics: android, fbutton
- Language: Java
- Homepage:
- Size: 2.06 MB
- Stars: 1,397
- Watchers: 58
- Forks: 328
- Open Issues: 36
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- -awesome-android-ui - android-flat-button - 2.0) | <img src="/art/android-flat-button.gif" width="49%"> (Index `(light-weight pages)`)
- awesome-android-ui - android-flat-button - 2.0) | <img src="/art/android-flat-button.gif" width="49%"> (Index `(light-weight pages)`)
- awesome-android-ui - android-flat-button - 2.0) | <img src="/art/android-flat-button.gif" width="49%"> (Index)
- awesome-android-ui - https://github.com/hoang8f/android-flat-button
- awesome-android-ui - https://github.com/hoang8f/android-flat-button
- awesome - android-flat-button - FButton - a flat button library for Android (fbutton)
- awesome - android-flat-button - FButton - a flat button library for Android (fbutton)
README
FButton [![Maven Central](https://maven-badges.herokuapp.com/maven-central/info.hoang8f/fbutton/badge.svg)](https://maven-badges.herokuapp.com/maven-central/info.hoang8f/fbutton)
=======
FButton is a custom Button of Android with "Flat UI" concept. FButton's design get inspiration from [designmono](http://designmodo.github.io/Flat-UI/). This library is very small and highly customizable.Demo application on playstore:
https://play.google.com/store/apps/details?id=info.hoang8f.fbutton.demoScreenshot
----------
![](https://raw.githubusercontent.com/hoang8f/android-flat-button/master/screenshot/screenshot.gif)Including in your project
-------------------------
###Using Maven
FButton Library is pushed to [Maven Central](http://search.maven.org/#search|ga|1|fbutton), so you just need to add the following dependency to your `build.gradle`.dependencies {
compile 'info.hoang8f:fbutton:1.0.5'
}
###Manually
Copy/merge the following files to corresponding folder/file:
+ info/hoang8f/widget/FButton.java
+ res/values/attrs.xml
+ res/values/colors.xml
+ res/values/dimens.xmlCustomizable attributes
-----------------------| Attribute | default value | xml | java |
|---------------|-------------------|---------------|-------------------------------------|
| button color | #3eadeb | buttonColor | setButtonColor(int color) |
| enable shadow | true | shadowEnabled | setShadowEnabled(boolean isEnabled) |
| shadow color | Automatically generated
from button color | shadowColor | setShadowColor(int color) |
| shadow height | 4dp | shadowHeight | setShadowHeight(int height) |
| corner radius | 8dp | cornerRadius | setCornerRadius(int radius) |Usage
-----
If the default values of custom attribues did not meet your requirement, you can easily re-config that attributes. This is sample code that you can refer. you can also browse demo app for more details.### via xml (sample)
- Define `xmlns:fbutton="http://schemas.android.com/apk/res-auto"` on root of your xml file```xml
```
### via code (sample)
```java
disabledBtn.setButtonColor(getResources().getColor(R.color.color_concrete));
disabledBtn.setShadowColor(getResources().getColor(R.color.color_asbestos));
disabledBtn.setShadowEnabled(true);
disabledBtn.setShadowHeight(5);
disabledBtn.setCornerRadius(5);
```Color Swatches
--------------
For your convenience Swatches Preset by [designmono](http://designmodo.github.io/Flat-UI/) are also defined in this library
```xml
//Color Swatches provided by http://designmodo.github.io/Flat-UI/
#1abc9c
#16a085
#2ecc71
#27ae60
#3498db
#2980b9
#9b59b6
#8e44ad
#34495e
#2c3e50
#f1c40f
#f39c12
#e67e22
#d35400
#e74c3c
#c0392b
#ecf0f1
#bdc3c7
#95a5a6
#7f8c8d
```Developed By
-------
Le Van Hoang (@hoang8f)License
-------
Copyright {2014} {Le Van Hoang}
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.