3.1.7
This commit is contained in:
@ -23,8 +23,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: 'jcenter.gradle'
|
||||
|
||||
|
16
README.md
16
README.md
@ -27,12 +27,8 @@ Aria怎样使用?
|
||||
[](https://bintray.com/arialyy/maven/AriaApi/_latestVersion)
|
||||
[](https://bintray.com/arialyy/maven/AriaCompiler/_latestVersion)
|
||||
```java
|
||||
<<<<<<< HEAD
|
||||
compile 'com.arialyy.aria:Aria:3.1.6'
|
||||
=======
|
||||
compile 'com.arialyy.aria:Aria: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
|
||||
public void onNoSupportBreakPoint(DownloadTask task) {}
|
||||
|
||||
<<<<<<< HEAD
|
||||
```java
|
||||
@Override protected void onResume() {
|
||||
super.onResume();
|
||||
Aria.download(this).addSchedulerListener(new MySchedulerListener());
|
||||
}
|
||||
=======
|
||||
>>>>>>> v_3.0
|
||||
```
|
||||
|
||||
### 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.6 取消任务时onTaskCancel回调两次的bug
|
||||
>>>>>>> v_3.0
|
||||
+ v_3.1.5 优化代码结构,增加优先下载任务功能。
|
||||
+ v_3.1.4 修复快速切换,暂停、恢复功能时,概率性出现的重新下载问题,添加onPre()回调,onPre()用于请求地址之前执行界面UI更新操作。
|
||||
+ v_3.1.0 添加Aria配置文件,优化代码
|
||||
|
@ -282,67 +282,4 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
|
||||
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) {
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user