mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-18 15:07:30 +01:00
Minor changes
This commit is contained in:
@@ -61,23 +61,13 @@ public class Page implements NetworkHelper.ProgressListener {
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
if (statusSubject != null)
|
||||
statusSubject.onNext(status);
|
||||
notifyStatus();
|
||||
}
|
||||
|
||||
public int getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Page{" +
|
||||
"pageNumber=" + pageNumber +
|
||||
", url='" + url + '\'' +
|
||||
", imageUrl='" + imageUrl + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(long bytesRead, long contentLength, boolean done) {
|
||||
progress = (int) ((100 * bytesRead) / contentLength);
|
||||
@@ -85,6 +75,12 @@ public class Page implements NetworkHelper.ProgressListener {
|
||||
|
||||
public void setStatusSubject(BehaviorSubject<Integer> subject) {
|
||||
this.statusSubject = subject;
|
||||
notifyStatus();
|
||||
}
|
||||
|
||||
private void notifyStatus() {
|
||||
if (statusSubject != null)
|
||||
statusSubject.onNext(status);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user