From 489f44c0f9bb081b67cab7e2345a88652a1b661f Mon Sep 17 00:00:00 2001 From: AriaLyy <511455842@qq.com> Date: Tue, 18 Jul 2017 16:18:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=BB=84bug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=AD=90=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=AE=8C=E6=88=90=E5=90=8E=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Aria/build.gradle | 3 +- .../arialyy/aria/core/download/DListener.java | 3 +- .../downloader/DownloadGroupUtil.java | 18 ++++- .../core/download/downloader/Downloader.java | 71 +++++++++++-------- .../downloader/IDownloadListener.java | 55 ++------------ .../com/arialyy/aria/core/inf/AbsEntity.java | 2 +- .../arialyy/aria/core/inf/IEventListener.java | 68 ++++++++++++++++++ .../aria/core/upload/IUploadListener.java | 54 +------------- .../aria/core/upload/UploadListener.java | 5 +- .../aria/core/upload/UploadTarget.java | 17 ++--- .../arialyy/aria/core/upload/UploadUtil.java | 2 +- .../res/layout/activity_aria_file_shange.xml | 14 ---- Aria/src/main/res/layout/item_file.xml | 51 ------------- Aria/src/main/res/values/strings.xml | 8 --- .../download/group/DownloadGroupActivity.java | 7 +- .../multi_download/DownloadAdapter.java | 20 ++++-- .../arialyy/simple/upload/UploadActivity.java | 2 +- .../simple/widget/SubStateLinearLayout.java | 45 +++++++++--- .../res/layout/activity_download_group.xml | 6 +- app/src/main/res/layout/content_single.xml | 2 +- .../main/res/layout/item_group_download.xml | 5 +- .../main/res/layout/layout_child_state.xml | 3 +- app/src/main/res/values/strings.xml | 8 ++- aria/src/main/AndroidManifest.xml | 1 - .../com/arialyy/aria/core/Configuration.java | 1 + .../arialyy/aria/core/upload/UploadTask.java | 2 +- build.gradle | 2 +- 27 files changed, 226 insertions(+), 249 deletions(-) create mode 100644 Aria/src/main/java/com/arialyy/aria/core/inf/IEventListener.java delete mode 100644 Aria/src/main/res/layout/activity_aria_file_shange.xml delete mode 100644 Aria/src/main/res/layout/item_file.xml delete mode 100644 Aria/src/main/res/values/strings.xml diff --git a/Aria/build.gradle b/Aria/build.gradle index 41a68320..3d928fe3 100644 --- a/Aria/build.gradle +++ b/Aria/build.gradle @@ -23,7 +23,6 @@ dependencies { testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' // compile project(':AriaCompiler') - compile project(':AriaAnnotations') + compile project(':AriaAnnotations') //gradle 打包时打开这个 } apply from: 'bintray-release.gradle' -//apply from: 'jcenter.gradle' diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/DListener.java b/Aria/src/main/java/com/arialyy/aria/core/download/DListener.java index e9e15f70..2d31b0d8 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/DListener.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/DListener.java @@ -28,7 +28,7 @@ import java.lang.ref.WeakReference; /** * 下载监听类 */ -final class DListener> +class DListener> extends DownloadListener { private WeakReference outHandler; private long lastLen = 0; //上一次发送长度 @@ -81,7 +81,6 @@ final class DListener> } @Override public void onStop(long stopLocation) { - //saveData(IEntity.STATE_STOP, stopLocation); saveData(isWait ? IEntity.STATE_WAIT : IEntity.STATE_STOP, stopLocation); handleSpeed(0); sendInState2Target(ISchedulers.STOP); diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/downloader/DownloadGroupUtil.java b/Aria/src/main/java/com/arialyy/aria/core/download/downloader/DownloadGroupUtil.java index 6c3edd69..d8a44363 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/downloader/DownloadGroupUtil.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/downloader/DownloadGroupUtil.java @@ -106,10 +106,11 @@ public class DownloadGroupUtil implements IDownloadUtil { mTotalSize += entity.getFileSize(); mCompleteNum++; mInitNum++; + mCurrentLocation += entity.getFileSize(); } else { mExeMap.put(entity.getDownloadUrl(), createChildDownloadTask(entity)); + mCurrentLocation += entity.getCurrentProgress(); } - mCurrentLocation += entity.getCurrentProgress(); } } @@ -284,6 +285,7 @@ public class DownloadGroupUtil implements IDownloadUtil { private DownloadTaskEntity createChildDownloadTask(DownloadEntity entity) { DownloadTaskEntity taskEntity = mTasksMap.get(entity.getDownloadUrl()); if (taskEntity != null) { + taskEntity.entity = entity; return taskEntity; } taskEntity = new DownloadTaskEntity(); @@ -335,16 +337,21 @@ public class DownloadGroupUtil implements IDownloadUtil { } @Override public void onProgress(long currentLocation) { - mCurrentLocation += (currentLocation - lastLen); + long speed = currentLocation - lastLen; + mCurrentLocation += speed; lastLen = currentLocation; + entity.setCurrentProgress(currentLocation); + handleSpeed(speed); } @Override public void onStop(long stopLocation) { saveData(IEntity.STATE_STOP, stopLocation); + handleSpeed(0); } @Override public void onCancel() { saveData(IEntity.STATE_CANCEL, -1); + handleSpeed(0); } @Override public void onComplete() { @@ -354,11 +361,13 @@ public class DownloadGroupUtil implements IDownloadUtil { closeTimer(); mListener.onComplete(); } + handleSpeed(0); } @Override public void onFail() { entity.setFailNum(entity.getFailNum() + 1); saveData(IEntity.STATE_FAIL, -1); + handleSpeed(0); reTry(); } @@ -374,6 +383,11 @@ public class DownloadGroupUtil implements IDownloadUtil { } } + private void handleSpeed(long speed) { + entity.setSpeed(speed); + entity.setConvertSpeed(speed <= 0 ? "" : CommonUtil.formatFileSize(speed) + "/s"); + } + private void saveData(int state, long location) { entity.setState(state); entity.setComplete(state == IEntity.STATE_COMPLETE); diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/downloader/Downloader.java b/Aria/src/main/java/com/arialyy/aria/core/download/downloader/Downloader.java index 676ec5e0..a7fa8721 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/downloader/Downloader.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/downloader/Downloader.java @@ -90,28 +90,18 @@ class Downloader implements Runnable, IDownloadUtil { mListener.onPostPre(mEntity.getFileSize()); mConstance.cleanState(); mConstance.isDownloading = true; - try { - if (!mTaskEntity.isSupportBP) { - mThreadNum = 1; - mConstance.THREAD_NUM = mThreadNum; - handleNoSupportBreakpointDownload(); - } else { - mThreadNum = isNewTask ? (mEntity.getFileSize() <= SUB_LEN ? 1 - : AriaManager.getInstance(mContext).getDownloadConfig().getThreadNum()) - : mRealThreadNum; - mConstance.THREAD_NUM = mThreadNum; - mFixedThreadPool = Executors.newFixedThreadPool(mThreadNum); - handleBreakpoint(); - } - startTimer(); - } catch (IOException e) { - failDownload("下载失败【downloadUrl:" - + mEntity.getDownloadUrl() - + "】\n【filePath:" - + mEntity.getDownloadPath() - + "】\n" - + CommonUtil.getPrintException(e)); + if (!mTaskEntity.isSupportBP) { + mThreadNum = 1; + mConstance.THREAD_NUM = mThreadNum; + handleNoSupportBreakpointDownload(); + } else { + mThreadNum = isNewTask ? (mEntity.getFileSize() <= SUB_LEN ? 1 + : AriaManager.getInstance(mContext).getDownloadConfig().getThreadNum()) : mRealThreadNum; + mConstance.THREAD_NUM = mThreadNum; + mFixedThreadPool = Executors.newFixedThreadPool(mThreadNum); + handleBreakpoint(); } + startTimer(); } /** @@ -170,6 +160,7 @@ class Downloader implements Runnable, IDownloadUtil { @Override public void stopDownload() { closeTimer(); + if (mConstance.isComplete()) return; mConstance.isStop = true; mConstance.isDownloading = false; if (mFixedThreadPool != null) { @@ -326,7 +317,7 @@ class Downloader implements Runnable, IDownloadUtil { /** * 处理断点 */ - private void handleBreakpoint() throws IOException { + private void handleBreakpoint() { long fileLength = mEntity.getFileSize(); Properties pro = CommonUtil.loadConfig(mConfigFile); int blockSize = (int) (fileLength / mThreadNum); @@ -336,14 +327,8 @@ class Downloader implements Runnable, IDownloadUtil { } int rl = 0; if (isNewTask) { - CommonUtil.createFile(mTempFile.getPath()); - BufferedRandomAccessFile file = - new BufferedRandomAccessFile(new File(mTempFile.getPath()), "rwd", 8192); - //设置文件长度 - file.setLength(fileLength); - file.close(); + createNewFile(fileLength); } - for (int i = 0; i < mThreadNum; i++) { long startL = i * blockSize, endL = (i + 1) * blockSize; Object state = pro.getProperty(mTempFile.getName() + "_state_" + i); @@ -375,6 +360,34 @@ class Downloader implements Runnable, IDownloadUtil { startSingleTask(recordL); } + /** + * 创建新的下载文件 + */ + private void createNewFile(long fileLength) { + CommonUtil.createFile(mTempFile.getPath()); + BufferedRandomAccessFile file = null; + try { + file = new BufferedRandomAccessFile(new File(mTempFile.getPath()), "rwd", 8192); + //设置文件长度 + file.setLength(fileLength); + } catch (IOException e) { + failDownload("下载失败【downloadUrl:" + + mEntity.getDownloadUrl() + + "】\n【filePath:" + + mEntity.getDownloadPath() + + "】\n" + + CommonUtil.getPrintException(e)); + } finally { + if (file != null) { + try { + file.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + /** * 处理不支持断点的下载 */ diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/downloader/IDownloadListener.java b/Aria/src/main/java/com/arialyy/aria/core/download/downloader/IDownloadListener.java index 7b77cd59..aa6f3e2d 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/downloader/IDownloadListener.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/downloader/IDownloadListener.java @@ -16,70 +16,27 @@ package com.arialyy.aria.core.download.downloader; +import com.arialyy.aria.core.inf.IEventListener; + /** * 下载监听 */ -public interface IDownloadListener { +interface IDownloadListener extends IEventListener { /** * 支持断点回调 * * @param support true,支持;false 不支持 */ - public void supportBreakpoint(boolean support); - - /** - * 取消下载 - */ - public void onCancel(); - - /** - * 下载失败 - */ - public void onFail(); - - /** - * 预处理,有时有些地址链接比较慢,这时可以先在这个地方出来一些界面上的UI,如按钮的状态 - */ - public void onPre(); - - /** - * 预处理完成,准备下载---开始下载之间 - */ - public void onPostPre(long fileSize); - - /** - * 下载监听 - */ - public void onProgress(long currentLocation); + void supportBreakpoint(boolean support); /** * 单一线程的结束位置 */ - public void onChildComplete(long finishLocation); - - /** - * 开始 - */ - public void onStart(long startLocation); + void onChildComplete(long finishLocation); /** * 子程恢复下载的位置 */ - public void onChildResume(long resumeLocation); - - /** - * 恢复位置 - */ - public void onResume(long resumeLocation); - - /** - * 停止 - */ - public void onStop(long stopLocation); - - /** - * 下载完成 - */ - public void onComplete(); + void onChildResume(long resumeLocation); } \ No newline at end of file diff --git a/Aria/src/main/java/com/arialyy/aria/core/inf/AbsEntity.java b/Aria/src/main/java/com/arialyy/aria/core/inf/AbsEntity.java index cb35232d..eb611d5f 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/inf/AbsEntity.java +++ b/Aria/src/main/java/com/arialyy/aria/core/inf/AbsEntity.java @@ -31,7 +31,7 @@ public abstract class AbsEntity extends DbEntity implements IEntity, Parcelable /** * 单位转换后的速度 */ - @Ignore private String convertSpeed = "0b/s"; + @Ignore private String convertSpeed = ""; /** * 下载失败计数,每次开始都重置为0 */ diff --git a/Aria/src/main/java/com/arialyy/aria/core/inf/IEventListener.java b/Aria/src/main/java/com/arialyy/aria/core/inf/IEventListener.java new file mode 100644 index 00000000..c9842fac --- /dev/null +++ b/Aria/src/main/java/com/arialyy/aria/core/inf/IEventListener.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.arialyy.aria.core.inf; + +/** + * Created by Aria.Lao on 2017/7/18. + * 基础事件 + */ +public interface IEventListener { + + /** + * 预处理,有时有些地址链接比较慢,这时可以先在这个地方出来一些界面上的UI,如按钮的状态 + */ + void onPre(); + + /** + * 预处理完成,准备下载---开始下载之间 + */ + void onPostPre(long fileSize); + + /** + * 开始 + */ + void onStart(long startLocation); + + /** + * 恢复位置 + */ + void onResume(long resumeLocation); + + /** + * 下载监听 + */ + void onProgress(long currentLocation); + + /** + * 停止 + */ + void onStop(long stopLocation); + + /** + * 下载完成 + */ + void onComplete(); + + /** + * 取消下载 + */ + void onCancel(); + + /** + * 下载失败 + */ + void onFail(); +} diff --git a/Aria/src/main/java/com/arialyy/aria/core/upload/IUploadListener.java b/Aria/src/main/java/com/arialyy/aria/core/upload/IUploadListener.java index 02a9e28c..2a8cab14 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/upload/IUploadListener.java +++ b/Aria/src/main/java/com/arialyy/aria/core/upload/IUploadListener.java @@ -15,60 +15,12 @@ */ package com.arialyy.aria.core.upload; +import com.arialyy.aria.core.inf.IEventListener; + /** * Created by lyy on 2017/2/9. * 上传监听 */ -public interface IUploadListener { - - /** - * 预处理 - */ - public void onPre(); - - /** - * 预处理完成 - */ - public void onPostPre(long fileSize); - - /** - * 开始上传 - */ - public void onStart(); - - /** - * 恢复上传 - * - * @param resumeLocation 上次上传停止位置 - */ - public void onResume(long resumeLocation); - - /** - * 停止上传 - * - * @param stopLocation 上传停止位置 - */ - public void onStop(long stopLocation); - - /** - * 上传进度 - * - * @param currentLocation 当前进度 - */ - public void onProgress(long currentLocation); - - /** - * 取消上传 - */ - public void onCancel(); - - /** - * 上传成功 - */ - public void onComplete(); +interface IUploadListener extends IEventListener { - /** - * 上传失败 - */ - public void onFail(); } diff --git a/Aria/src/main/java/com/arialyy/aria/core/upload/UploadListener.java b/Aria/src/main/java/com/arialyy/aria/core/upload/UploadListener.java index b8cfcb6a..a4c432ae 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/upload/UploadListener.java +++ b/Aria/src/main/java/com/arialyy/aria/core/upload/UploadListener.java @@ -18,8 +18,7 @@ package com.arialyy.aria.core.upload; /** * Created by lyy on 2017/2/23. */ - -public class UploadListener implements IUploadListener { +class UploadListener implements IUploadListener { @Override public void onPre() { } @@ -28,7 +27,7 @@ public class UploadListener implements IUploadListener { } - @Override public void onStart() { + @Override public void onStart(long startLocation) { } diff --git a/Aria/src/main/java/com/arialyy/aria/core/upload/UploadTarget.java b/Aria/src/main/java/com/arialyy/aria/core/upload/UploadTarget.java index b8e473e1..dd372289 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/upload/UploadTarget.java +++ b/Aria/src/main/java/com/arialyy/aria/core/upload/UploadTarget.java @@ -28,10 +28,10 @@ public class UploadTarget extends AbsNormalTarget - - - - - \ No newline at end of file diff --git a/Aria/src/main/res/layout/item_file.xml b/Aria/src/main/res/layout/item_file.xml deleted file mode 100644 index 7f4c8044..00000000 --- a/Aria/src/main/res/layout/item_file.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/Aria/src/main/res/values/strings.xml b/Aria/src/main/res/values/strings.xml deleted file mode 100644 index 010e9981..00000000 --- a/Aria/src/main/res/values/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - Aria - - 下载实体不能为空 - 下载链接不能为空 - 存储地址不能为空 - 文件名不能为空 - diff --git a/app/src/main/java/com/arialyy/simple/download/group/DownloadGroupActivity.java b/app/src/main/java/com/arialyy/simple/download/group/DownloadGroupActivity.java index 1839add9..b5471182 100644 --- a/app/src/main/java/com/arialyy/simple/download/group/DownloadGroupActivity.java +++ b/app/src/main/java/com/arialyy/simple/download/group/DownloadGroupActivity.java @@ -30,6 +30,7 @@ import com.arialyy.frame.util.show.T; import com.arialyy.simple.R; import com.arialyy.simple.base.BaseActivity; import com.arialyy.simple.databinding.ActivityDownloadGroupBinding; +import com.arialyy.simple.widget.SubStateLinearLayout; import java.util.List; /** @@ -40,6 +41,7 @@ public class DownloadGroupActivity extends BaseActivity mUrls; @Override protected void init(Bundle savedInstanceState) { @@ -50,6 +52,7 @@ public class DownloadGroupActivity extends BaseActivity 0){ + holder.childList.updateChildProgress(((DownloadGroupEntity)entity).getSubTask()); + }else { + holder.childList.addData(((DownloadGroupEntity)entity).getSubTask()); + } } private boolean isSimpleDownload(AbsEntity entity) { @@ -287,7 +295,7 @@ public class DownloadAdapter extends AbsRVAdapter { @OnClick(R.id.upload) void upload() { Aria.upload(this) .load(FILE_PATH) - .setUploadUrl("http://172.18.104.228:8080/upload/sign_file") + .setUploadUrl("http://172.18.104.129:8080/upload/sign_file") .setAttachment("file") .start(); } diff --git a/app/src/main/java/com/arialyy/simple/widget/SubStateLinearLayout.java b/app/src/main/java/com/arialyy/simple/widget/SubStateLinearLayout.java index 88422b25..6c6b4660 100644 --- a/app/src/main/java/com/arialyy/simple/widget/SubStateLinearLayout.java +++ b/app/src/main/java/com/arialyy/simple/widget/SubStateLinearLayout.java @@ -11,24 +11,36 @@ import com.arialyy.aria.core.download.DownloadEntity; import com.arialyy.simple.R; import java.util.LinkedList; import java.util.List; +import java.util.Map; +import java.util.WeakHashMap; /** * Created by Aria.Lao on 2017/7/17. */ public class SubStateLinearLayout extends LinearLayout { + interface OnShowCallback { + void onShow(boolean visibility); + } + + OnShowCallback callback; + List mSubData = new LinkedList<>(); + Map mPosition = new WeakHashMap<>(); public SubStateLinearLayout(Context context) { super(context); + setOrientation(VERTICAL); } public SubStateLinearLayout(Context context, @Nullable AttributeSet attrs) { super(context, attrs); + setOrientation(VERTICAL); } public SubStateLinearLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); + setOrientation(VERTICAL); } public void addData(List datas) { @@ -39,22 +51,38 @@ public class SubStateLinearLayout extends LinearLayout { int i = 1; for (DownloadEntity entity : datas) { TextView view = createView(entity); + mPosition.put(entity.getDownloadPath(), i); addView(view, i); i++; } } - public void update(DownloadEntity entity) { - int position = mSubData.indexOf(entity) + 1; - if (position != 0) { - ((TextView) getChildAt(position)).setText(entity.getFileName() + ": " + getPercent(entity)); + public void setOnShowCallback(OnShowCallback callback) { + this.callback = callback; + } + + public List getSubData() { + return mSubData; + } + + public void updateChildProgress(List entities) { + for (DownloadEntity entity : entities) { + Integer i = mPosition.get(entity.getDownloadPath()); + if (i == null) return; + int position = i; + if (position != -1) { + TextView child = ((TextView) getChildAt(position)); + int p = getPercent(entity); + child.setText(entity.getFileName() + ": " + p + "%" + " | " + entity.getConvertSpeed()); + child.invalidate(); + } } } private TextView createView(DownloadEntity entity) { TextView view = (TextView) LayoutInflater.from(getContext()).inflate(R.layout.layout_child_state, null); - view.setText(entity.getFileName() + ": " + getPercent(entity)); + view.setText(entity.getFileName() + ": " + getPercent(entity) + "%"); return view; } @@ -65,7 +93,8 @@ public class SubStateLinearLayout extends LinearLayout { view.setText("点击显示子任务"); view.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - if (getVisibility() == GONE) { + int visibility = getChildAt(1).getVisibility(); + if (visibility == GONE) { showChild(true); ((TextView) v).setText("点击隐藏子任务"); } else { @@ -80,13 +109,13 @@ public class SubStateLinearLayout extends LinearLayout { private void showChild(boolean show) { for (int i = 1, count = getChildCount(); i < count; i++) { getChildAt(i).setVisibility(show ? VISIBLE : GONE); + invalidate(); } } private int getPercent(DownloadEntity entity) { long size = entity.getFileSize(); long progress = entity.getCurrentProgress(); - int current = size == 0 ? 0 : (int) (progress * 100 / size); - return current; + return size == 0 ? 0 : (int) (progress * 100 / size); } } diff --git a/app/src/main/res/layout/activity_download_group.xml b/app/src/main/res/layout/activity_download_group.xml index c5cbdcbf..98d73bdc 100644 --- a/app/src/main/res/layout/activity_download_group.xml +++ b/app/src/main/res/layout/activity_download_group.xml @@ -31,7 +31,11 @@ bind:progress="@{progress}" bind:speed="@{speed}" /> - diff --git a/app/src/main/res/layout/content_single.xml b/app/src/main/res/layout/content_single.xml index 75e8b39e..9b25720d 100644 --- a/app/src/main/res/layout/content_single.xml +++ b/app/src/main/res/layout/content_single.xml @@ -21,7 +21,7 @@ - diff --git a/app/src/main/res/layout/layout_child_state.xml b/app/src/main/res/layout/layout_child_state.xml index 6c0c49fc..e0e005b4 100644 --- a/app/src/main/res/layout/layout_child_state.xml +++ b/app/src/main/res/layout/layout_child_state.xml @@ -2,7 +2,6 @@ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bec3be14..6bb916fe 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -48,8 +48,12 @@ https://res5.d.cn/5a6a3384c1b2be1a65d84b914e6a6fef697637578b6db2eb1056d50b09cf1dcf289d4045df7ef95746e498e3d6a848ab84c89b77aa60194e2c48e5a7cb748265.apk - https://res5.d.cn/5a6a3384c1b2be1a52034c72752e8475414630ebc69318b84ef584115ebf5eaaab945ae07b7fe3596afc72a7940ff328d4a9553f6ae92d6c09ba4bfb533137f6.apk - https://res5.d.cn/5a6a3384c1b2be1a426f06bfc69034d69c44ae1a01da180cab8e59bd1a5e1a784bac46ba0c64579d14f0e80a4ce4f068af89b0369a393456f4f449a8829cad5c.apk + + + + http://static.gaoshouyou.com/d/12/0d/7f120f50c80d2e7b8c4ba24ece4f9cdd.apk + http://static.gaoshouyou.com/d/d4/4f/d6d48db3794fb9ecf47e83c346570881.apk + diff --git a/aria/src/main/AndroidManifest.xml b/aria/src/main/AndroidManifest.xml index 952e1869..a50dd348 100644 --- a/aria/src/main/AndroidManifest.xml +++ b/aria/src/main/AndroidManifest.xml @@ -3,7 +3,6 @@ diff --git a/aria/src/main/java/com/arialyy/aria/core/Configuration.java b/aria/src/main/java/com/arialyy/aria/core/Configuration.java index ea4c9d27..4fdbd4df 100644 --- a/aria/src/main/java/com/arialyy/aria/core/Configuration.java +++ b/aria/src/main/java/com/arialyy/aria/core/Configuration.java @@ -168,6 +168,7 @@ class Configuration { } field.setAccessible(true); String value = properties.getProperty(field.getName()); + if (TextUtils.isEmpty(value) || value.equalsIgnoreCase("null")) continue; Class type = field.getType(); if (type == String.class) { field.set(this, value); diff --git a/aria/src/main/java/com/arialyy/aria/core/upload/UploadTask.java b/aria/src/main/java/com/arialyy/aria/core/upload/UploadTask.java index d42053ae..56bc44ab 100644 --- a/aria/src/main/java/com/arialyy/aria/core/upload/UploadTask.java +++ b/aria/src/main/java/com/arialyy/aria/core/upload/UploadTask.java @@ -110,7 +110,7 @@ public class UploadTask extends AbsNormalTask { saveData(IEntity.STATE_POST_PRE, 0); } - @Override public void onStart() { + @Override public void onStart(long startLocation) { sendInState2Target(ISchedulers.START); saveData(IEntity.STATE_RUNNING, 0); } diff --git a/build.gradle b/build.gradle index 1c332c62..b359cae5 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ ext { userOrg = 'arialyy' groupId = 'com.arialyy.aria' // publishVersion = '0.0.8' - publishVersion = '3.2.0' + publishVersion = '3.2.3_dev' repoName='maven' desc = 'android 下载框架' website = 'https://github.com/AriaLyy/Aria'