pull/330/head
AriaLyy 8 years ago
commit 7e58047678
  1. 4
      Aria/build.gradle
  2. 16
      README.md
  3. 63
      app/src/main/java/com/arialyy/simple/download/SingleTaskActivity.java
  4. 0
      aria/src/main/AndroidManifest.xml
  5. 0
      aria/src/main/java/com/arialyy/aria/core/Configuration.java
  6. 67
      aria/src/main/java/com/arialyy/aria/core/scheduler/AbsSchedulerListener.java
  7. 0
      aria/src/main/java/com/arialyy/aria/core/upload/UploadTask.java
  8. 0
      aria/src/main/java/com/arialyy/aria/core/upload/UploadTaskEntity.java
  9. 0
      aria/src/main/java/com/arialyy/aria/exception/FileException.java

@ -23,8 +23,8 @@ dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs') compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:appcompat-v7:23.1.1'
// compile project(':AriaCompiler') compile project(':AriaCompiler')
compile project(':AriaAnnotations') // compile project(':AriaAnnotations')
} }
//apply from: 'jcenter.gradle' //apply from: 'jcenter.gradle'

@ -27,12 +27,8 @@ Aria怎样使用?
[![Download](https://api.bintray.com/packages/arialyy/maven/AriaApi/images/download.svg)](https://bintray.com/arialyy/maven/AriaApi/_latestVersion) [![Download](https://api.bintray.com/packages/arialyy/maven/AriaApi/images/download.svg)](https://bintray.com/arialyy/maven/AriaApi/_latestVersion)
[![Download](https://api.bintray.com/packages/arialyy/maven/AriaCompiler/images/download.svg)](https://bintray.com/arialyy/maven/AriaCompiler/_latestVersion) [![Download](https://api.bintray.com/packages/arialyy/maven/AriaCompiler/images/download.svg)](https://bintray.com/arialyy/maven/AriaCompiler/_latestVersion)
```java ```java
<<<<<<< HEAD
compile 'com.arialyy.aria:Aria:3.1.6'
=======
compile 'com.arialyy.aria:Aria:3.1.7' compile 'com.arialyy.aria:Aria:3.1.7'
annotationProcessor 'com.arialyy.aria:aria-compiler:3.1.7' annotationProcessor 'com.arialyy.aria:aria-compiler:3.1.7'
>>>>>>> v_3.0
``` ```
## 示例 ## 示例
@ -140,14 +136,6 @@ annotationProcessor 'com.arialyy.aria:aria-compiler:3.1.7'
@Download.onNoSupportBreakPoint @Download.onNoSupportBreakPoint
public void onNoSupportBreakPoint(DownloadTask task) {} public void onNoSupportBreakPoint(DownloadTask task) {}
<<<<<<< HEAD
```java
@Override protected void onResume() {
super.onResume();
Aria.download(this).addSchedulerListener(new MySchedulerListener());
}
=======
>>>>>>> v_3.0
``` ```
### Aria参数配置 ### Aria参数配置
@ -316,12 +304,8 @@ Aria.download(this).load(DOWNLOAD_URL).setDownloadPath(PATH).setHighestPriority(
## 开发日志 ## 开发日志
<<<<<<< HEAD
+ v_3.1.6 [取消任务时onTaskCancel回调两次的bug](https://github.com/AriaLyy/Aria/issues/33)
=======
+ v_3.1.7 修复某些文件下载不了的bug,增加apt注解方法,事件获取更加简单了 + v_3.1.7 修复某些文件下载不了的bug,增加apt注解方法,事件获取更加简单了
+ v_3.1.6 取消任务时onTaskCancel回调两次的bug + v_3.1.6 取消任务时onTaskCancel回调两次的bug
>>>>>>> v_3.0
+ v_3.1.5 优化代码结构,增加优先下载任务功能。 + v_3.1.5 优化代码结构,增加优先下载任务功能。
+ v_3.1.4 修复快速切换,暂停、恢复功能时,概率性出现的重新下载问题,添加onPre()回调,onPre()用于请求地址之前执行界面UI更新操作。 + v_3.1.4 修复快速切换,暂停、恢复功能时,概率性出现的重新下载问题,添加onPre()回调,onPre()用于请求地址之前执行界面UI更新操作。
+ v_3.1.0 添加Aria配置文件,优化代码 + v_3.1.0 添加Aria配置文件,优化代码

@ -282,67 +282,4 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
break; break;
} }
} }
<<<<<<< HEAD
private class MySchedulerListener extends Aria.DownloadSchedulerListener {
@Override public void onPre(DownloadTask task) {
if (task.getKey().equals(DOWNLOAD_URL)) {
mUpdateHandler.obtainMessage(DOWNLOAD_PRE, task.getDownloadEntity().getFileSize())
.sendToTarget();
}
}
@Override public void onNoSupportBreakPoint(DownloadTask task) {
super.onNoSupportBreakPoint(task);
T.showShort(SingleTaskActivity.this, "该下载链接不支持断点");
}
@Override public void onTaskStart(DownloadTask task) {
//通过下载地址可以判断任务是否是你指定的任务
if (task.getKey().equals(DOWNLOAD_URL)) {
mUpdateHandler.obtainMessage(DOWNLOAD_START, task.getDownloadEntity().getFileSize())
.sendToTarget();
}
}
@Override public void onTaskResume(DownloadTask task) {
if (task.getKey().equals(DOWNLOAD_URL)) {
mUpdateHandler.obtainMessage(DOWNLOAD_START, task.getFileSize()).sendToTarget();
}
}
@Override public void onTaskStop(DownloadTask task) {
if (task.getKey().equals(DOWNLOAD_URL)) {
mUpdateHandler.sendEmptyMessage(DOWNLOAD_STOP);
}
}
@Override public void onTaskCancel(DownloadTask task) {
if (task.getKey().equals(DOWNLOAD_URL)) {
mUpdateHandler.sendEmptyMessage(DOWNLOAD_CANCEL);
L.d(TAG, "task__cancel");
}
}
@Override public void onTaskFail(DownloadTask task) {
if (task.getKey().equals(DOWNLOAD_URL)) {
mUpdateHandler.sendEmptyMessage(DOWNLOAD_FAILE);
}
}
@Override public void onTaskComplete(DownloadTask task) {
if (task.getKey().equals(DOWNLOAD_URL)) {
mUpdateHandler.sendEmptyMessage(DOWNLOAD_COMPLETE);
}
}
@Override public void onTaskRunning(DownloadTask task) {
if (task.getKey().equals(DOWNLOAD_URL)) {
mUpdateHandler.obtainMessage(DOWNLOAD_RUNNING, task).sendToTarget();
}
}
}
=======
>>>>>>> v_3.0
} }

@ -0,0 +1,67 @@
/*
* Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.arialyy.aria.core.scheduler;
import com.arialyy.aria.core.inf.ITask;
/**
* Created by Aria.Lao on 2017/6/7.
*/
public class AbsSchedulerListener<TASK extends ITask> implements ISchedulerListener<TASK> {
@Override public void onPre(TASK task) {
}
@Override public void onTaskPre(TASK task) {
}
@Override public void onTaskResume(TASK task) {
}
@Override public void onTaskStart(TASK task) {
}
@Override public void onTaskStop(TASK task) {
}
@Override public void onTaskCancel(TASK task) {
}
@Override public void onTaskFail(TASK task) {
}
@Override public void onTaskComplete(TASK task) {
}
@Override public void onTaskRunning(TASK task) {
}
public void onNoSupportBreakPoint(TASK task) {
}
public void setListener(Object obj) {
}
}
Loading…
Cancel
Save