Skip to content

devtrongle/ProgressButton

Repository files navigation

ProgressButton

NOTE

Project that uses the support library of Android-SpinKit

Usage

Step 1. Add the JitPack repository to your build file

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.JamesRyan97:ProgressButton: latest-version'
}

Using View

  1. Add ProgressButton into your activity
<james.ryan.progressbutton.ProgressButton
       android:id="@+id/btnActive"
       android:paddingBottom="4dp"
       android:layout_centerInParent="true"
       android:layout_marginStart="20dp"
       android:layout_marginEnd="20dp"
       android:layout_marginBottom="20dp"
       android:layout_width="match_parent"
       android:layout_height="42dp"
       app:loading_color="#fff"
       app:text_color="#fff"
       app:text="Active"
       app:text_error="Failed activation"
       app:text_loading="Activating"
       app:text_success="Successful activation"
       app:text_all_caps="true"
       app:loading_style="FadingCircle"
       android:background="@drawable/bg_button_red"/>
  1. Click event
final ProgressButton progressButton = findViewById(R.id.btnActive);
progressButton.setOnClickListener(new ProgressButton.OnClickListener() {
           @Override
           public void onClick(View v) {
               //Your Code
           }
       });
  1. Update the status of the button
 progressButton.onCompleted(isSuccess);
  1. Reset the initial state of the button
progressButton.resetState();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages