浏览代码

抢任务模块优化

liujiangyao 7 年之前
父节点
当前提交
985639ecf9

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

@@ -2365,7 +2365,7 @@ public class CommonUtil {
      * 抢任务
      */
     public void robTask(final Action1<RobTask> action1) {
-        SheepApp.getInstance().getNetComponent().getApiService().getNewTask(SpUtils.getOrder("order"))
+        SheepApp.getInstance().getNetComponent().getApiService().getNewTask(SheepApp.getInstance().getOrder())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {

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

@@ -216,6 +216,7 @@ public class ViewUtil {
                     try {
                         mRobTask = robTask;
                         SpUtils.saveOrder("order", mRobTask.getOrder());
+                        SheepApp.getInstance().setOrder(mRobTask.getOrder());
                         tvDutyMoney.setText("+"+mRobTask.getM().getBonus() + "元");//设置任务奖励金额
                         tvTitel.setText(mRobTask.getM().getName()+"");//设置任务名字--getTask().getTask_name()
                         GlideImageLoader.setImage(ivIcon, mRobTask.getM().getTask().getIcon());//设置任务图标

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActSetting.java

@@ -71,6 +71,7 @@ public class ActSetting extends BaseActivity {
                                 SysAppUtil.clearCache(new Action1<Object>() {
                                     @Override
                                     public void call(Object o) {
+                                        SheepApp.getInstance().setOrder(1);
                                         G.showToast("清理缓存完成");
                                         initCacheSize();
                                     }

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

@@ -73,6 +73,15 @@ public class SheepApp extends MultiDexApplication {
     private String gameCode;//游戏code
     private String gamePackgeName;
     private boolean gameFlag;
+    private int order = 1;
+
+    public int getOrder() {
+        return order;
+    }
+
+    public void setOrder(int order) {
+        this.order = order;
+    }
 
     public boolean isGameFlag() {
         return gameFlag;

+ 17 - 10
app/src/main/res/layout/fgt_try_makemoney_layout.xml

@@ -18,23 +18,30 @@
         <!--android:layout_height="match_parent"-->
         <!--android:descendantFocusability="blocksDescendants" />-->
 
-
-    <com.scwang.smartrefresh.layout.SmartRefreshLayout
-        android:id="@+id/refreshLayout"
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:orientation="vertical">
 
-        <android.support.v7.widget.RecyclerView
-            android:id="@+id/recyclerview"
+        <com.scwang.smartrefresh.layout.SmartRefreshLayout
+            android:id="@+id/refreshLayout"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:background="#fff"
-            android:overScrollMode="never" />
+            android:layout_height="0dp"
+            android:layout_weight="1">
+
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/recyclerview"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="#fff"
+                android:overScrollMode="never" />
+
+        </com.scwang.smartrefresh.layout.SmartRefreshLayout>
 
         <include layout="@layout/find_item_bottom"
             android:layout_below="@+id/refreshLayout"
             android:layout_height="wrap_content"
             android:layout_width="match_parent"/>
 
-    </com.scwang.smartrefresh.layout.SmartRefreshLayout>
+    </LinearLayout>
 </RelativeLayout>