修改例子

pull/330/head
laoyuyu 7 years ago
parent a8d8440d81
commit c7bb1cd0c5
  1. 23
      README.md
  2. 4
      app/src/main/AndroidManifest.xml
  3. 4
      app/src/main/java/com/arialyy/simple/download/group/ChildHandleDialog.java
  4. 15
      app/src/main/java/com/arialyy/simple/test/AnyRunActivity.java
  5. 2
      build.gradle

@ -28,8 +28,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
compile 'com.arialyy.aria:aria-core:3.3.16' compile 'com.arialyy.aria:aria-core:3.4'
annotationProcessor 'com.arialyy.aria:aria-compiler:3.3.16' annotationProcessor 'com.arialyy.aria:aria-compiler:3.4'
``` ```
如果出现android support,请将 `compile 'com.arialyy.aria:aria-core:<last-version>'`替换为 如果出现android support,请将 `compile 'com.arialyy.aria:aria-core:<last-version>'`替换为
``` ```
@ -94,20 +94,17 @@ protected void onCreate(Bundle savedInstanceState) {
//在这里处理任务完成的状态 //在这里处理任务完成的状态
} }
``` ```
[更多注解使用方法](https://github.com/AriaLyy/Aria/wiki/%E6%B3%A8%E8%A7%A3%E4%BD%BF%E7%94%A8)
### [HTTP任务组下载\FTP下载;HTTP\FTP文件上传](https://github.com/AriaLyy/Aria/wiki/Aria%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8) ### [更多说明,见WIKI](http://aria.laoyuyu.me/aria_doc/)
### [参数配置](https://github.com/AriaLyy/Aria/wiki/Aria%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE)
### [更多说明,见WIKI](https://github.com/AriaLyy/Aria/wiki)
### 版本日志 ### 版本日志
+ v_3.3.16 + v_3.4
- 修复一个activity启动多次,无法进行回掉的bug https://github.com/AriaLyy/Aria/issues/200 - 优化大量代码
- 优化target代码结构,移除路径被占用的提示 - 重构Aria的ORM模型,提高了数据读取的可靠性和读写速度
- 添加支持chunked模式的下载 - 现在可在任意类中使用Aria了,[使用方法](http://aria.laoyuyu.me/aria_doc/start/any_java.html)
- 去掉上一个版本"//"的限制 - 添加`window.location.replace("http://xxxx")`类型的网页重定向支持
- 支持gzip、deflate 压缩类型的输入流
- 添加`useServerFileName`,可使用服务端响应header的`Content-Disposition`携带的文件名
[更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md) [更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md)

@ -16,9 +16,9 @@
android:theme="@style/AppTheme.NoActionBar"> android:theme="@style/AppTheme.NoActionBar">
<!--android:name=".test.TestGroupActivity"--> <!--android:name=".test.TestGroupActivity"-->
<!--android:name=".test.TestActivity"--> <!--android:name=".test.TestActivity"-->
<!--android:name=".test.AnyRunActivity"--> <!--android:name=".MainActivity"-->
<activity <activity
android:name=".MainActivity" android:name=".test.AnyRunActivity"
android:label="@string/app_name"> android:label="@string/app_name">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>

@ -134,10 +134,10 @@ import java.util.List;
@OnClick({ R.id.start, R.id.stop, R.id.cancel }) void onClick(View view) { @OnClick({ R.id.start, R.id.stop, R.id.cancel }) void onClick(View view) {
switch (view.getId()) { switch (view.getId()) {
case R.id.start: case R.id.start:
Aria.download(getContext()).load(mUrls).getSubTaskManager().startSubTask(mChildEntity.getUrl()); Aria.download(getContext()).loadGroup(mUrls).getSubTaskManager().startSubTask(mChildEntity.getUrl());
break; break;
case R.id.stop: case R.id.stop:
Aria.download(getContext()).load(mUrls).getSubTaskManager().stopSubTask(mChildEntity.getUrl()); Aria.download(getContext()).loadGroup(mUrls).getSubTaskManager().stopSubTask(mChildEntity.getUrl());
break; break;
//case R.id.cancel: //case R.id.cancel:
// Aria.download(this).load(mUrls).getSubTaskManager().cancelSubTask(mChildEntity.getUrl()); // Aria.download(this).load(mUrls).getSubTaskManager().cancelSubTask(mChildEntity.getUrl());

@ -4,6 +4,7 @@ import android.os.Bundle;
import android.view.View; import android.view.View;
import com.arialyy.aria.core.Aria; import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.inf.AbsEntity; import com.arialyy.aria.core.inf.AbsEntity;
import com.arialyy.aria.util.ALog;
import com.arialyy.simple.R; import com.arialyy.simple.R;
import com.arialyy.simple.base.BaseActivity; import com.arialyy.simple.base.BaseActivity;
import com.arialyy.simple.databinding.ActivityTestBinding; import com.arialyy.simple.databinding.ActivityTestBinding;
@ -17,9 +18,7 @@ public class AnyRunActivity extends BaseActivity<ActivityTestBinding> {
AnyRunnModule module; AnyRunnModule module;
String[] urls; String[] urls;
int index = 0; int index = 0;
//String URL = "http://static.gaoshouyou.com/d/12/0d/7f120f50c80d2e7b8c4ba24ece4f9cdd.apk"; String URL = "http://static.gaoshouyou.com/d/12/0d/7f120f50c80d2e7b8c4ba24ece4f9cdd.apk";
String URL =
"https://www.baidu.com/link?url=_LFCuTPtnzFxVJByJ504QymRywIA1Z_T5xUxe9ZLuxcGM0C_RcdpWyB1eGjbJC-e5wv5wAKM4WmLMAS5KeF6EZJHB8Va3YqZUiaErqK_pxm&wd=&eqid=e8583fe70002d126000000065a99f864";
@Override protected int setLayoutId() { @Override protected int setLayoutId() {
return R.layout.activity_test; return R.layout.activity_test;
@ -42,12 +41,14 @@ public class AnyRunActivity extends BaseActivity<ActivityTestBinding> {
// index++; // index++;
//} //}
module.start(URL); module.start(URL);
List<AbsEntity> list = Aria.download(this).getTotalTaskList();
ALog.d(TAG, "size ==> " + list.size());
break; break;
case R.id.stop: case R.id.stop:
List<AbsEntity> list = Aria.download(this).getTotalTaskList(); //List<AbsEntity> list = Aria.download(this).getTotalTaskList();
//
//module.stop(); ////module.stop();
module.stop(URL); //module.stop(URL);
break; break;
case R.id.cancel: case R.id.cancel:

@ -39,7 +39,7 @@ task clean(type: Delete) {
ext { ext {
userOrg = 'arialyy' userOrg = 'arialyy'
groupId = 'com.arialyy.aria' groupId = 'com.arialyy.aria'
publishVersion = '3.4_dev_1' publishVersion = '3.4'
// publishVersion = '1.0.3' //FTP插件 // publishVersion = '1.0.3' //FTP插件
repoName='maven' repoName='maven'
desc = 'android 下载框架' desc = 'android 下载框架'

Loading…
Cancel
Save