laoyuyu
2018-06-15 21:00:07 +08:00
parent 82f91eb56c
commit ac5e236664
18 changed files with 73 additions and 38 deletions

View File

@@ -89,7 +89,7 @@ public class DownloadGroupActivity extends BaseActivity<ActivityDownloadGroupBin
.start();
break;
case R.id.stop:
Aria.download(this).load(mUrls).stop();
Aria.download(this).loadGroup(mUrls).stop();
break;
case R.id.cancel:
//Aria.download(this).load(mUrls).cancel(true);
@@ -133,7 +133,12 @@ public class DownloadGroupActivity extends BaseActivity<ActivityDownloadGroupBin
}
@DownloadGroup.onTaskRunning() protected void running(DownloadGroupTask task) {
Log.d(TAG, "group running");
Log.d(TAG, "group running, p = "
+ task.getPercent()
+ ", speed = "
+ task.getConvertSpeed()
+ "current_p = "
+ task.getCurrentProgress());
getBinding().setProgress(task.getPercent());
getBinding().setSpeed(task.getConvertSpeed());
mChildList.updateChildProgress(task.getEntity().getSubEntities());

View File

@@ -65,12 +65,17 @@ public class AnyRunnModule {
void start(String url) {
mUrl = url;
String path = Environment.getExternalStorageDirectory().getPath() + "/abcds.exe";
File file = new File(path);
if (file.exists()) {
file.delete();
}
Aria.download(this)
.load(url)
//.addHeader("Accept-Encoding", "gzip")
.setRequestMode(RequestEnum.GET)
.setUrlProxy(Proxy.NO_PROXY)
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/abcds.exe")
.setFilePath(path)
//.resetState()
.start();
//String[] urls = new String[] {