Skip to content

FarhamHosseini/ProgressButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProgressButton

Show or hide Loading on button such as ProgressBar.

Usage

Set up the dependency

  1. Add the mavenCentral() repository to your root build.gradle at the end of repositories:
allprojects {
	repositories {
		...
		mavenCentral()
	}
}
  1. Add the ProgressButton dependency in the build.gradle:
implementation group: 'com.apachat', name: 'progressbutton-android', version: '1.0.7'

Badge:

Maven Central

How it works

Sometimes we need to show loading on button as per requirement we don't want to block full screen view with default loading or dialogs. So you can use this library to show loading on button hide loading after that when you want.

How to setup

Its very easy to use ProgressButton as its a custom button and contain all features of android default button with some extra attributes.

Add it to a layout

<layout
     ...
    <com.apachat.progressbutton.core.ProgressButton
            android:id="@+id/progressButton"
            android:layout_width="200dp"
            android:layout_height="51dp"
            android:layout_marginTop="20dp"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:text="Hello World!"
            android:textColor="@color/white"
            app:pb_buttonColor="@color/colorPrimary"
            app:pb_isShadowEnable="true"
            app:pb_isCircular="true"
            app:pb_loaderColor="@color/colorAccent"
            app:pb_shadowColor="@color/colorPrimaryDark"
            app:pb_shadowHeight="5dp" />
       ...
</layout>

Methods to use in View Class

You can easily use to show loading on button click by calling showLoading(); and hide loading by calling hideLoading(); whenever you want to stop loading.

Show Loading

ProgressButton progressButton = (ProgressButton) findViewById(R.id.progressButton); progressButton.showLoading();

Hide Loading

ProgressButton progressButton = (ProgressButton) findViewById(R.id.progressButton); progressButton.hideLoading();

Bugs and Feedback

For bugs, feature requests, and discussion please use GitHub Issues.