Giter Site home page Giter Site logo

progress-button's Introduction

progress-button

This is a Android Button with a progress bar over it. This is useful when you do something that takes a while like networking, etc.

##Usage Import it via gradle

  compile 'com.alirezaahmadi:progress-button:1.1.0'

You can add this to view like this

<com.alirezaahmadi.progressbutton.ProgressButtonComponent
    android:id="@+id/testBtn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:buttonText="test name"
    app:buttonTextSize="32dp"
    app:buttonTextColor="@color/text_color"
    app:progressColor="#ffffff"
    app:progressWidth="3dp"
    android:background="@drawable/btn_background"
    android:padding="16dp"
    />
       

In java code you can set view state to inProgress whenever you want like this

@Override
public void onClick(View view) {
    if(view.getId() == R.id.testBtn){
        progressButtonComponent.setInProgress(true);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                progressButtonComponent.setInProgress(false);
            }
        }, 3000);
    }
}

##Caution This library is created by extending RelativeLayout and not Button and may not provide all the functionalities a normal Button has so using codes like this will cause exception.

(Button) findViewbyId(R.id.my-progress-button);

##Thanks Special thanks to https://github.com/pnikosis/materialish-progress as i used this for progress bar in this library.

progress-button's People

Watchers

Naseem Akhtar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.