Browse Source

没有数据时 隐藏热门福利和下载福利

zengjiebin 7 years ago
parent
commit
dff83d9854

+ 6 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtWelfareCenter.java

@@ -68,6 +68,10 @@ public class FgtWelfareCenter extends BaseFragment{
     RecyclerView wcGiftCenterList;
     @BindView(R.id.bottom_line_text)
     TextView bottomLineText;
+    @BindView(R.id.wc_hot_welfare_list_ll)
+    LinearLayout wc_hot_welfare_list_ll;
+    @BindView(R.id.wc_download_welfare_list_ll)
+    LinearLayout wc_download_welfare_list_ll;
     @BindView(R.id.bottom_line)
     LinearLayout bottomLine;
 
@@ -269,6 +273,8 @@ public class FgtWelfareCenter extends BaseFragment{
             refresh.setRefreshing(false);
         wc_gift_center_title_container.setVisibility(giftCenterList.isEmpty() ? View.GONE : View.VISIBLE);
         wc_gift_center_title_line.setVisibility(giftCenterList.isEmpty() ? View.GONE : View.VISIBLE);
+        ViewUtil.setVisibility(wc_hot_welfare_list_ll, !hotWelfareList.isEmpty());
+        ViewUtil.setVisibility(wc_download_welfare_list_ll, !downloadWelfareList.isEmpty());
     }
 
 

+ 48 - 34
app/src/main/res/layout/fgt_welfare_center.xml

@@ -14,47 +14,61 @@
             android:layout_height="match_parent"
             android:orientation="vertical">
 
-            <RelativeLayout style="@style/style_wc_rl">
-
-                <TextView
-                    style="@style/style_wc_line_title"
-                    android:text="热门福利" />
-            </RelativeLayout>
-
-            <android.support.v7.widget.RecyclerView
-                android:id="@+id/wc_hot_welfare_list"
+            <LinearLayout
+                android:id="@+id/wc_hot_welfare_list_ll"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content" />
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
 
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="10dp"
-                android:background="#fff5f5f5" />
+                <RelativeLayout style="@style/style_wc_rl">
 
-            <RelativeLayout style="@style/style_wc_rl">
+                    <TextView
+                        style="@style/style_wc_line_title"
+                        android:text="热门福利" />
+                </RelativeLayout>
 
-                <TextView
-                    style="@style/style_wc_line_title"
-                    android:text="下载福利" />
-
-                <TextView
-                    android:id="@+id/wc_all_welfare"
-                    style="@style/style_wc_more"
-                    android:text="全部福利" />
-            </RelativeLayout>
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/wc_hot_welfare_list"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content" />
 
-            <android.support.v7.widget.RecyclerView
-                android:id="@+id/wc_download_welfare_list"
-                android:layout_width="match_parent"
-                android:paddingTop="4dp"
-                android:paddingBottom="4dp"
-                android:layout_height="wrap_content" />
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="10dp"
+                    android:background="#fff5f5f5" />
+            </LinearLayout>
 
-            <View
-                android:id="@+id/wc_gift_center_title_line"
+            <LinearLayout
+                android:id="@+id/wc_download_welfare_list_ll"
                 android:layout_width="match_parent"
-                android:layout_height="10dp"
-                android:background="#fff5f5f5" />
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+
+                <RelativeLayout style="@style/style_wc_rl">
+
+                    <TextView
+                        style="@style/style_wc_line_title"
+                        android:text="下载福利" />
+
+                    <TextView
+                        android:id="@+id/wc_all_welfare"
+                        style="@style/style_wc_more"
+                        android:text="全部福利" />
+                </RelativeLayout>
+
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/wc_download_welfare_list"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingTop="4dp"
+                    android:paddingBottom="4dp" />
+
+                <View
+                    android:id="@+id/wc_gift_center_title_line"
+                    android:layout_width="match_parent"
+                    android:layout_height="10dp"
+                    android:background="#fff5f5f5" />
+            </LinearLayout>
 
             <RelativeLayout
                 android:id="@+id/wc_gift_center_title_container"

+ 36 - 0
app/src/main/res/layout/item_title_info_list.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <View
+        android:id="@+id/item_title_info_list_top"
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:background="#F2F2F2" />
+
+    <TextView
+        android:id="@+id/item_title_info_list_tv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingEnd="26dp"
+        android:paddingStart="26dp"
+        android:paddingTop="20dp"
+        android:textColor="#ff333333"
+        android:textSize="13sp"
+        android:text="@string/app_name" />
+
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/item_title_info_list_rv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <View
+        android:id="@+id/item_title_info_list_bottom"
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:background="#f5f5f5"
+        android:visibility="gone" />
+</LinearLayout>