Prechádzať zdrojové kódy

礼包中心暂时不修改了,产品又有变化

zengjiebin 7 rokov pred
rodič
commit
7c6f177001

+ 19 - 2
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGiftCenter.java

@@ -82,7 +82,23 @@ public class FgtGiftCenter extends BaseFragment{
         fgt_gift_center_x_list.setLayoutManager(new GridLayoutManager(SheepApp.getInstance(), 4));
         BaseQuickAdapter gameGroupAdp = new AdpGiftBagGameGroup(gameGroupList);
         gameGroupAdp.bindToRecyclerView(fgt_gift_center_x_list);
-        gameGroupAdp.setOnItemClickListener((adapter, view, position) -> Jump2View.getInstance().goEntity(ListUtil.getItem(gameGroupList, position)));
+        gameGroupAdp.setOnItemClickListener((adapter, view, position) -> {
+            GameGroup item = ListUtil.getItem(gameGroupList, position);
+            if(item == null){
+                G.showToast(R.string.please_contact_customer_service);
+                return;
+            }
+            int size = ListUtil.size(item.getApplications());
+            switch (size){
+                case 0:
+                    break;
+                case 1:
+                    Jump2View.getInstance().goEntity(item.getFirstApplications());
+                    break;
+                default:
+                    break;
+            }
+        });
 
         refresh.setOnRefreshListener(refreshLayout -> refreshData());
         RefreshUtil.newInstance().publicParameter(refresh, getActivity());
@@ -119,7 +135,8 @@ public class FgtGiftCenter extends BaseFragment{
     }
 
     private void initXList() {
-        gameGroupList.clear();
+        if(!TestUtil.isDev())
+            gameGroupList.clear();
         ViewUtil.notifyDataSetChanged(fgt_gift_center_x_list);
         SheepApp.getInstance().getNetComponent().getApiService().getGiftBagGameGroup()
                 .subscribeOn(Schedulers.io())

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

@@ -2807,16 +2807,20 @@ public class CommonUtil {
             }
             String[] items = copy.split(";");
             int i = 0;
-            int n = Integer.parseInt(items[i++]);
-            p = Integer.parseInt(items[i++]);
-            w = Integer.parseInt(items[i++]);
-            x = Integer.parseInt(items[i++]);
-            y = Integer.parseInt(items[i++]);
-            while (n != child_list.size()){
-                if(n > child_list.size())
-                    child_list.add(child_list.get(0));
-                else
-                    child_list.remove(0);
+            try {
+                int n = Integer.parseInt(items[i++]);
+                p = Integer.parseInt(items[i++]);
+                w = Integer.parseInt(items[i++]);
+                x = Integer.parseInt(items[i++]);
+                y = Integer.parseInt(items[i++]);
+                while (n != child_list.size()){
+                    if(n > child_list.size())
+                        child_list.add(child_list.get(0));
+                    else
+                        child_list.remove(0);
+                }
+            }catch (Exception e){
+                e.printStackTrace();
             }
         }
 

+ 5 - 1
app/src/main/res/layout/fgt_gift_center.xml

@@ -62,7 +62,11 @@
             <android.support.v7.widget.RecyclerView
                 android:id="@+id/fgt_gift_center_x_list"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content" />
+                android:layout_height="wrap_content"
+                android:layout_marginTop="26dp"
+                android:layout_marginBottom="20dp"
+                android:layout_marginStart="3dp"
+                android:layout_marginEnd="3dp"/>
 
         </LinearLayout>
 

+ 6 - 6
app/src/main/res/layout/item_gift_bag_game_group.xml

@@ -1,26 +1,26 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_gravity="center"
     android:orientation="vertical"
-    android:paddingTop="16dp"
-    android:paddingBottom="16dp">
+    android:paddingTop="8dp"
+    android:paddingBottom="8dp">
 
     <ImageView
         android:id="@+id/item_icon_iv"
         android:layout_width="64dp"
         android:layout_height="64dp"
         android:layout_gravity="center"
-        android:layout_marginStart="8dp"
-        android:layout_marginEnd="8dp"
+        android:layout_marginStart="14dp"
+        android:layout_marginEnd="14dp"
         android:src="@mipmap/sheep_logo" />
 
     <TextView
         android:id="@+id/item_name_tv"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginTop="8dp"
+        android:layout_marginTop="3dp"
         android:ellipsize="end"
         android:gravity="center"
         android:paddingStart="4dp"