Show download progress. Caching of images now without glide

This commit is contained in:
inorichi
2015-10-28 02:10:37 +01:00
parent 3561392d24
commit 1339e32de7
9 changed files with 249 additions and 42 deletions

View File

@@ -1,12 +1,15 @@
package eu.kanade.mangafeed.data.models;
public class Page {
import eu.kanade.mangafeed.data.helpers.NetworkHelper;
public class Page implements NetworkHelper.ProgressListener {
private int pageNumber;
private String url;
private String imageUrl;
private String imagePath;
private int status;
private int progress;
public static final int DOWNLOAD = 0;
public static final int READY = 1;
@@ -55,6 +58,10 @@ public class Page {
this.status = status;
}
public int getProgress() {
return progress;
}
@Override
public String toString() {
return "Page{" +
@@ -64,4 +71,9 @@ public class Page {
'}';
}
@Override
public void update(long bytesRead, long contentLength, boolean done) {
progress = (int) ((100 * bytesRead) / contentLength);
}
}