Просмотр исходного кода

fixbug:礼包领取后刷新列表

Sora 1 год назад
Родитель
Сommit
e708dadd6d

+ 4 - 2
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGiftBagList.java

@@ -10,10 +10,10 @@ import androidx.annotation.Nullable;
 import androidx.recyclerview.widget.RecyclerView;
 
 import com.sheep.gamegroup.event.BigEvent;
+import com.sheep.gamegroup.event.EventTypes;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
-import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.view.adapter.GiftCenterAdapter;
 import com.sheep.gamegroup.view.adapter.WelfareAdapter;
 import com.sheep.gamegroup.view.fragment.BaseListFragment2;
@@ -88,7 +88,9 @@ public class FgtGiftBagList extends BaseListFragment2<GiftBagApp> implements Act
 
     @Subscribe
     public void onEventMainThread(BigEvent event) {
-        CommonUtil.getInstance().setEventResultViewStatus(event, binding.viewList);
+        if (event.getEventTypes() == EventTypes.REFRESH_LIBAO_LIST) {
+            refreshData();
+        }
     }
 
     @Override

+ 3 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/GiftCenterAdapter.java

@@ -16,7 +16,6 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GiftBag;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 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.StringUtils;
@@ -106,9 +105,9 @@ public class GiftCenterAdapter extends AdbCommonRecycler<GiftBagApp> {
 
     public static void receiveGiftBag(final Activity activity, final GiftBagApp item, final Action1<Integer> action1) {
         if (UserInfoDataSource.getInstance().hasLogin(activity)) {
-            if (!CommonUtil.getInstance().isInstallApp(item.getApp().getPackage_name(), item.getApp().getName())) {
-                return;
-            }
+//            if (!CommonUtil.getInstance().isInstallApp(item.getApp().getPackage_name(), item.getApp().getName())) {
+//                return;
+//            }
             int gift_bag_id = item.getGift_bag().getId();
             GIFT_BAG_RECEIVE.onEvent("gift_bag_id", gift_bag_id);
             SheepApp.getInstance().getNetComponent().getApiService().receiveGiftBag(gift_bag_id)