Progressbutton

Android custom progress button with anim and transition to another activity/fragment
Alternatives To Progressbutton
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Mgswipetablecell6,906
293a year ago32May 17, 2022129mitObjective-C
An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions.
Material Sheet Fab1,547
865 years ago9December 31, 201515mitJava
Android library that provides the floating action button to sheet transition from Google's Material Design.
Transitionbutton1,320
23a year ago7October 22, 201819mitSwift
UIButton sublass for loading and transition animation.
Jthamburgerbutton361
58 years ago6April 25, 20151mitObjective-C
An animated hamburger button for iOS.
Screenmanager352
10 months ago2mitC#
Flexible way to manage screens with transitions for Unity
Handorgel25126a year ago23July 19, 20206mitJavaScript
Accessible W3C conform accordion written in ES6.
Framer Viewnavigationcontroller219
7 years ago3mitCoffeeScript
A simple controller for FramerJS that allows you to transition between views with just a couple lines of code.
Hamburgerbutton195
6 years ago2Objective-C
LBHamburgerButton is an iOS control that displays 3 lines (hamburger) and other icon (back, close...) without using image. It has a beautiful, clean and smooth transition between 2 state like Google Material Design or "close button" of Paper app.
Qzcirclesegue193
5 years agomitSwift
QZCircleSegue is written in Swift and it is a beatiful transition between circular-shapped buttons and your View Controller.
Morpherings120
a year agoSCSS
CSS Animations that make buttons morph into forms.
Alternatives To Progressbutton
Select To Compare


Alternative Project Comparisons
Readme

ProgressButton

Legacy

Original prototype Dribbble link

iOS library

Sample project available in app directory

Checkout MotionLayout solution

Not needed to add library dependency

ProgressButton using MotionLayout

Overview

Custom button with progress anim and transition to another activity/fragment

Better to use with AsyncTask or Handler() or RxJava doOnSuccess()

Installation

Add jitpack repo in your project.gradle

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

Add implementation in your app.gradle

dependencies {
  implementation 'com.github.muramrr:ProgressButton:1.2'
}

Usage XML

<com.mmdev.progressbuttonlib.ProgressButton
    android:layout_height="50dp"
    android:layout_width="match_parent"
    android:id="@+id/btn_done"
    android:layout_margin="20dp"
    app:backgroundColor="#2962FF"
    app:progressColor="@android:color/holo_orange_light"
    app:text="DONE!"
    app:textColor="@android:color/black" />

Available attributes:

  • app:backgroundColor - Button background color (default = Color.BLUE)
  • app:progressColor - Progress loading color (default = Color.WHITE)
  • app:text - Button text (default = "")
  • app:textColor - Button text color (default = Color.WHITE)

Code

Java

private ProgressButton pb_button;
...
pb_button = findViewById(R.id.btn_done);
pb_button.setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick (View v) {
    pb_button.startAnim(); //start progress button loading
    /**
    * manual stop animation method
    * you can handle it with Runnable()
    * delay progress loading in Handler()
    * or you can use it with AsyncTask class
    * startAnim() in preExecute
    * stopAnim() in postExecute
    */
    new Handler().postDelayed(() -> pb_button.stopAnim(this::startSecondActivity), 760);
  }
});

Kotlin

val progressButton = findViewById<ProgressButton>(R.id.btn_done)
progressButton.setOnClickListener {
	progressButton.startAnim()
	Handler().postDelayed({ progressButton.stopAnim { startMainActivity() }}, 2000)
}

RxJava 2 + kotlin

disposables.add(signUp()
            .observeOn(AndroidSchedulers.mainThread())
	    .doOnSubscribe { progressButton.startAnim() }
	    .doOnSuccess { progressButton.stopAnim { startMainActivity() } }
            .subscribe({
	    		//your code
                       },
                       {
                       Toast.makeText(this,"error",
                                      Toast.LENGTH_SHORT).show()
                       }))

Public methods:

  • setProgressButtonDuration(int time) - Set button transformation speed in ms (default = 200)
  • setProgressAnimationSpeed(int time) - Set progress spinner speed in ms (default = 400)
  • setScaleAnimationDuration(int time) - Set scale transformation speed in ms (default = 300)
  • setBgColor(int color) - Set button background color
  • setProColor(int color) - Set progress color
  • setButtonText(String str) - Set button text
  • setTextColor(int color) - Set button text color

License

MIT License

Copyright (c) 2019 Andrii Kovalchuk

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Popular Transition Projects
Popular Button Projects
Popular User Interface Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Java
Button
Animation
Progress
Transition
Fragments
Rxjava
Custom View
Custom Elements
Activity Fragment