set progress listener state in same thread
This commit is contained in:
parent
7f3fd0af08
commit
5466689857
@ -11,11 +11,11 @@ public class DownloadListener {
|
|||||||
private final DoubleProperty percentage = new SimpleDoubleProperty(-1);
|
private final DoubleProperty percentage = new SimpleDoubleProperty(-1);
|
||||||
|
|
||||||
public void progress(double percentage, long blocksLeft, Date date) {
|
public void progress(double percentage, long blocksLeft, Date date) {
|
||||||
UserThread.execute(() -> this.percentage.set(percentage / 100d));
|
UserThread.await(() -> this.percentage.set(percentage / 100d));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doneDownload() {
|
public void doneDownload() {
|
||||||
UserThread.execute(() -> this.percentage.set(1d));
|
UserThread.await(() -> this.percentage.set(1d));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReadOnlyDoubleProperty percentageProperty() {
|
public ReadOnlyDoubleProperty percentageProperty() {
|
||||||
|
Loading…
Reference in New Issue
Block a user