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]
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);
}
}
});