diff --git a/.gradle/2.10/taskArtifacts/cache.properties b/.gradle/2.10/taskArtifacts/cache.properties
deleted file mode 100644
index 51dbbef0..00000000
--- a/.gradle/2.10/taskArtifacts/cache.properties
+++ /dev/null
@@ -1 +0,0 @@
-#Thu Jun 02 19:55:15 CST 2016
diff --git a/.gradle/2.10/taskArtifacts/cache.properties.lock b/.gradle/2.10/taskArtifacts/cache.properties.lock
deleted file mode 100644
index 22e4a8c1..00000000
Binary files a/.gradle/2.10/taskArtifacts/cache.properties.lock and /dev/null differ
diff --git a/.gradle/2.10/taskArtifacts/fileHashes.bin b/.gradle/2.10/taskArtifacts/fileHashes.bin
deleted file mode 100644
index 0f469e5a..00000000
Binary files a/.gradle/2.10/taskArtifacts/fileHashes.bin and /dev/null differ
diff --git a/.gradle/2.10/taskArtifacts/fileSnapshots.bin b/.gradle/2.10/taskArtifacts/fileSnapshots.bin
deleted file mode 100644
index 6ccfa15d..00000000
Binary files a/.gradle/2.10/taskArtifacts/fileSnapshots.bin and /dev/null differ
diff --git a/.gradle/2.10/taskArtifacts/outputFileStates.bin b/.gradle/2.10/taskArtifacts/outputFileStates.bin
deleted file mode 100644
index 29d80c7e..00000000
Binary files a/.gradle/2.10/taskArtifacts/outputFileStates.bin and /dev/null differ
diff --git a/.gradle/2.10/taskArtifacts/taskArtifacts.bin b/.gradle/2.10/taskArtifacts/taskArtifacts.bin
deleted file mode 100644
index d47a291d..00000000
Binary files a/.gradle/2.10/taskArtifacts/taskArtifacts.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index 0df64bbb..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index c2964d85..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index 0d2487d4..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index b8311ce2..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index a8a740fa..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index 57db3bed..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index be7ba117..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index 80e2ff04..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index 75c4f8ae..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index 2f89295e..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index 9ca2397f..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index 8c4f63ce..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index ad05cad0..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index df184f30..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index c0df3dd3..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index 7fc28d4e..00000000
Binary files a/.gradle/2.10/tasks/_absadapter_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index 713eb7ae..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index f942ef8a..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index 9d23b918..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index 126f58ac..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugAndroidTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index 9a4f312e..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index bb9a950b..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index cce24c6a..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index 7c337695..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin b/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
deleted file mode 100644
index 647adab4..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock b/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
deleted file mode 100644
index 47aa24a7..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin b/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
deleted file mode 100644
index 5013ee88..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin and /dev/null differ
diff --git a/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock b/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
deleted file mode 100644
index 3a7943fa..00000000
Binary files a/.gradle/2.10/tasks/_app_compileDebugUnitTestJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock and /dev/null differ
diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml
deleted file mode 100644
index 99c95a3d..00000000
--- a/.idea/codeStyleSettings.xml
+++ /dev/null
@@ -1,231 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 31f85ff1..ded83e3e 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -3,8 +3,9 @@
-
+
+
diff --git a/app/src/main/java/com/arialyy/simple/activity/MainActivity.java b/app/src/main/java/com/arialyy/simple/activity/MainActivity.java
index 728b6215..bf720355 100644
--- a/app/src/main/java/com/arialyy/simple/activity/MainActivity.java
+++ b/app/src/main/java/com/arialyy/simple/activity/MainActivity.java
@@ -1,10 +1,15 @@
package com.arialyy.simple.activity;
+import android.Manifest;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
+import android.widget.Button;
import butterknife.Bind;
+import com.arialyy.frame.permission.OnPermissionCallback;
+import com.arialyy.frame.permission.PermissionManager;
+import com.arialyy.frame.util.show.T;
import com.arialyy.simple.R;
import com.arialyy.simple.base.BaseActivity;
import com.arialyy.simple.databinding.ActivityMainBinding;
@@ -14,6 +19,8 @@ import com.arialyy.simple.databinding.ActivityMainBinding;
*/
public class MainActivity extends BaseActivity {
@Bind(R.id.toolbar) Toolbar mBar;
+ @Bind(R.id.single_task) Button mSigleBt;
+ @Bind(R.id.multi_task) Button mMultiBt;
@Override protected int setLayoutId() {
return R.layout.activity_main;
@@ -23,6 +30,28 @@ public class MainActivity extends BaseActivity {
super.init(savedInstanceState);
setSupportActionBar(mBar);
mBar.setTitle("多线程多任务下载");
+ boolean hasPermission = PermissionManager.getInstance()
+ .checkPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
+ if (hasPermission) {
+ setEnable(true);
+ } else {
+ setEnable(false);
+ PermissionManager.getInstance().requestPermission(this, new OnPermissionCallback() {
+ @Override public void onSuccess(String... permissions) {
+ setEnable(true);
+ }
+
+ @Override public void onFail(String... permissions) {
+ T.showShort(MainActivity.this, "没有文件读写权限");
+ setEnable(false);
+ }
+ }, Manifest.permission.WRITE_EXTERNAL_STORAGE);
+ }
+ }
+
+ private void setEnable(boolean enable) {
+ mSigleBt.setEnabled(enable);
+ mMultiBt.setEnabled(enable);
}
public void onClick(View view) {
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 9773036f..883695ca 100644
--- a/app/src/main/java/com/arialyy/simple/activity/MultiTaskActivity.java
+++ b/app/src/main/java/com/arialyy/simple/activity/MultiTaskActivity.java
@@ -90,7 +90,7 @@ public class MultiTaskActivity extends BaseActivity {
};
public void onClick(View view){
- DownloadNumDialog dialog = new DownloadNumDialog();
+ DownloadNumDialog dialog = new DownloadNumDialog(this);
dialog.show(getSupportFragmentManager(), "download_num");
}
diff --git a/app/src/main/java/com/arialyy/simple/base/BaseDialog.java b/app/src/main/java/com/arialyy/simple/base/BaseDialog.java
index 9911d2fe..a682aa55 100644
--- a/app/src/main/java/com/arialyy/simple/base/BaseDialog.java
+++ b/app/src/main/java/com/arialyy/simple/base/BaseDialog.java
@@ -8,6 +8,11 @@ import com.arialyy.frame.core.AbsDialogFragment;
* Created by “AriaLyy@outlook.com” on 2016/11/14.
*/
public abstract class BaseDialog extends AbsDialogFragment{
+
+ protected BaseDialog(Object obj){
+ super(obj);
+ }
+
@Override protected void init(Bundle savedInstanceState) {
}
diff --git a/app/src/main/java/com/arialyy/simple/dialog/DownloadNumDialog.java b/app/src/main/java/com/arialyy/simple/dialog/DownloadNumDialog.java
index 90933a7c..4d39c6fd 100644
--- a/app/src/main/java/com/arialyy/simple/dialog/DownloadNumDialog.java
+++ b/app/src/main/java/com/arialyy/simple/dialog/DownloadNumDialog.java
@@ -1,5 +1,6 @@
package com.arialyy.simple.dialog;
+import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@@ -14,11 +15,16 @@ import com.arialyy.simple.databinding.DialogDownloadNumBinding;
* Created by “AriaLyy@outlook.com” on 2016/11/14.
* 设置下载数量对话框
*/
-public class DownloadNumDialog extends BaseDialog implements RadioGroup.OnCheckedChangeListener{
+@SuppressLint("ValidFragment") public class DownloadNumDialog
+ extends BaseDialog implements RadioGroup.OnCheckedChangeListener {
public static final int RESULT_CODE = 1001;
@Bind(R.id.cancel) Button mCancel;
@Bind(R.id.rg) RadioGroup mRg;
+ public DownloadNumDialog(Object obj) {
+ super(obj);
+ }
+
@Override protected int setLayoutId() {
return R.layout.dialog_download_num;
}
@@ -41,6 +47,7 @@ public class DownloadNumDialog extends BaseDialog impl
RadioButton rb = (RadioButton) group.getChildAt(checkedId);
if (rb.isChecked()) {
getSimplerModule().onDialog(RESULT_CODE, rb.getTag());
+ dismiss();
}
}
}
diff --git a/app/src/main/res/layout/dialog_download_num.xml b/app/src/main/res/layout/dialog_download_num.xml
index 65e6464f..3aa1090b 100644
--- a/app/src/main/res/layout/dialog_download_num.xml
+++ b/app/src/main/res/layout/dialog_download_num.xml
@@ -1,83 +1,83 @@
-
+
+ android:layout_height="1dp"
+ android:background="@color/black"
+ />
+ android:layout_height="1dp"
+ android:background="@color/black"
+ />
diff --git a/downloadutil/build.gradle b/downloadutil/build.gradle
index f6fe271a..16e8602d 100644
--- a/downloadutil/build.gradle
+++ b/downloadutil/build.gradle
@@ -23,4 +23,4 @@ dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
}
-apply from: 'jcenter.gradle'
\ No newline at end of file
+//apply from: 'jcenter.gradle'
\ No newline at end of file