Skip to content

Commit

Permalink
chore(upgrade): upgrade the version name(1.0.0->1.0.1) code(27->28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacksgong committed Sep 5, 2016
1 parent e58e30d commit 3593c46
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 8 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

> [ Change log in english](https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG.md)
## Version 1.0.1

_2016-09-05_

#### 新接口

> 如果你之前有使用现在已经被申明弃用的方法`BaseDownloadTask#ready()`, 只需要简单的将它迁移为:`BaseDownloadTask#asInQueueTask():InQueueTask`并且调用`InQueueTask#enqueue()`
- 添加`BaseDownloadTask#asInQueueTask():InQueueTask`并申明弃用`BaseDownloadTask#ready()`: 申明当前任务是队列任务,并且可以通过`InQueueTask#enqueue()`将当前任务放入全局队列以便于启动队列任务的时候,能被队列收编执行。`InQueueTask#enqueue()`中的操作与`BaseDownloadTask#ready()`相同, 我们通过这个方式封装`ready()`是为了让你更加清晰的了解: 只有当前任务是队列任务,才需要调用该方法;如果当前任务不是队列任务,而却调用了这个方法,你将会收到一个异常(具体异常的原因可以移步到`DownloadTask#start`报的异常信息进行了解).

#### 修复

- 修复: 当有使用相同`listener`对象的多个孤立任务与队列任务在不同的线程中同时被启动时(后),有可能会遇到IllegalStateException异常的问题. Closes #282 .

## Version 1.0.0

_2016-08-21_
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

> [中文迭代日志](https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG-ZH.md)
## Version 1.0.1

_2016-09-05_

#### New Interfaces

> If you used `BaseDownloadTask#ready()` which is a deprecated method now, just migrate it to `BaseDownloadTask#asInQueueTask():InQueueTask` and `InQueueTask#enqueue()`.
- Add `BaseDownloadTask#asInQueueTask():InQueueTask` and Deprecated `BaseDownloadTask#ready()`: Declare the task is a queue task, what will be assembled by a queue which makes up of the same `listener` task and there is a method `InQueueTask#enqueue()` to enqueue this task to the global queue to ready for being assembled by the queue. The operation of method `InQueueTask#enqueue()` is the same to the Deprecated method `BaseDownloadTask#ready()`, we wrap the `ready()` method in this way just want you to know clearly: Only if the task belongs to a queue, you need to invoke this method otherwise if this task is an isolated task but you invoke this method, it's wrong and you will receive an exception(More detail reason please move to the exception thrown in `DownloadTask#start`).

#### Fix

- Fix: Maybe occur an IllegalStateException when there are several isolated tasks and queues with the same `listener` object, and they are started in the different thread simultaneously. Closes #282 .

## Version 1.0.0

_2016-08-21_
Expand Down
9 changes: 5 additions & 4 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Android 文件下载引擎,稳定、高效、简单易用
在项目中引用:

```
compile 'com.liulishuo.filedownloader:library:1.0.0'
compile 'com.liulishuo.filedownloader:library:1.0.1'
```

> 如果是eclipse引入jar包参考: [这里](https://github.com/lingochamp/FileDownloader/issues/212#issuecomment-232240415)
Expand Down Expand Up @@ -179,7 +179,8 @@ final FileDownloadListener queueTarget = new FileDownloadListener() {
// FileDownloader.getImpl().create(url)
// .setCallbackProgressTimes(0) // 由于是队列任务, 这里是我们假设了现在不需要每个任务都回调`FileDownloadListener#progress`, 我们只关系每个任务是否完成, 所以这里这样设置可以很有效的减少ipc.
// .setListener(queueTarget)
// .ready();
// .asInQueueTask()
// .enqueue();
//}
//if(serial){
Expand Down Expand Up @@ -285,8 +286,8 @@ if (parallel) {
| addHeader(line:String) | 添加自定义的请求头参数,需要注意的是内部为了断点续传,在判断断点续传有效时会自动添加上(`If-Match``Range`参数),请勿重复添加导致400或其他错误
| setMinIntervalUpdateSpeed(minIntervalUpdateSpeedMs:int) | 设置下载中刷新下载速度的最小间隔
| removeAllHeaders(name:String) | 删除由自定义添加上去请求参数为`{name}`的所有键对
| ready(void) | 用于队列下载的单任务的结束符(见上面:启动多任务下载的案例)
| start(void) | 启动下载任务
| asInQueueTask(void):InQueueTask | 申明该任务将会是队列任务中的一个任务,并且转化为`InQueueTask`,之后可以调用`InQueueTask#enqueue`将该任务入队以便于接下来启动队列任务时,可以将该任务收编到队列中
| start(void) | 启动孤立的下载任务
| pause(void) | 暂停下载任务(也可以理解为停止下载,但是在start的时候默认会断点续传)
| getId(void):int | 获取唯一Id(内部通过url与path生成)
| getUrl(void):String | 获取下载连接
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FileDownloader is installed by adding the following dependency to your `build.gr

```groovy
dependencies {
compile 'com.liulishuo.filedownloader:library:1.0.0'
compile 'com.liulishuo.filedownloader:library:1.0.1'
}
```

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NAME=1.0.0
VERSION_CODE=27
VERSION_NAME=1.0.1
VERSION_CODE=28
BUILD_TOOLS_VERSION=24.0.2
COMPILE_SDK_VERSION=24

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ interface InQueueTask {
* Enqueue the task to the global queue, what is the only way for the task to ready to be
* assembled by a queue.
* <p>
* <strong>Note:</strong> Only if the task will belong to a queue, you need invoke this
* <strong>Note:</strong> Only if this task belongs to a queue, you need to invoke this
* method.
*
* @return the download task identify.
Expand Down

0 comments on commit 3593c46

Please sign in to comment.