Skip to content

Commit

Permalink
chore(upgrade): upgrade version name(0.3.1->0.3.2) code(22->23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacksgong committed Jun 12, 2016
1 parent 9802921 commit cc60e82
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 7 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

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

_2016-06-12_

#### 新接口

- 添加 `BaseDownloadTask#setCallbackProgressMinInterval`: 用于设置每个'progress'方法回调的间隔。 Closes #167 .
- 添加 `FileDownloader#setMaxNetworkThreadCount`: 用于设置最大同时下载的数目(最大同时运行的网络线程)。 Closes #168.
- 添加 `FileDownloader#init(Context,OkHttpClientCustomMaker,int)`: 在下载服务初始化的时候接受设置最大同时下载数目(最大同时运行的网络线程)。 Closes #168.

#### 性能与提高

- 提高稳定性: 确保每个'progress'回调方法之间的最小间隔是5ms,防止对于一个任务而言'progress'回调太频繁导致'防掉帧队列'极速膨胀导致各类Action响应都延时。 Closes #167.
- 提高实用性: 在请求的操作需要在下载服务中完成,但是还未连接上下载服务时,输出对应的'warn'级别的日志。
- 提高性能: 使用`SparseArray`代替`HashMap`用于索引所有的`FileDownloadModel`

#### 修复

- 修复(crash): 修复在某个下载任务开始下载时,发现任务的状态不正确的情况下,输出日志中提供了错误的参数类型导致的Crash。
- 修复(强制重新下载): 修复错误逻辑导致设置`BaseDownloadTask#setForceReDownload(true)`并且任务已经下载完成会促发'warn'的回调,却没有进行强制重新下载的Bug。
- 修复(class-type): 保持`SocketTimeOutException`的Class类型,不再关心`Throwable``message`是否为空。

#### 其他

- 所依赖的okhttp从`3.2.0`升到`3.3.1`

## Version 0.3.1

_2016-05-19_
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

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

_2016-06-12_

#### New Interfaces

- Add `BaseDownloadTask#setCallbackProgressMinInterval`: Set the minimum time interval between each callback of 'progress'. Closes #167.
- Add `FileDownloader#setMaxNetworkThreadCount`: Change the number of simultaneous downloads(the number of the simultaneously running network threads) at the code side. Closes #168.
- Add `FileDownloader#init(Context,OkHttpClientCustomMaker,int)`: Accept initializing the number of simultaneous downloads(the number of the simultaneously running network threads) with the FileDownloadService initializes. Closes #168.

#### Enhancement

- Improve Robust: Ensure the minimum time interval between each callback of 'progress' is 5ms, To prevent internal callback of 'progress' too frequent happening. Closes #167.
- Improve Practicability: Print the 'warn' priority log when a request does something in the FileDownloadService but it isn't connected yet.
- Improve Performance: Using the `SparseArray` instead of `HashMap` for mapping all `FileDownloadModel`.

#### Fix

- Fix(crash): Fix provided wrong params in formatting character string when to starting download runnable occur the unexpected downloading status.
- Fix(force-re-download): Fix the wrong logic: In the case of `BaseDownloadTask#setForceReDownload(true)` and the task has already downloaded will trigger 'warn' callback. Closes #169 .
- Fix(class-type): Keep the class type of `SocketTimeOutException`, and no longer care about whether the message of Throwable is empty, this is very redundant.

#### Others

- Upgrade dependency okhttp from `3.2.0` to `3.3.1`.

## Version 0.3.1

_2016-05-19_
Expand Down
11 changes: 8 additions & 3 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Android 文件下载引擎,稳定、高效、简单易用

> [README DOC](https://github.com/lingochamp/FileDownloader/blob/master/README.md)
> 本引擎依赖okhttp 3.2.0
> 本引擎依赖okhttp 3.3.1
---
#### 版本迭代日志: [Change Log](https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG.md)
Expand Down Expand Up @@ -61,7 +61,7 @@ Android 文件下载引擎,稳定、高效、简单易用
在项目中引用:

```
compile 'com.liulishuo.filedownloader:library:0.3.1'
compile 'com.liulishuo.filedownloader:library:0.3.2'
```

#### 全局初始化在`Application.onCreate`
Expand Down Expand Up @@ -233,6 +233,7 @@ if (parallel) {
| --- | ---
| init(Context) | 缓存Context,不会启动下载进程
| init(Context, OkHttpClientCustomMaker) | 缓存Context,不会启动下载进程;在下载进程启动的时候,初始化OkHttpClient
| init(Context, OkHttpClientCustomMaker, int) | 缓存Context,不会启动下载进程;在下载进程启动的时候,初始化OkHttpClient,并且根据提供的最大同时下载数创建网络线程线程池
| create(url:String) | 创建一个下载任务
| start(listener:FileDownloadListener, isSerial:boolean) | 启动是相同监听器的任务,串行/并行启动
| pause(listener:FileDownloadListener) | 暂停启动相同监听器的任务
Expand All @@ -254,6 +255,7 @@ if (parallel) {
| stopForeground(removeNotification:boolean) | 取消FileDownloadService的前台模式
| setTaskCompleted(url:String, path:String, totalBytes:long) | 用于告诉FileDownloader引擎,以指定Url与Path的任务已经通过其他方式(非FileDownloader)下载完成
| setTaskCompleted(taskAtomList:List<FileDownloadTaskAtom>) | 用于告诉FileDownloader引擎,指定的一系列的任务都已经通过其他方式(非FileDownloader)下载完成
| setMaxNetworkThreadCount(int) | 设置最大并行下载的数目(网络下载线程数), [1,12]


#### Task接口说明
Expand All @@ -262,7 +264,9 @@ if (parallel) {
| --- | ---
| setPath(path:String) | 下载文件的存储绝对路径
| setListener(listener:FileDownloadListener) | 设置监听,可以以相同监听组成队列
| setCallbackProgressTimes(times:int) | 设置FileDownloadListener#progress最大回调次数
| setCallbackProgressTimes(times:int) | 设置整个下载过程中`FileDownloadListener#progress`最大回调次数
| setCallbackProgressIgnored() | 忽略所有的`FileDownloadListener#progress`的回调
| setCallbackProgressMinInterval(minIntervalMillis:int) | 设置每个`FileDownloadListener#progress`之间回调间隔(ms)
| setTag(tag:Object) | 内部不会使用,在回调的时候用户自己使用
| setTag(key:int, tag:Object) | 用于存储任意的变量方便回调中使用,以key作为索引
| setForceReDownload(isForceReDownload:boolean) | 强制重新下载,将会忽略检测文件是否健在
Expand All @@ -279,6 +283,7 @@ if (parallel) {
| getId(void):int | 获取唯一Id(内部通过url与path生成)
| getUrl(void):String | 获取下载连接
| getCallbackProgressTimes(void):int | 获得progress最大回调次数
| getCallbackProgressMinInterval(void):int | 获得每个progress之间的回调间隔(ms)
| getPath(void):String | 获取下载文件存储路径
| getListener(void):FileDownloadListener | 获取监听器
| getSoFarBytes(void):int | 获取已经下载的字节数
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Android multi-task file download engine.

> [中文文档](https://github.com/lingochamp/FileDownloader/blob/master/README-zh.md)
> This project dependency on [square/okhttp 3.2.0](https://github.com/square/okhttp)
> This project dependency on [square/okhttp 3.3.1](https://github.com/square/okhttp)
## DEMO

Expand All @@ -26,7 +26,7 @@ FileDownloader is installed by adding the following dependency to your build.gra

```
dependencies {
compile 'com.liulishuo.filedownloader:library:0.3.1'
compile 'com.liulishuo.filedownloader:library:0.3.2'
}
```

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=0.3.1
VERSION_CODE=22
VERSION_NAME=0.3.2
VERSION_CODE=23
BUILD_TOOLS_VERSION=23.0.1
COMPILE_SDK_VERSION=23

Expand Down

0 comments on commit cc60e82

Please sign in to comment.