Merge branch 'v_3.0'

pull/330/head
AriaLyy 8 years ago
commit 56d073d14e
  1. 3
      .gitignore
  2. 6
      Aria/build.gradle
  3. 2
      Aria/src/main/java/com/arialyy/aria/core/queue/AbsTaskQueue.java
  4. 5
      Aria/src/main/java/com/arialyy/aria/core/queue/UploadTaskQueue.java
  5. 2
      app/src/main/java/com/arialyy/simple/upload/UploadActivity.java

3
.gitignore vendored

@ -11,4 +11,5 @@
.idea/misc.xml .idea/misc.xml
.gradle .gradle
/.idea /.idea
.idea .idea
/cache

@ -7,8 +7,8 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 9 minSdkVersion 9
targetSdkVersion 23 targetSdkVersion 23
versionCode 312 versionCode 313
versionName "3.1.2" versionName "3.1.3"
} }
buildTypes { buildTypes {
release { release {
@ -23,4 +23,4 @@ dependencies {
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:appcompat-v7:23.1.1'
} }
//apply from: 'jcenter.gradle' apply from: 'jcenter.gradle'

@ -31,7 +31,7 @@ abstract class AbsTaskQueue<TASK extends ITask, TASK_ENTITY extends ITaskEntity,
implements ITaskQueue<TASK, TASK_ENTITY, ENTITY> { implements ITaskQueue<TASK, TASK_ENTITY, ENTITY> {
private final String TAG = "AbsTaskQueue"; private final String TAG = "AbsTaskQueue";
CachePool<TASK> mCachePool = new CachePool<>(); CachePool<TASK> mCachePool = new CachePool<>();
ExecutePool<TASK> mExecutePool = null; ExecutePool<TASK> mExecutePool;
/** /**
* 获取任务执行池 * 获取任务执行池

@ -32,7 +32,6 @@ public class UploadTaskQueue extends AbsTaskQueue<UploadTask, UploadTaskEntity,
private static final String TAG = "UploadTaskQueue"; private static final String TAG = "UploadTaskQueue";
private static volatile UploadTaskQueue INSTANCE = null; private static volatile UploadTaskQueue INSTANCE = null;
private static final Object LOCK = new Object(); private static final Object LOCK = new Object();
private ExecutePool<UploadTask> mExecutePool = new ExecutePool<>(false);
public static UploadTaskQueue getInstance() { public static UploadTaskQueue getInstance() {
if (INSTANCE == null) { if (INSTANCE == null) {
@ -43,6 +42,9 @@ public class UploadTaskQueue extends AbsTaskQueue<UploadTask, UploadTaskEntity,
return INSTANCE; return INSTANCE;
} }
private UploadTaskQueue() {
mExecutePool = new ExecutePool<>(false);
}
@Override public void setMaxTaskNum(int newMaxNum) { @Override public void setMaxTaskNum(int newMaxNum) {
@ -74,5 +76,4 @@ public class UploadTaskQueue extends AbsTaskQueue<UploadTask, UploadTaskEntity,
Log.d(TAG, "从缓存池删除任务,删除" + (mCachePool.removeTask(task) ? "成功" : "失败")); Log.d(TAG, "从缓存池删除任务,删除" + (mCachePool.removeTask(task) ? "成功" : "失败"));
} }
} }
} }

@ -81,7 +81,7 @@ public class UploadActivity extends BaseActivity<ActivityUploadMeanBinding> {
@OnClick(R.id.upload) void upload() { @OnClick(R.id.upload) void upload() {
Aria.upload(this) Aria.upload(this)
.load(FILE_PATH) .load(FILE_PATH)
.setUploadUrl("http://172.18.104.50:8080/upload/sign_file") .setUploadUrl("http://172.18.104.228:8080/upload/sign_file")
.setAttachment("file") .setAttachment("file")
.start(); .start();
} }

Loading…
Cancel
Save