瀏覽代碼

修复点击游戏任务中的预约下载提示报错的bug;预约成功后刷新详情界面;预约游戏列表中的按钮优化

zengjiebin 7 年之前
父節點
當前提交
36f83b5b5f

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

@@ -607,14 +607,19 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                     }
                     break;
                 case R.id.btn_up_imag:
-                    if(gettaskAcceptedEty.getStatus() ==3 &&taskEty.isGameTask()){
+                    if(gettaskAcceptedEty != null && gettaskAcceptedEty.getStatus() ==3 &&taskEty.isGameTask()){
                         if(taskEty.getThird_task_id() != null){
                             ViewUtil.showGamePayAccount(activity, taskEty.getThird_task_id(), taskReleaseEty.getName());
                             return;
                         }
                     }else if(taskEty.isGameTask()){
                         if(taskEty.isGameReservationCantDownload()){
-                            CommonUtil.getInstance().reservationGameTask(activity, taskReleaseEty, null);
+                            CommonUtil.getInstance().reservationGameTask(activity, taskReleaseEty, new Action1<Integer>() {
+                                @Override
+                                public void call(Integer integer) {
+                                    freshData();
+                                }
+                            });
                         } else {
                             accepteReceiveAward();
                         }

+ 13 - 5
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtMyGame.java

@@ -122,12 +122,11 @@ public class FgtMyGame extends BaseFragment {
     private void initData() {
         refresh.setRefreshing(true);
         List<OrienteeringDetail> newList = DataUtil.getInstance().getCacheList(ApiKey.my_games, OrienteeringDetail.class);
-        if(newList == null){
-            refreshData();
-        } else {
-            list = newList;
+        if(!ListUtil.isEmpty(newList)) {
+            ListUtil.addAll(list, newList);
             notifyDataSetChanged();
         }
+        refreshData();
     }
     private void refreshData() {
         SheepApp.getInstance().getNetComponent().getApiService().getMyGames(page, per_page)
@@ -183,10 +182,19 @@ public class FgtMyGame extends BaseFragment {
         unbinder.unbind();
     }
 
+    private int onResumeCount = 0;
     @Override
     public void onResume() {
         super.onResume();
-        initData();
+        switch (onResumeCount){
+            case 0:
+                initData();//第一次先加载缓存
+                break;
+            default:
+                refreshData();
+                break;
+        }
+        onResumeCount++;
     }
 
     //在这里处理任务执行中的状态,如进度进度条的刷新

+ 0 - 1
app/src/main/res/layout/find_reservation_item.xml

@@ -49,7 +49,6 @@
     <TextView
         android:id="@+id/find_information_game_bt2"
         style="@style/style_button_find2"
-        android:layout_width="100dp"
         android:text="立即预约"
         app:layout_constraintBottom_toBottomOf="@+id/find_information_game_icon"
         app:layout_constraintEnd_toEndOf="parent"