瀏覽代碼

feat: 直播间推荐游戏

tongmengxiao 1 年之前
父節點
當前提交
99dc9db9fd

+ 19 - 9
room/src/main/java/com/swago/room/base/BaseComFragment.kt

@@ -464,15 +464,6 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
             }
             }
         }
         }
 
 
-        //推荐游戏列表
-        roomVm.recommendGameListModelLiveData.observe(this){
-            binding.playBannerView.setData(it.list)
-            binding.playBannerView.jumpToWebFun = { game ->
-                setRecommendGame(game)
-
-            }
-        }
-
         //直播间配置
         //直播间配置
         roomVm.roomConfigLiveData.observe(this) {
         roomVm.roomConfigLiveData.observe(this) {
             this.roomConfig = it
             this.roomConfig = it
@@ -787,6 +778,25 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
                 }
                 }
             }
             }
         }
         }
+
+        //推荐游戏列表
+        roomVm.recommendGameListModelLiveData.observe(this){
+            if (iRoomInfo.getRoomType() == RoomType.AUDIO.type){
+                binding.playBannerView.setData(it.list)
+                binding.playBannerView.jumpToWebFun = { game ->
+                    setRecommendGame(game)
+
+                }
+            } else if (iRoomInfo.getRoomType() == RoomType.VIDEO.type){
+                binding.videoPlayBannerView.setData(it.list)
+                binding.videoPlayBannerView.jumpToWebFun = { game ->
+                    setRecommendGame(game)
+
+                }
+            }
+
+        }
+
     }
     }
 
 
     fun setGameDefaultData(index: Int) {
     fun setGameDefaultData(index: Int) {

+ 11 - 0
room/src/main/res/layout/fragment_base_com.xml

@@ -117,6 +117,17 @@
         android:layout_width="wrap_content"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
         android:layout_height="wrap_content"/>
 
 
+    <com.swago.room.widget.RecommendBannerView
+        android:id="@+id/videoPlayBannerView"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        android:layout_marginRight="8dp"
+        android:layout_marginTop="180dp"
+        android:visibility="gone"
+        tools:visibility="visible" />
+
     <com.swago.room.widget.RoomWishGiftBannerView
     <com.swago.room.widget.RoomWishGiftBannerView
         android:id="@+id/bannerWishGift"
         android:id="@+id/bannerWishGift"
         android:layout_marginTop="110dp"
         android:layout_marginTop="110dp"