Browse Source

aria使用老版本,修复一些手机不能显示进度;
尝试修复viewpager加载fragment可能会挂掉的bug

zengjiebin 7 years ago
parent
commit
42f1e9758a

+ 2 - 0
.idea/gradle.xml

@@ -8,6 +8,8 @@
         <option name="modules">
           <set>
             <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/Aria" />
+            <option value="$PROJECT_DIR$/AriaAnnotations" />
             <option value="$PROJECT_DIR$/app" />
             <option value="$PROJECT_DIR$/datashare" />
             <option value="$PROJECT_DIR$/ucrop" />

+ 5 - 5
app/build.gradle

@@ -247,12 +247,12 @@ dependencies {
 
     //    compile 'com.google.zxing:core:3.3.0'
     compile project(':ucrop')
-    compile('com.arialyy.aria:aria-core:3.3.16') {
-        exclude group: 'com.android.support'
-    }
-//    compile project(':Aria')
+//    compile('com.arialyy.aria:aria-core:3.5') {
+//        exclude group: 'com.android.support'
+//    }
+    compile project(':Aria')
 
-    annotationProcessor 'com.arialyy.aria:aria-compiler:3.3.16'
+    annotationProcessor 'com.arialyy.aria:aria-compiler:3.2.14'
     compile 'com.sunfusheng:marqueeview:1.3.3'
     compile files('libs/alipaySdk-20170922.jar')
     //极光

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/util/DownloadUtil.java

@@ -383,7 +383,8 @@ public class DownloadUtil {
         if(TextUtils.isEmpty(downLoadInfo.getMPackageName())){
             filePath = DIR+ File.separator+downLoadInfo.getMGameName()+ ClassFileHelper.FILE_SUFFIX;
         }
-        task.setFilePath(filePath).start();
+//        task.setFilePath(filePath).start();
+        task.setDownloadPath(filePath).start();
     }
 
     public void pause(DownLoadInfo downLoadInfo) {

+ 7 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/TryMakeMoneyact.java

@@ -125,8 +125,13 @@ public class TryMakeMoneyact extends BaseActivity {
     public void onEventMainThread(BigEvent event) {
         switch (event.getEventTypes()) {
             case TIPS_DOWN_ICON:
-                TitleBarUtils.getInstance()
-                        .setRightRedPoint(activity, View.VISIBLE);
+                runOnUiThread(new Runnable() {
+                    @Override
+                    public void run() {
+                        TitleBarUtils.getInstance()
+                                .setRightRedPoint(activity, View.VISIBLE);
+                    }
+                });
                 break;
         }
     }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFind.java

@@ -78,7 +78,7 @@ public class FgtFind extends BaseFragment {
     private TitleFragmentListAdapter mAdapter;
 
     private void initView() {
-        mAdapter = new TitleFragmentListAdapter(getFragmentManager());
+        mAdapter = new TitleFragmentListAdapter(getChildFragmentManager());
         mAdapter.add(FgtFindChild.newInstance(0), "全部");
     }
 

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPlayGame.java

@@ -215,7 +215,7 @@ public class FgtPlayGame extends BaseFragment {
             }
         });
 
-        mAdapter = new TitleFragmentListAdapter(getFragmentManager());
+        mAdapter = new TitleFragmentListAdapter(getChildFragmentManager());
 
         //tab
         initTab();

+ 8 - 8
app/src/main/java/com/sheep/jiuyan/samllsheep/service/DownloadService.java

@@ -34,23 +34,23 @@ public class DownloadService extends Service{
     }
 
     @Download.onPre void onPre(DownloadTask task) {
-        LogUtil.println("DownloadService", "onPre", task.getKey(), task.getTaskName());
+        LogUtil.println("DownloadService", "onPre", task.getKey());//, task.getTaskName());
     }
     @Download.onTaskStart void taskStart(DownloadTask task) {
-        LogUtil.println("DownloadService", "taskStart", task.getKey(), task.getTaskName());
+        LogUtil.println("DownloadService", "taskStart", task.getKey());//, task.getTaskName());
     }
     @Download.onTaskResume void taskResume(DownloadTask task) {
-        LogUtil.println("DownloadService", "taskResume", task.getKey(), task.getTaskName());
+        LogUtil.println("DownloadService", "taskResume", task.getKey());//, task.getTaskName());
     }
     //在这里处理任务执行中的状态,如进度进度条的刷新
     @Download.onTaskRunning protected void running(DownloadTask task) {
-        LogUtil.println("DownloadService", "running", task.getKey(), task.getTaskName(), task.getPercent());
+        LogUtil.println("DownloadService", "running", task.getKey(), /*task.getTaskName(),*/ task.getPercent());
         mDownloadTaskService.setDownloadTaskPercent(task.getPercent(), task.getCurrentProgress()/1024d/1024d,task.getFileSize()/1024d/1024d,0,task.getKey());
         EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.GENERATION_ACCOUNT_REFRESH_ADAPTER).setData(task));
     }
 
     @Download.onTaskStop void taskStop(DownloadTask task) {
-        LogUtil.println("DownloadService", "taskStop", task.getKey(), task.getTaskName());
+        LogUtil.println("DownloadService", "taskStop", task.getKey());//, task.getTaskName());
         mDownloadTaskService.setDownloadTaskStatus(task.getKey(), DownloadUtil.STATUS_PAUSE);
         EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DOWNLOAD_STOP).setData(task));
     }
@@ -59,13 +59,13 @@ public class DownloadService extends Service{
     }
 
     @Download.onTaskCancel void taskCancel(DownloadTask task) {
-        LogUtil.println("DownloadService", "taskCancel", task.getKey(), task.getTaskName());
+        LogUtil.println("DownloadService", "taskCancel", task.getKey());//, task.getTaskName());
         mDownloadTaskService.deleteDownloadTaskByDownloadUrl(task.getKey());
         EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DOWNLOAD_CANCEL).setData(task));
     }
 
     @Download.onTaskFail void taskFail(DownloadTask task) {
-        LogUtil.println("DownloadService", "taskFail", task.getKey(), task.getTaskName());
+        LogUtil.println("DownloadService", "taskFail", task.getKey());//, task.getTaskName());
         mDownloadTaskService.setDownloadTaskStatus(task.getKey(), DownloadUtil.STATUS_FAIL);
         EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DOWNLOAD_FAIL).setData(task));
         //空间不足,弹框提示
@@ -79,7 +79,7 @@ public class DownloadService extends Service{
     }
 
     @Download.onTaskComplete void taskComplete(DownloadTask task) {
-        LogUtil.println("DownloadService", "taskComplete", task.getKey(), task.getTaskName());
+        LogUtil.println("DownloadService", "taskComplete", task.getKey());//, task.getTaskName());
         mDownloadTaskService.setDownloadTaskFinish(task.getKey(), task.getDownloadPath());
         ApkUtils.installApk(getApplicationContext(), task.getDownloadPath());
         EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DOWNLOAD_COMPLETE).setData(task));

+ 9 - 0
build.gradle

@@ -48,6 +48,15 @@ task clean(type: Delete) {
 
 
 ext {
+    //aria使用本地library时添加的
+    userOrg = 'arialyy'
+    groupId = 'com.arialyy.aria'
+    publishVersion = '3.2.14'
+    //  publishVersion = '1.0.3'  //FTP插件
+    repoName='maven'
+    desc = 'android 下载框架'
+    website = 'https://github.com/AriaLyy/Aria'
+    licences = ['Apache-2.0']
 
     android = [
             compileSdkVersion: 27,

+ 1 - 1
settings.gradle

@@ -1 +1 @@
-include ':app', ':datashare', ':view', ':ucrop'//, ':Aria', ':AriaAnnotations'
+include ':app', ':datashare', ':view', ':ucrop', ':Aria', ':AriaAnnotations'