1

My project is of downloading PDF and then viewing it. https://stackoverflow.com/a/24748227/8769785

I want to show the download progress on download button!["download" button downloads from URL provided and "view "button opens up the file]

enter image description here

http://blog.rhesoft.com/2015/12/29/tutorial-android-process-button-animated-buttons-on-android-studio/

I want to add "Submit Process button" animation in the "Download button" when file is being downloaded(the progress).

My problem is I don't know how to get the animation (the progress) on download button.

In the project there is a "Filedownloader "class I've tried it with on click listener of the main activity but I still cannot get the progress on the button. I can't get progress from the URL.
I'm new to Android programming.

The code is like this

// get the button view SubmitProcessButton btnSubmit = (SubmitProcessButton) findViewById(R.id.btnSubmit);

    //start with progress = 0
    btnSubmit.setProgress(0);

    //to test the animations, when we touch the button it will start counting
    btnSubmit.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            SubmitProcessButton btn = (SubmitProcessButton) view;
            // we add 25 in the button progress each click
            if(btn.getProgress() < 100){
                btn.setProgress(btn.getProgress() + 25);
            }
        }
    });
Sahil Kashyap
  • 329
  • 2
  • 10
  • 1
    use `AsyncTask` for showing progress while downloading data from server. – Arpit Prajapati Oct 13 '17 at 08:43
  • In the project there is a filedownloader class that helps in downloading the file. I'm not sure where to add the setprogress. – Sahil Kashyap Oct 13 '17 at 09:02
  • Using a Dialog or even a TextView, tracking the progress, and updating the value, can be a solution – rmjoia Oct 13 '17 at 09:03
  • I want to see progress on the button not using a dialog box . See the second link http://blog.rhesoft.com/2015/12/29/tutorial-android-process-button-animated-buttons-on-android-studio/ – Sahil Kashyap Oct 13 '17 at 09:09
  • add `dependencies` in `gradle` file `compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'` link have all implementation details – Arpit Prajapati Oct 13 '17 at 09:12
  • Button is showing. Library is working fine. I just don't know how show the progress – Sahil Kashyap Oct 13 '17 at 09:16

0 Answers0