Sunday, January 5, 2020

How to create Filling Button Android example

welcome to the example android blog code today I will introduce you to one of the basic examples of android programming.

How to create Filling Button Android example

Step 1. import libary Filling Button in file Gradient
allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}

dependencies {
  implementation 'com.github.Devit951:FillingButton:1.2'
}
Step 2. Use Filling Button in Android.
Usage a simple FillingButton
 <com.github.devit951.fillingbutton.FillingButton
        android:id="@+id/fb_first"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="BUTTON"
        android:background="@color/colorAccent"
        app:fillColor="@color/colorPrimaryDark"
        app:fillDuration="500"/>
Usage a simple InternetSensableFillingButton
 <com.github.devit951.fillingbutton.InternetSensableFillingButton
        android:id="@+id/fb_first"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="BUTTON"
        android:background="@color/colorAccent"
        app:fillColor="@color/colorPrimaryDark"
        app:fillDuration="500"/>
Using FillingButton fill directions
You can change these directions in runtime.
fillingButton.direction = RightToLeftFillingDirection();
fillingButton.direction = LeftToRightFillingDirection();
fillingButton.direction = TopToBottomFillingDirection();
fillingButton.direction = BottomToTopFillingDirection();
List of xml attributes:
app:fillColor=(color) -> Changes foreground color of filling
app:fillAlpha=(integer) -> Changes alpha of foreground color filling
app:fillDuration=(integer) -> Changes fill animation duration
How to create Filling Button Android example