fixed download manager cancel

This commit is contained in:
Arndt 2015-10-15 08:32:40 +02:00
parent b8bb99173f
commit 20212963ba

View file

@ -57,7 +57,7 @@ public class BInstallerView extends View
private String baseDir; private String baseDir;
private boolean isDownloading = false; private boolean isDownloading = false;
private transient boolean downloadCanceled = false; private volatile boolean downloadCanceled = false;
private long currentDownloadSize; private long currentDownloadSize;
private String currentDownloadFile = ""; private String currentDownloadFile = "";
@ -133,7 +133,7 @@ public class BInstallerView extends View
} }
if ( tidx_min != -1 ) if ( tidx_min != -1 )
{ {
tileStatus[tidx_min] = 0; tileStatus[tidx_min] ^= tileStatus[tidx_min] & MASK_SELECTED_RD5;
startDownload( tidx_min ); startDownload( tidx_min );
} }
} }
@ -258,12 +258,6 @@ public class BInstallerView extends View
tilesVisible = false; tilesVisible = false;
} }
public void stopInstaller() {
downloadCanceled = true;
bmp = null;
tileStatus = null;
}
public BInstallerView(Context context) { public BInstallerView(Context context) {
super(context); super(context);
@ -514,7 +508,7 @@ float tx, ty;
} }
// download button? // download button?
if ( rd5Tiles > 0 && event.getX() > imgwOrig - btnw*scaleOrig && event.getY() > imghOrig-btnh*scaleOrig ) if ( ( rd5Tiles > 0 || isDownloading ) && event.getX() > imgwOrig - btnw*scaleOrig && event.getY() > imghOrig-btnh*scaleOrig )
{ {
toggleDownload(); toggleDownload();
invalidate(); invalidate();