This commit is contained in:
@ -22,8 +22,8 @@ dependencies {
|
||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.android.support:appcompat-v7:23.1.1'
|
||||
compile project(':AriaCompiler')
|
||||
// compile project(':AriaAnnotations')
|
||||
// compile project(':AriaCompiler')
|
||||
compile project(':AriaAnnotations')
|
||||
}
|
||||
apply from: 'bintray-release.gradle'
|
||||
//apply from: 'jcenter.gradle'
|
||||
//apply from: 'bintray-release.gradle'
|
@ -2,6 +2,7 @@ package com.arialyy.aria.core.command;
|
||||
|
||||
import android.util.Log;
|
||||
import com.arialyy.aria.core.download.DownloadEntity;
|
||||
import com.arialyy.aria.core.download.DownloadTaskEntity;
|
||||
import com.arialyy.aria.core.inf.AbsTaskEntity;
|
||||
import com.arialyy.aria.core.inf.IEntity;
|
||||
import com.arialyy.aria.core.inf.ITask;
|
||||
@ -40,7 +41,8 @@ final class ResumeAllCmd<T extends AbsTaskEntity> extends AbsCmd<T> {
|
||||
private ITask createTask(DownloadEntity entity) {
|
||||
ITask task = mQueue.getTask(entity);
|
||||
if (task == null) {
|
||||
task = mQueue.createTask(mTargetName, mEntity);
|
||||
DownloadTaskEntity taskEntity = new DownloadTaskEntity(entity);
|
||||
task = mQueue.createTask(mTargetName, taskEntity);
|
||||
} else {
|
||||
Log.w(TAG, "添加命令执行失败,【该任务已经存在】");
|
||||
}
|
||||
|
@ -144,6 +144,8 @@ public class DownloadReceiver implements IReceiver<DownloadEntity> {
|
||||
|
||||
/**
|
||||
* 恢复所有正在下载的任务
|
||||
* 1.如果执行队列没有满,则开始下载任务,直到执行队列满
|
||||
* 2.如果队列执行队列已经满了,则将所有任务添加到等待队列中
|
||||
*/
|
||||
public void resumeAllTask() {
|
||||
final AriaManager ariaManager = AriaManager.getInstance(AriaManager.APP);
|
||||
|
@ -352,6 +352,9 @@ public class CommonUtil {
|
||||
* @param size file.length() 获取文件大小
|
||||
*/
|
||||
public static String formatFileSize(double size) {
|
||||
if (size < 0) {
|
||||
return "0kb";
|
||||
}
|
||||
double kiloByte = size / 1024;
|
||||
if (kiloByte < 1) {
|
||||
return size + "b";
|
||||
|
Reference in New Issue
Block a user