Android flat button

    Rating: ★★★★☆
    View: 1290
    Download: 86
    Từ khóa:

    Using Maven

    FButton Library is pushed to Maven Central, so you just need to add the following dependency to yourbuild.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.xml

    Customizable 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

    via code (sample)

    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 are also defined in this library

     //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

     

    loading Đang tải...

    template được ưa chuộng