GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - rygelouv/Android-LoadingButton: A tiny library that lets you create a button with a loading state to improve the UX of your app

BranchesTags
Open more actions menu

Latest commit

 

History

25 Commits
25 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
androidloadingbuttonlib
androidloadingbuttonlib
 
 
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
Screenshot_1506014020.png
Screenshot_1506014020.png
 
 
Screenshot_1506014029.png
Screenshot_1506014029.png
 
 
Screenshot_1506072936.png
Screenshot_1506072936.png
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Deprecated

This project is deprecated and no longer maintained. Doing loading button is now easy with Jetpack Compose

Android LoadingButton

Android LoadingButton is very a small library that let you create a button with a loading state and that may improve the UX of your app

Use this library if you don't have enough space to show a progress loading on your screen or you dont want to bother with any of that. Android LoadingButton will take care of the loading state for you. And you know what? you can customize the look and feel of the button (almost) as you want

The library also prevent user from clicking several times on the button when you just want to trigger an event on the first click.

When the button is clicked on, it is passed to a disabled state and a small circular progressbar shows up inside the button and you have the ability to change the button text during the loading process. After the loading is done, the progress is dismissed, the button comes back to an enabled state and you can also change the text.

This library does not use any other library to do its job. So it's a very small and lightweight library

Add it to your build.gradle with:

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

and:

dependencies {
    compile 'com.github.rygelouv:Android-LoadingButton:1.2.0'
}

Create A LoadinButton

<com.github.rygelouv.androidloadingbuttonlib.LoadingButton
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/button_test"
        custom:text="Validate"
        custom:textColor="@android:color/white"
        custom:background="@drawable/button_accent_full"
        custom:textSize="12sp"
        android:layout_margin="16dp"
        custom:progressColor="@android:color/white"
        />

Available attributes :

  • text : The text for the button
  • textColor: The textColor
  • textSize: The button TextSize
  • background: The drawable background of the button
  • backgroundColor: The background color of the button
  • progressColor: The color to be set on the circular progressBar

Start and stop loading

You have two method that let you start stop the loading state of the button, for example

Using startLoading()

((LoadingButton)findViewById(R.id.button_test)).startLoading("Loading...");

Or stopLoading

((LoadingButton)findViewById(R.id.button_test)).stopLoading("Done!");

Credits

Author: Rygel Louv http://www.rygelouv.wordpress.com/

License

Copyright 2017 Rygelouv.

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.

About

A tiny library that lets you create a button with a loading state to improve the UX of your app

Topics

androidandroid-buttonandroid-libraryandroid-uibuttonloading

Resources

Readme
Activity

Stars

10 stars

Watchers

2 watching

Forks

5 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.