修复不支持断点文件大小找不到的问题
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -37,7 +37,7 @@
|
|||||||
<ConfirmationsSetting value="0" id="Add" />
|
<ConfirmationsSetting value="0" id="Add" />
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
<ConfirmationsSetting value="0" id="Remove" />
|
||||||
</component>
|
</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" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 23
|
||||||
buildToolsVersion "23.0.2"
|
buildToolsVersion '25.0.2'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 9
|
minSdkVersion 9
|
||||||
|
@ -244,7 +244,8 @@ public class DownloadUtil implements IDownloadUtil, Runnable {
|
|||||||
//不支持断点只能单线程下载
|
//不支持断点只能单线程下载
|
||||||
if (!isSupportBreakpoint) {
|
if (!isSupportBreakpoint) {
|
||||||
ConfigEntity entity = new ConfigEntity();
|
ConfigEntity entity = new ConfigEntity();
|
||||||
entity.FILE_SIZE = conn.getContentLength();
|
long len = conn.getContentLength();;
|
||||||
|
entity.FILE_SIZE = len;
|
||||||
entity.DOWNLOAD_URL = mDownloadEntity.getDownloadUrl();
|
entity.DOWNLOAD_URL = mDownloadEntity.getDownloadUrl();
|
||||||
entity.TEMP_FILE = mDownloadFile;
|
entity.TEMP_FILE = mDownloadFile;
|
||||||
entity.THREAD_ID = 0;
|
entity.THREAD_ID = 0;
|
||||||
@ -254,6 +255,7 @@ public class DownloadUtil implements IDownloadUtil, Runnable {
|
|||||||
entity.isSupportBreakpoint = isSupportBreakpoint;
|
entity.isSupportBreakpoint = isSupportBreakpoint;
|
||||||
SingleThreadTask task = new SingleThreadTask(mConstance, mListener, entity);
|
SingleThreadTask task = new SingleThreadTask(mConstance, mListener, entity);
|
||||||
mFixedThreadPool.execute(task);
|
mFixedThreadPool.execute(task);
|
||||||
|
mListener.onPostPre(len);
|
||||||
mListener.onStart(0);
|
mListener.onStart(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 23
|
||||||
buildToolsVersion "23.0.2"
|
buildToolsVersion '25.0.2'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.arialyy.simple"
|
applicationId "com.arialyy.simple"
|
||||||
|
@ -55,7 +55,8 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
|
|||||||
private static final String DOWNLOAD_URL =
|
private static final String DOWNLOAD_URL =
|
||||||
//"http://kotlinlang.org/docs/kotlin-docs.pdf";
|
//"http://kotlinlang.org/docs/kotlin-docs.pdf";
|
||||||
//"https://atom-installer.github.com/v1.13.0/AtomSetup.exe?s=1484074138&ext=.exe";
|
//"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.progressBar) HorizontalProgressBarWithNumber mPb;
|
||||||
@Bind(R.id.start) Button mStart;
|
@Bind(R.id.start) Button mStart;
|
||||||
@Bind(R.id.stop) Button mStop;
|
@Bind(R.id.stop) Button mStop;
|
||||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
#Mon Oct 24 17:59:34 CST 2016
|
#Tue Mar 14 19:13:43 CST 2017
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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
|
||||||
|
Reference in New Issue
Block a user