Forráskód Böngészése

1.直播列表添加直播状态和直播介绍

王鹏鹏 2 éve
szülő
commit
755e23f308

+ 2 - 2
baselib/build.gradle

@@ -40,7 +40,7 @@ android {
             buildConfigField "String", "BAIDU_SECRETKEY", "\"41Fzb2ZIuKRGNtrVcQOHxEI3vFM4Rkxi\""
             buildConfigField "Boolean", "SINGLE_MODULE", "${singleModule}"
             buildConfigField "String", "BUGLY_APPID", "\"d400f20398\""
-            buildConfigField "String", "API_URL", "\"http://192.168.0.122:8110\""
+            buildConfigField "String", "API_URL", "\"http://60.205.201.7:8110\""
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
         }
 
@@ -54,7 +54,7 @@ android {
             buildConfigField "String", "BAIDU_SECRETKEY", "\"41Fzb2ZIuKRGNtrVcQOHxEI3vFM4Rkxi\""
             buildConfigField "Boolean", "SINGLE_MODULE", "${singleModule}"
             buildConfigField "String", "BUGLY_APPID", "\"ad3db4d529\""
-            buildConfigField "String", "API_URL", "\"http://192.168.0.122:8110\""
+            buildConfigField "String", "API_URL", "\"http://60.205.201.7:8110\""
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
         }
     }

+ 19 - 1
livebroadcast/src/main/java/com/yingyang/livebroadcast/adapter/LiveBroadcastAdapter.kt

@@ -37,7 +37,25 @@ class LiveBroadcastAdapter(override val layoutId: Int = R.layout.item_live_broad
             } else {
                 binding.tvTitle.text = "预约直播"
             }
-        } else {
+        } else if (TextUtils.equals("直播中", method)) {
+            binding.tvTitle.text = when (item.liveStatus) {
+                "1" -> {
+                    "未开始"
+                }
+                "2" -> {
+                    "直播中"
+                }
+                "3" -> {
+                    "已结束"
+                }
+                "4" -> {
+                    "已取消"
+                }
+                else -> {
+                    ""
+                }
+            }
+        } else if (TextUtils.equals("直播回放", method)) {
             binding.tvTitle.text = method
         }
         binding.layoutLiveBroadcast.setOnSingleClickListener {

+ 16 - 1
livebroadcast/src/main/res/layout/item_live_broadcast.xml

@@ -45,6 +45,21 @@
             app:layout_constraintStart_toEndOf="@+id/headImage"
             app:layout_constraintTop_toTopOf="parent" />
 
+        <androidx.appcompat.widget.AppCompatTextView
+            android:id="@+id/tvContent"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="@dimen/divider_20px"
+            android:layout_marginTop="@dimen/divider_8px"
+            android:layout_marginEnd="@dimen/divider_21px"
+            android:text="@{data.liveDesn}"
+            android:textColor="@android:color/white"
+            android:textSize="@dimen/divider_28px"
+            android:textStyle="bold"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toEndOf="@+id/headImage"
+            app:layout_constraintTop_toBottomOf="@+id/tvName" />
+
         <androidx.appcompat.widget.AppCompatTextView
             android:id="@+id/tvTitle"
             android:layout_width="@dimen/divider_160px"
@@ -56,7 +71,7 @@
             android:textColor="@color/color_345382"
             android:textSize="@dimen/divider_24px"
             app:layout_constraintStart_toEndOf="@+id/headImage"
-            app:layout_constraintTop_toBottomOf="@+id/tvName" />
+            app:layout_constraintTop_toBottomOf="@+id/tvContent" />
 
     </androidx.constraintlayout.widget.ConstraintLayout>