修复不支持断点文件大小找不到的问题

pull/330/head
AriaLyy 8 years ago
parent 2255b0fe0c
commit 4d6d87375e
  1. 2
      .idea/misc.xml
  2. 2
      Aria/build.gradle
  3. 4
      Aria/src/main/java/com/arialyy/aria/core/task/DownloadUtil.java
  4. 2
      app/build.gradle
  5. 3
      app/src/main/java/com/arialyy/simple/single_task/SingleTaskActivity.java
  6. 4
      gradle/wrapper/gradle-wrapper.properties

@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
buildToolsVersion '25.0.2'
defaultConfig {
minSdkVersion 9

@ -244,7 +244,8 @@ public class DownloadUtil implements IDownloadUtil, Runnable {
//不支持断点只能单线程下载
if (!isSupportBreakpoint) {
ConfigEntity entity = new ConfigEntity();
entity.FILE_SIZE = conn.getContentLength();
long len = conn.getContentLength();;
entity.FILE_SIZE = len;
entity.DOWNLOAD_URL = mDownloadEntity.getDownloadUrl();
entity.TEMP_FILE = mDownloadFile;
entity.THREAD_ID = 0;
@ -254,6 +255,7 @@ public class DownloadUtil implements IDownloadUtil, Runnable {
entity.isSupportBreakpoint = isSupportBreakpoint;
SingleThreadTask task = new SingleThreadTask(mConstance, mListener, entity);
mFixedThreadPool.execute(task);
mListener.onPostPre(len);
mListener.onStart(0);
return;
}

@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.arialyy.simple"

@ -55,7 +55,8 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
private static final String DOWNLOAD_URL =
//"http://kotlinlang.org/docs/kotlin-docs.pdf";
//"https://atom-installer.github.com/v1.13.0/AtomSetup.exe?s=1484074138&ext=.exe";
"http://static.gaoshouyou.com/d/21/e8/61218d78d0e8b79df68dbc18dd484c97.apk";
//"http://static.gaoshouyou.com/d/21/e8/61218d78d0e8b79df68dbc18dd484c97.apk";
"http://ox.konsung.net:5555/ksdc-web/download/downloadFile/?fileName=ksdc_1.0.2.apk&rRange=0-";
@Bind(R.id.progressBar) HorizontalProgressBarWithNumber mPb;
@Bind(R.id.start) Button mStart;
@Bind(R.id.stop) Button mStop;

@ -1,6 +1,6 @@
#Mon Oct 24 17:59:34 CST 2016
#Tue Mar 14 19:13:43 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

Loading…
Cancel
Save