Преглед на файлове

发现模块添加缓存机制;升级功能修改;版本修改为2.9.0

zengjiebin преди 7 години
родител
ревизия
0386fd3d4e

+ 16 - 5
app/src/main/java/com/kfzs/duanduan/fragment/FgtFind.java

@@ -21,6 +21,8 @@ import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 
+import org.afinal.simplecache.ApiKey;
+
 import java.lang.reflect.Field;
 import java.util.List;
 
@@ -60,16 +62,25 @@ public class FgtFind extends BaseCompatFragment {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         List<FindTag> newList = baseMessage.getDatas(FindTag.class);
+                        loadList(newList);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        //无数据时尝试获取缓存数据
+                        List<FindTag> newList = CommonUtil.getInstance().getCacheList(ApiKey.articles_tags, FindTag.class);
+                        if(loadList(newList))
+                            G.showToast(baseMessage);
+                    }
+                    //没有添加数据返回true
+                    private boolean loadList(List<FindTag> newList){
                         if(!ListUtil.isEmpty(newList)){
                             list.clear();
                             ListUtil.addAll(list, newList);
                             loadData();
+                            return false;
                         }
-                    }
-
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        G.showToast(baseMessage);
+                        return true;
                     }
                 });
     }

+ 15 - 5
app/src/main/java/com/kfzs/duanduan/fragment/FgtFindChild.java

@@ -42,6 +42,7 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
 
+import org.afinal.simplecache.ApiKey;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 
@@ -289,18 +290,27 @@ public class FgtFindChild extends BaseCompatFragment {
                             @Override
                             public void onNext(BaseMessage baseMessage) {
                                 List<FindItem> newList = baseMessage.getDatas(FindItem.class);
+                                loadList(newList);
+                            }
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                                //无数据时尝试获取缓存数据
+                                List<FindItem> newList = CommonUtil.getInstance().getCacheList(ApiKey.articles(type), FindItem.class);
+                                if(loadList(newList))
+                                    notifyDataSetChanged();
+                            }
+                            //没有添加数据返回true
+                            private boolean loadList(List<FindItem> newList){
                                 if(!ListUtil.isEmpty(newList)){
                                     list.clear();
                                     ListUtil.addAll(list, newList);
                                     if(!list.isEmpty())
                                         list.add(null);//底部部分----我是有底线的
                                     notifyDataSetChanged();
+                                    return false;
                                 }
-                            }
-
-                            @Override
-                            public void onError(BaseMessage baseMessage) {
-                                notifyDataSetChanged();
+                                return true;
                             }
                         });
     }

+ 0 - 1
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -563,7 +563,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             e.printStackTrace();
         }
         mHanderl.sendEmptyMessage(0);
-        Jump2View.getInstance().tryShowNewbieTask(activity, userEntity, newbie_task);
     }
 
     @Override

+ 142 - 121
app/src/main/java/com/sheep/gamegroup/util/SysAppUtil.java

@@ -406,9 +406,6 @@ public class SysAppUtil {
      * @param action1 动作完成后的回调
      */
     public static void showVersionInfo(final Activity activity, final String ignoreMd5, final Action1<Integer> action1) {
-        if(checkBuglyUpdate()){
-            return;
-        }
         if(dialog != null){
             try {
                 if(dialog.isShowing()) {
@@ -418,130 +415,28 @@ public class SysAppUtil {
                 e.printStackTrace();
             }
         }
+        Version buglyVersion;
+        if((buglyVersion = checkBuglyUpdate()) != null){
+            ACache.get(SheepApp.getInstance()).put("version_url", buglyVersion.getAddress());
+            if(action1 != null)
+                action1.call(0);
+            Beta.checkUpgrade();
+//            loadVersion(activity, ignoreMd5, action1, buglyVersion);
+            return;
+        }
         SheepApp.getInstance().getNetComponent().getApiService().getNewVersion(SheepApp.getInstance().getConnectAddress().getVersionType())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        final Version version = baseMessage.getData(Version.class);
-                        if(version == null){
-                            if(ignoreMd5 == null)
-                                G.showToast(baseMessage);
-                            if(action1 != null)
-                                action1.call(0);
-                            return;
-                        }
-                        boolean isNewApp;
-                        if(TestUtil.isSheep()) {
-                            if(ignoreMd5 != null && TextUtils.equals(ignoreMd5, version.getVersion_number()+"") && !version.isForceUpdate()){
-                                LogUtil.println("showVersionInfo", "忽略", ignoreMd5, version.getVersion_name());
-                                if(action1 != null)
-                                    action1.call(0);
-                                return;
-                            }
-                            int versionCode = SysAppUtil.getAppVersionCode();
-                            if (versionCode == 0) {
-                                if (ignoreMd5 == null)
-                                    G.showToast(baseMessage);
-                                if (action1 != null)
-                                    action1.call(0);
-                                return;
-                            }
-                            isNewApp = versionCode >= version.getVersion_number();
-                        } else {
-                            if(ignoreMd5 != null && TextUtils.equals(ignoreMd5, version.getMd5_address()) && !version.isForceUpdate()){
-                                LogUtil.println("showVersionInfo", "忽略", ignoreMd5, version.getVersion_name());
-                                if(action1 != null)
-                                    action1.call(0);
-                                return;
-                            }
-                            String fileMD5 = SysAppUtil.getConnectAdrressFileMD5();
-                            if (TextUtils.isEmpty(fileMD5)) {
-                                if (ignoreMd5 == null)
-                                    G.showToast(baseMessage);
-                                if (action1 != null)
-                                    action1.call(0);
-                                return;
-                            }
-                            isNewApp = fileMD5.equalsIgnoreCase(version.getMd5_address());
-                        }
-                        if(isNewApp){//已经是最新版本
-                            if(ignoreMd5 == null)
-                                G.showToast("当前版本为最新版本,无需更新");
-                            if(action1 != null)
-                                action1.call(0);
-                        } else {//有新版本
-                            ACache.get(SheepApp.getInstance()).put("version_url", version.getAddress());
-                            final String fileName = version.getMd5_address()+".apk";
-                            final File file = new File(ClassFileHelper.DIR, fileName);
-                            DialogConfig dialogConfig = new DialogConfig();
-                            dialogConfig.setTitle("小绵羊V"+version.getVersion_name());
-                            dialogConfig.setMsg(TextUtils.isEmpty(version.getUpdate_content()) ? "当前版本小绵羊V"+getConnectAdrressPackageInfo().versionName : version.getUpdate_content()).setLayoutId(R.layout.x_msg_wv_dialog)
-                                    .setBtnLeftText(file.exists() ? "立即安装" : "立即更新").setBtnLeftNotDissDialog(true).setBtnLeftOnClickListener(new View.OnClickListener() {
-                                private void installApk(File file){
-                                    if(file != null && file.exists()) {
-                                        ApkUtils.installApk(SheepApp.getInstance(), file.getAbsolutePath());
-                                    }
-                                }
-                                @Override
-                                public void onClick(final View view) {
-                                    if(view instanceof TextView)
-                                        UPGRADE_DIALOG_BT.onEvent("action", ((TextView) view).getText());
-                                    if(file.exists()){//直接安装
-                                        installApk(file);
-                                    } else if(TextUtils.isEmpty(version.getAddress())){//地址错误
-                                        G.showToast(R.string.error_download_link);
-                                    } else {//下载安装
-                                        OkHttpUtils.get().url(version.getAddress()).build().execute(new FileCallBack(ClassFileHelper.DIR, fileName) {
-                                            @Override
-                                            public void inProgress(float progress, long total, int id) {
-                                                if(view instanceof TextView) {
-                                                    TextView btnLeftTextView = (TextView) view;
-                                                    btnLeftTextView.setEnabled(false);
-                                                    btnLeftTextView.setText(String.format(Locale.CHINA, "%d%%", Math.round(progress * 100)));
-                                                }
-                                            }
-                                            @Override
-                                            public void onError(Call call, Exception e, int id) {
-                                                if(view instanceof TextView) {
-                                                    TextView btnLeftTextView = (TextView) view;
-                                                    btnLeftTextView.setEnabled(true);
-                                                    btnLeftTextView.setText("重新下载");
-                                                }
-                                            }
-
-                                            @Override
-                                            public void onResponse(File response, int id) {
-                                                if(view instanceof TextView && response != null && response.exists()) {
-                                                    TextView btnLeftTextView = (TextView) view;
-                                                    btnLeftTextView.setEnabled(true);
-                                                    btnLeftTextView.setText("立即安装");
-                                                }
-                                                installApk(file);
-                                            }
-                                        });
-                                    }
-                                }
-                            });
-                            if(version.isForceUpdate()){//强更
-                                dialogConfig.setCancelable(false);
-                            } else {
-                                dialogConfig.setBtnRightText("下次更新").setBtnRightOnClickListener(new View.OnClickListener() {
-                                    @Override
-                                    public void onClick(View view) {
-                                        SpUtils.saveIgnoreMd5(TestUtil.isSheep() ? version.getVersion_number()+"" : version.getMd5_address());
-                                        if(view instanceof TextView)
-                                            UPGRADE_DIALOG_BT.onEvent("action", ((TextView) view).getText());
-                                    }
-                                });
-                            }
-                            dialog = ViewUtil.showMsgDialog(activity, dialogConfig);
-                        }
+                        Version version = baseMessage.getData(Version.class);
+                        loadVersion(activity, ignoreMd5, action1, version);
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
+                        ACache.get(SheepApp.getInstance()).put("version_url", "");
                         if(ignoreMd5 == null)
                             G.showToast("当前版本为最新版本,无需更新");
                         if(action1 != null)
@@ -550,6 +445,123 @@ public class SysAppUtil {
                 });
     }
 
+    private static void loadVersion(final Activity activity, final String ignoreMd5, final Action1<Integer> action1, final Version version) {
+        if(version == null){
+            if(ignoreMd5 == null)
+                G.showToast("当前版本为最新版本,无需更新");
+            if(action1 != null)
+                action1.call(0);
+            return;
+        }
+        boolean isNewApp;
+        if(TestUtil.isSheep()) {
+            if(ignoreMd5 != null && TextUtils.equals(ignoreMd5, version.getVersion_number()+"") && !version.isForceUpdate()){
+                LogUtil.println("showVersionInfo", "忽略", ignoreMd5, version.getVersion_name());
+                if(action1 != null)
+                    action1.call(0);
+                return;
+            }
+            int versionCode = SysAppUtil.getAppVersionCode();
+            if (versionCode == 0) {
+                if (ignoreMd5 == null)
+                    G.showToast("请稍候重试");//无法获取当前版本号,程序出错
+                if (action1 != null)
+                    action1.call(0);
+                return;
+            }
+            isNewApp = versionCode >= version.getVersion_number();
+        } else {
+            if(ignoreMd5 != null && TextUtils.equals(ignoreMd5, version.getMd5_address()) && !version.isForceUpdate()){
+                LogUtil.println("showVersionInfo", "忽略", ignoreMd5, version.getVersion_name());
+                if(action1 != null)
+                    action1.call(0);
+                return;
+            }
+            String fileMD5 = SysAppUtil.getConnectAdrressFileMD5();
+            if (TextUtils.isEmpty(fileMD5)) {//无法获取当前appMd5值,程序出错
+                if (ignoreMd5 == null)
+                    G.showToast("请稍候重试");
+                if (action1 != null)
+                    action1.call(0);
+                return;
+            }
+            isNewApp = fileMD5.equalsIgnoreCase(version.getMd5_address());
+        }
+        if(isNewApp){//已经是最新版本
+            ACache.get(SheepApp.getInstance()).put("version_url", "");
+            if(ignoreMd5 == null)
+                G.showToast("当前版本为最新版本,无需更新");
+            if(action1 != null)
+                action1.call(0);
+        } else {//有新版本
+            ACache.get(SheepApp.getInstance()).put("version_url", version.getAddress());
+            final String fileName = version.getMd5_address()+".apk";
+            final File file = new File(ClassFileHelper.DIR, fileName);
+            DialogConfig dialogConfig = new DialogConfig();
+            dialogConfig.setTitle("小绵羊V"+version.getVersion_name());
+            dialogConfig.setMsg(TextUtils.isEmpty(version.getUpdate_content()) ? "当前版本小绵羊V"+getConnectAdrressPackageInfo().versionName : version.getUpdate_content()).setLayoutId(R.layout.x_msg_wv_dialog)
+                    .setBtnLeftText(file.exists() ? "立即安装" : "立即更新").setBtnLeftNotDissDialog(true).setBtnLeftOnClickListener(new View.OnClickListener() {
+                private void installApk(File file){
+                    if(file != null && file.exists()) {
+                        ApkUtils.installApk(SheepApp.getInstance(), file.getAbsolutePath());
+                    }
+                }
+                @Override
+                public void onClick(final View view) {
+                    if(view instanceof TextView)
+                        UPGRADE_DIALOG_BT.onEvent("action", ((TextView) view).getText());
+                    if(file.exists()){//直接安装
+                        installApk(file);
+                    } else if(TextUtils.isEmpty(version.getAddress())){//地址错误
+                        G.showToast(R.string.error_download_link);
+                    } else {//下载安装
+                        OkHttpUtils.get().url(version.getAddress()).build().execute(new FileCallBack(ClassFileHelper.DIR, fileName) {
+                            @Override
+                            public void inProgress(float progress, long total, int id) {
+                                if(view instanceof TextView) {
+                                    TextView btnLeftTextView = (TextView) view;
+                                    btnLeftTextView.setEnabled(false);
+                                    btnLeftTextView.setText(String.format(Locale.CHINA, "%d%%", Math.round(progress * 100)));
+                                }
+                            }
+                            @Override
+                            public void onError(Call call, Exception e, int id) {
+                                if(view instanceof TextView) {
+                                    TextView btnLeftTextView = (TextView) view;
+                                    btnLeftTextView.setEnabled(true);
+                                    btnLeftTextView.setText("重新下载");
+                                }
+                            }
+
+                            @Override
+                            public void onResponse(File response, int id) {
+                                if(view instanceof TextView && response != null && response.exists()) {
+                                    TextView btnLeftTextView = (TextView) view;
+                                    btnLeftTextView.setEnabled(true);
+                                    btnLeftTextView.setText("立即安装");
+                                }
+                                installApk(file);
+                            }
+                        });
+                    }
+                }
+            });
+            if(version.isForceUpdate()){//强更
+                dialogConfig.setCancelable(false);
+            } else {
+                dialogConfig.setBtnRightText("下次更新").setBtnRightOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        SpUtils.saveIgnoreMd5(TestUtil.isSheep() ? version.getVersion_number()+"" : version.getMd5_address());
+                        if(view instanceof TextView)
+                            UPGRADE_DIALOG_BT.onEvent("action", ((TextView) view).getText());
+                    }
+                });
+            }
+            dialog = ViewUtil.showMsgDialog(activity, dialogConfig);
+        }
+    }
+
     private static PackageInfo getConnectAdrressPackageInfo() {
         return ApkUtils.getPackageInfo(SheepApp.getInstance().getConnectAddress().getPackageName());
     }
@@ -576,11 +588,20 @@ public class SysAppUtil {
     /**
      * bugly 检查更新
      */
-    public static  boolean checkBuglyUpdate(){
+    public static Version checkBuglyUpdate(){
 //        Beta.checkUpgrade();
         UpgradeInfo upgradeInfo = Beta.getUpgradeInfo();
-        if(upgradeInfo != null)
-            return true;
-        return false;
+        if(upgradeInfo != null) {
+            Version version = new Version();
+            version.setAddress(upgradeInfo.apkUrl);
+            version.setMd5_address(upgradeInfo.apkMd5);
+            version.setStrong_update(upgradeInfo.upgradeType-1);//version.getStrong_update == 1/upgradeInfo.upgradeType == 2 为强更
+            version.setUpdate_content(upgradeInfo.newFeature+"\n"+upgradeInfo.publishType);
+            version.setVersion_name(upgradeInfo.versionName);
+            version.setVersion_number(upgradeInfo.versionCode);
+            version.setUpdate_time((int) (upgradeInfo.publishTime/1000));
+            return version;
+        }
+        return null;
     }
 }

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

@@ -736,7 +736,7 @@ public class ViewUtil {
         }
 
     }
-
+    //在msg前面添加空格
     public static String addIndent(String msg, int indent) {
         if(indent > 0){
             StringBuilder stringBuilder = new StringBuilder();

+ 5 - 13
app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java

@@ -20,22 +20,21 @@ import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.VideoView;
 
-import com.alibaba.fastjson.JSON;
 import com.bumptech.glide.Glide;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.Advertising;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.RxjavaCountDownTimer;
 import com.sheep.gamegroup.util.SysAppUtil;
-import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
-import org.afinal.simplecache.ACache;
+import org.afinal.simplecache.ApiKey;
 
 import java.util.List;
 
@@ -145,10 +144,9 @@ public class SplashAct extends BaseActivity implements EasyPermissions.Permissio
     public void initView() {
         activity = this;
         GlideImageLoader.setImage(login_bg_img, "http://cdngame.kuaifazs.com/login_bg_img.png");
-        ACache mCache = ACache.get(this);
-        Object object = mCache.getAsObject(Advertising.class.getSimpleName());
-        if(object instanceof Advertising ){
-            advertising = (Advertising) object;
+        Advertising cacheAdvertising = CommonUtil.getInstance().getCacheResult(ApiKey.advertisements(1), Advertising.class);
+        if(cacheAdvertising != null){
+            advertising = cacheAdvertising;
             try {
                 loadAdvertising();
             } catch (Exception e) {
@@ -176,13 +174,7 @@ public class SplashAct extends BaseActivity implements EasyPermissions.Permissio
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        Advertising newAdvertising = baseMessage.getData(Advertising.class);
 //                        isLoaddingData = false;
-
-                        if(newAdvertising != null && newAdvertising.isImage()) {
-                            ACache mCache = ACache.get(activity);
-                            mCache.put(Advertising.class.getSimpleName(), newAdvertising);
-                        }
                     }
 
                     @Override

+ 28 - 24
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java

@@ -244,10 +244,10 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         taskEty = taskReleaseEty.getTask();
         nameTv.setText(taskReleaseEty.getName() + "");
         priceTv.setText("+" + taskReleaseEty.getBonus() + "元");
-        if(!taskReleaseEty.getDeadline().equals("永久")){
-            dateTv.setText("截至日期:"+TimeUtil.getDate(TimeUtil.FORMAT, Long.valueOf(taskReleaseEty.getDeadline())) + "");
-        }else {
-            dateTv.setText("截至日期:"+taskReleaseEty.getDeadline());
+        if (!taskReleaseEty.getDeadline().equals("永久")) {
+            dateTv.setText("截至日期:" + TimeUtil.getDate(TimeUtil.FORMAT, Long.valueOf(taskReleaseEty.getDeadline())) + "");
+        } else {
+            dateTv.setText("截至日期:" + taskReleaseEty.getDeadline());
         }
         num_tv.setText("剩" + taskReleaseEty.getLast_num() + "份");
 
@@ -260,6 +260,29 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
 
         detailTaskTv.setVisibility(View.GONE);
 
+
+        setSonVuewShow();
+
+        loadOld();
+
+        //自动审核
+        if (taskEty.getInspect_type() == 3) {
+
+            taskdetail_explain_layout.setVisibility(View.VISIBLE);
+        } else {
+            taskdetail_explain_layout.setVisibility(View.GONE);
+        }
+        /**
+         * detail_task_tv 游戏任务,显示
+         */
+        if (taskEty.isGameTask() && taskEty.isCan_receive_account()) {
+            detailTaskTv.setVisibility(View.VISIBLE);
+            detailTaskTv.setText("领取福利号");
+            detailTaskTv.setBackground(activity.getResources().getDrawable(R.drawable.selector_button_full_main));
+        }
+        updateBottom();
+    }
+    private void updateBottom(){
         bottom_btn_layout.setVisibility(View.VISIBLE);
         btnTaskItem.setVisibility(View.VISIBLE);
         btnUpImag.setVisibility(View.VISIBLE);
@@ -289,22 +312,11 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         if(btn_show)
             bottom_btn_layout.setVisibility(View.GONE);
 
-        setSonVuewShow();
-
-        loadOld();
-
         //任务已经下线
         if(taskReleaseEty.getStatus() == 3 || taskReleaseEty.getStatus() == 4){
             bottom_btn_layout.setVisibility(View.GONE);
         }
 
-        //自动审核
-        if(taskEty.getInspect_type() == 3){
-
-            taskdetail_explain_layout.setVisibility(View.VISIBLE);
-        }else {
-            taskdetail_explain_layout.setVisibility(View.GONE);
-        }
 
         if(gettaskAcceptedEty != null){// && taskEty.getTask_type() == 1000) {//连续任务
             if(!TextUtils.isEmpty(gettaskAcceptedEty.getScreenshots())) {
@@ -347,14 +359,6 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                 btnTaskItem.setVisibility(View.GONE);
             }
         }
-        /**
-         * detail_task_tv 游戏任务,显示
-         */
-        if(taskEty.isGameTask() &&taskEty.isCan_receive_account()){
-            detailTaskTv.setVisibility(View.VISIBLE);
-            detailTaskTv.setText("领取福利号");
-            detailTaskTv.setBackground(activity.getResources().getDrawable(R.drawable.selector_button_full_main));
-        }
     }
     //设置底部按钮状态
     private void setBottomState() {
@@ -981,7 +985,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         if (taskReleaseEty == null){
             freshData();
         } else {
-            initWigget();
+            updateBottom();
         }
     }
 

+ 2 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -28,6 +28,7 @@ import com.sheep.gamegroup.view.activity.SplashAct;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.tencent.bugly.Bugly;
+import com.tencent.bugly.beta.Beta;
 
 import rx.functions.Action1;
 
@@ -135,6 +136,7 @@ public class SheepApp extends BaseApplication {
             }
 
             if(mActivityAount == 0) {
+                Beta.autoDownloadOnWifi = !BuildConfig.DEBUG;
                 Bugly.init(getApplicationContext(), Config.BUGLY_APPID, BuildConfig.DEBUG);
                 AppUsageManager.getInstance().needOpenLookAppUsageStatsPermisson(true);//尝试保存应用使用情况的数据
                 LogUtil.println("SheepApp SHEEP_START");

+ 11 - 0
app/src/main/java/org/afinal/simplecache/ApiKey.java

@@ -43,4 +43,15 @@ public class ApiKey {
     public static String new_run_task(int is_succession){
         return "app/accepted_task/new_run_task/?is_succession="+is_succession;
     }
+    //发现模块标签列表
+    public static final String articles_tags = "app/find/articles_tags/list";
+    //发现模块发现列表
+    public static String articles(int tag_id){
+        return "app/find/articles/list?page=1&per_page=100&tag_id="+tag_id;
+    }
+    //广告
+    public static String advertisements(int type){
+        return "app/advertising/advertisements?type="+type;
+    }
+
 }

+ 1 - 2
app/src/main/res/layout/task_detail_layout.xml

@@ -333,8 +333,7 @@
             android:layout_height="wrap_content"
             android:minHeight="?attr/actionBarSize"
             android:background="@color/background_light_gray"
-            android:orientation="horizontal"
-            android:layout_alignParentBottom="true">
+            android:orientation="horizontal">
 
             <TextView
                 android:id="@+id/btn_task_item"

+ 2 - 2
gradle.properties

@@ -17,8 +17,8 @@
 # org.gradle.parallel=true
 #android.injected.build.model.only.versioned = 3
 
-VERSION_NAME=2.8.0
-VERSION_CODE=2008000
+VERSION_NAME=2.9.0
+VERSION_CODE=2009000
 ANDROID_COMPILE_SDK_VERSION=27
 ANDROID_BUILD_TOOLS_VERSION=27.0.2
 ANDROID_MIN_SDK_VERSION=18