Giter VIP home page Giter VIP logo

Comments (3)

dmytrodanylyk avatar dmytrodanylyk commented on August 17, 2024

the button does not animate when click

You mean when you are setting progress second time it's not visible?

Can you tell me following:

  • are you using PROGRESS or ENDLESS mode?
  • before onComplete() method is called what is bSendPin.getProgress() value?

from android-process-button.

shaunidiot avatar shaunidiot commented on August 17, 2024

Hi,

Thanks for the reply!
Here's an example video ; http://www.gfycat.com/BrilliantThoughtfulKawala
Yes, the progress is not visible on the second time.

I'm using ENDLESS mode
This is the code used before the onComplete is called. res is a string result of a web request.

if (res.equals("success")) { //if web request is successful
    button.setProgress(100); // set to 100% -> which means button's text = "Success"
   } else {
    button.setProgress(-1);
    button.setText(res); // set button's text to web request fail text to display to user
   }
 mListener.onComplete();

And on the listener's onComplete function

 public void onComplete() {
                if (!bSendPin.getText().toString().equals("Success")) { // if there's an error message
                    bSendPin.setEnabled(true); //reenable button
                    bSendPin.setProgress(0); //set progress to 0
                } else {
                    Toast.makeText(MainActivity.this, "SUCCESS", Toast.LENGTH_SHORT).show();
                }
            }

from android-process-button.

shaunidiot avatar shaunidiot commented on August 17, 2024

I've "fixed" it by changing the value of mProgress to 0, else the progress is 100 when I re-enable the button. Is it feasible to implement a function to re-enable the button automatically in the library or is this on the programmers' end to do it (set the progress back to 0 etc.)?

Thank you so much!

from android-process-button.

Related Issues (20)

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.