Bläddra i källkod

学生端直播间控制只有临时直播间才支持分享

Pq 2 år sedan
förälder
incheckning
3781d5092c

+ 4 - 0
student/src/main/java/com/cooleshow/student/bean/LiveRoomInfoBean.java

@@ -56,6 +56,7 @@ public class LiveRoomInfoBean implements Parcelable {
     public int blacklistFlag;//当前登录人是否是黑名单用户 0否 1是
     public int whether_mic;//是否允许连麦
     public int whether_chat;//是否允许聊天
+    public String roomType;
 
     @Override
     public int describeContents() {
@@ -88,6 +89,7 @@ public class LiveRoomInfoBean implements Parcelable {
         dest.writeInt(this.blacklistFlag);
         dest.writeInt(this.whether_mic);
         dest.writeInt(this.whether_chat);
+        dest.writeString(this.roomType);
     }
 
     public void readFromParcel(Parcel source) {
@@ -115,6 +117,7 @@ public class LiveRoomInfoBean implements Parcelable {
         this.blacklistFlag = source.readInt();
         this.whether_mic = source.readInt();
         this.whether_chat = source.readInt();
+        this.roomType = source.readString();
     }
 
     public LiveRoomInfoBean() {
@@ -145,6 +148,7 @@ public class LiveRoomInfoBean implements Parcelable {
         this.blacklistFlag = in.readInt();
         this.whether_mic = in.readInt();
         this.whether_chat = in.readInt();
+        this.roomType = in.readString();
     }
 
     public static final Creator<LiveRoomInfoBean> CREATOR = new Creator<LiveRoomInfoBean>() {

+ 12 - 0
student/src/main/java/com/cooleshow/student/ui/live/LiveRoomActivity.java

@@ -908,6 +908,11 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
         mRoomInfoBean = roomInfoBean;
         isPcClientLive = TextUtils.equals(mRoomInfoBean.os, "pc");
         resetVideoContainer(!isPcClientLive);
+        if (isShowShare()) {
+            viewBinding.ivShare.setVisibility(View.VISIBLE);
+        } else {
+            viewBinding.ivShare.setVisibility(View.GONE);
+        }
         currentAddLikeCount = roomInfoBean.likeNum;
         //连麦模式
         isEnableMic = roomInfoBean.whether_mic == 1;
@@ -2268,4 +2273,11 @@ public class LiveRoomActivity extends BaseMVPActivity<ActivityLiveroomLayoutBind
     public void onCancel(SHARE_MEDIA share_media) {
         ToastUtil.getInstance().showShort("分享取消了");
     }
+
+    private boolean isShowShare() {
+        if (TextUtils.equals(mRoomInfoBean.roomType, "TEMP")) {
+            return true;
+        }
+        return false;
+    }
 }

+ 1 - 0
student/src/main/res/layout/activity_liveroom_layout.xml

@@ -264,6 +264,7 @@
         app:layout_constraintRight_toRightOf="parent" />
 
     <ImageView
+        android:visibility="gone"
         android:id="@+id/iv_share"
         android:layout_marginEnd="11dp"
         app:layout_constraintRight_toLeftOf="@+id/iv_mic"