diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index e12fe0b2..3889b503 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -9,8 +9,8 @@
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 8700295b..4708f7cb 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,9 +2,9 @@
+
-
\ No newline at end of file
diff --git a/downloadutil/.gitignore b/Aria/.gitignore
similarity index 100%
rename from downloadutil/.gitignore
rename to Aria/.gitignore
diff --git a/downloadutil/build.gradle b/Aria/build.gradle
similarity index 95%
rename from downloadutil/build.gradle
rename to Aria/build.gradle
index 5bbfce46..4ba96047 100644
--- a/downloadutil/build.gradle
+++ b/Aria/build.gradle
@@ -8,7 +8,7 @@ android {
minSdkVersion 9
targetSdkVersion 23
versionCode 58
- versionName "2.1.0"
+ versionName "2.3.0"
}
buildTypes {
release {
diff --git a/downloadutil/jcenter.gradle b/Aria/jcenter.gradle
similarity index 100%
rename from downloadutil/jcenter.gradle
rename to Aria/jcenter.gradle
diff --git a/downloadutil/proguard-rules.pro b/Aria/proguard-rules.pro
similarity index 100%
rename from downloadutil/proguard-rules.pro
rename to Aria/proguard-rules.pro
diff --git a/downloadutil/src/androidTest/java/com/arialyy/downloadutil/ApplicationTest.java b/Aria/src/androidTest/java/com/arialyy/downloadutil/ApplicationTest.java
similarity index 100%
rename from downloadutil/src/androidTest/java/com/arialyy/downloadutil/ApplicationTest.java
rename to Aria/src/androidTest/java/com/arialyy/downloadutil/ApplicationTest.java
diff --git a/downloadutil/src/main/AndroidManifest.xml b/Aria/src/main/AndroidManifest.xml
similarity index 84%
rename from downloadutil/src/main/AndroidManifest.xml
rename to Aria/src/main/AndroidManifest.xml
index 7e405fd7..952e1869 100644
--- a/downloadutil/src/main/AndroidManifest.xml
+++ b/Aria/src/main/AndroidManifest.xml
@@ -1,5 +1,5 @@
+ package="com.arialyy.aria">
+ android:theme="@style/AppTheme.NoActionBar">
+ android:label="@string/app_name">
diff --git a/app/src/main/java/com/arialyy/simple/activity/MultiTaskActivity.java b/app/src/main/java/com/arialyy/simple/activity/MultiTaskActivity.java
index 4fb51665..98e57a11 100644
--- a/app/src/main/java/com/arialyy/simple/activity/MultiTaskActivity.java
+++ b/app/src/main/java/com/arialyy/simple/activity/MultiTaskActivity.java
@@ -23,9 +23,9 @@ import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
import butterknife.Bind;
-import com.arialyy.downloadutil.core.AMTarget;
-import com.arialyy.downloadutil.core.Aria;
-import com.arialyy.downloadutil.core.task.Task;
+import com.arialyy.aria.core.AMTarget;
+import com.arialyy.aria.core.Aria;
+import com.arialyy.aria.core.task.Task;
import com.arialyy.frame.util.show.L;
import com.arialyy.simple.R;
import com.arialyy.simple.adapter.DownloadAdapter;
@@ -135,6 +135,7 @@ public class MultiTaskActivity extends BaseActivity {
@Override public void onTaskStart(Task task) {
super.onTaskStart(task);
L.d(TAG, "download start");
+ mAdapter.updateState(task.getDownloadEntity());
}
@Override public void onTaskResume(Task task) {
diff --git a/app/src/main/java/com/arialyy/simple/activity/SingleTaskActivity.java b/app/src/main/java/com/arialyy/simple/activity/SingleTaskActivity.java
index a015f092..643335df 100644
--- a/app/src/main/java/com/arialyy/simple/activity/SingleTaskActivity.java
+++ b/app/src/main/java/com/arialyy/simple/activity/SingleTaskActivity.java
@@ -24,16 +24,15 @@ import android.os.Message;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
-import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import butterknife.Bind;
-import com.arialyy.downloadutil.core.AMTarget;
-import com.arialyy.downloadutil.core.Aria;
-import com.arialyy.downloadutil.core.DownloadEntity;
-import com.arialyy.downloadutil.core.task.Task;
-import com.arialyy.downloadutil.orm.DbEntity;
-import com.arialyy.downloadutil.util.CommonUtil;
+import com.arialyy.aria.core.AMTarget;
+import com.arialyy.aria.core.Aria;
+import com.arialyy.aria.core.DownloadEntity;
+import com.arialyy.aria.core.task.Task;
+import com.arialyy.aria.orm.DbEntity;
+import com.arialyy.aria.util.CommonUtil;
import com.arialyy.simple.R;
import com.arialyy.simple.base.BaseActivity;
import com.arialyy.simple.databinding.ActivitySingleBinding;
diff --git a/app/src/main/java/com/arialyy/simple/adapter/DownloadAdapter.java b/app/src/main/java/com/arialyy/simple/adapter/DownloadAdapter.java
index 46e5acec..ef15f824 100644
--- a/app/src/main/java/com/arialyy/simple/adapter/DownloadAdapter.java
+++ b/app/src/main/java/com/arialyy/simple/adapter/DownloadAdapter.java
@@ -25,16 +25,11 @@ import android.widget.TextView;
import butterknife.Bind;
import com.arialyy.absadapter.common.AbsHolder;
import com.arialyy.absadapter.recycler_view.AbsRVAdapter;
-import com.arialyy.downloadutil.core.Aria;
-import com.arialyy.downloadutil.core.DownloadEntity;
-import com.arialyy.downloadutil.core.DownloadManager;
-import com.arialyy.downloadutil.core.command.CmdFactory;
-import com.arialyy.downloadutil.core.command.IDownloadCmd;
-import com.arialyy.downloadutil.util.CommonUtil;
+import com.arialyy.aria.core.Aria;
+import com.arialyy.aria.core.DownloadEntity;
+import com.arialyy.aria.util.CommonUtil;
import com.arialyy.simple.R;
import com.arialyy.simple.widget.HorizontalProgressBarWithNumber;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -46,22 +41,16 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class DownloadAdapter extends AbsRVAdapter {
private static final String TAG = "DownloadAdapter";
- private DownloadManager mManager;
- private CmdFactory mFactory;
private Map mPositions = new ConcurrentHashMap<>();
public DownloadAdapter(Context context, List data) {
super(context, data);
- mFactory = CmdFactory.getInstance();
- mManager = DownloadManager.getInstance();
- List addCmd = new ArrayList<>();
int i = 0;
for (DownloadEntity entity : data) {
mPositions.put(entity.getDownloadUrl(), i);
- addCmd.add(mFactory.createCmd(entity, CmdFactory.TASK_CREATE));
+ Aria.whit(getContext()).load(entity).add();
i++;
}
- mManager.setCmds(addCmd).exe();
}
@Override protected MyHolder getViewHolder(View convertView, int viewType) {
@@ -152,14 +141,13 @@ public class DownloadAdapter extends AbsRVAdapter extends AbsActivity {
+
+ @Override protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (AndroidVersionUtil.hasLollipop()) {
+ getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark));
+ }
+ }
+
@Override protected void dataCallback(int result, Object data) {
}
diff --git a/app/src/main/java/com/arialyy/simple/base/BaseApplication.java b/app/src/main/java/com/arialyy/simple/base/BaseApplication.java
index 4710265d..1b97cde5 100644
--- a/app/src/main/java/com/arialyy/simple/base/BaseApplication.java
+++ b/app/src/main/java/com/arialyy/simple/base/BaseApplication.java
@@ -18,7 +18,7 @@
package com.arialyy.simple.base;
import android.app.Application;
-import com.arialyy.downloadutil.core.DownloadManager;
+import com.arialyy.aria.core.DownloadManager;
import com.arialyy.frame.core.AbsFrame;
/**
diff --git a/app/src/main/java/com/arialyy/simple/module/DownloadModule.java b/app/src/main/java/com/arialyy/simple/module/DownloadModule.java
index 559dac04..48fffd6b 100644
--- a/app/src/main/java/com/arialyy/simple/module/DownloadModule.java
+++ b/app/src/main/java/com/arialyy/simple/module/DownloadModule.java
@@ -22,9 +22,9 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.os.Environment;
import android.os.Handler;
-import com.arialyy.downloadutil.core.DownloadEntity;
-import com.arialyy.downloadutil.core.DownloadManager;
-import com.arialyy.downloadutil.util.CommonUtil;
+import com.arialyy.aria.core.DownloadEntity;
+import com.arialyy.aria.core.DownloadManager;
+import com.arialyy.aria.util.CommonUtil;
import com.arialyy.frame.util.AndroidUtils;
import com.arialyy.frame.util.StringUtil;
import com.arialyy.frame.util.show.L;
diff --git a/app/src/main/res/layout/activity_single.xml b/app/src/main/res/layout/activity_single.xml
index 3c74a58e..851b49dc 100644
--- a/app/src/main/res/layout/activity_single.xml
+++ b/app/src/main/res/layout/activity_single.xml
@@ -12,7 +12,6 @@
diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml
index ecada24b..0d719a06 100644
--- a/app/src/main/res/values-v21/styles.xml
+++ b/app/src/main/res/values-v21/styles.xml
@@ -1,16 +1,16 @@
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
-