라이브 - 공지 UI 수정
This commit is contained in:
		| @@ -138,7 +138,7 @@ dependencies { | ||||
|     implementation "io.github.bootpay:android:4.3.4" | ||||
|  | ||||
|     // agora | ||||
|     implementation "io.agora.rtc:voice-sdk:4.1.0-1" | ||||
|     implementation "io.agora.rtc:voice-sdk:4.2.6" | ||||
|     implementation 'io.agora.rtm:rtm-sdk:1.5.3' | ||||
|  | ||||
|     // sound visualizer | ||||
|   | ||||
| @@ -454,7 +454,6 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB | ||||
|             dialog.show(screenWidth) | ||||
|         } | ||||
|         binding.tvNotification.setOnClickListener { viewModel.toggleShowNotice() } | ||||
|         binding.rlNotice.setOnClickListener { viewModel.toggleExpandNotice() } | ||||
|  | ||||
|         binding.tvBgSwitch.setOnClickListener { viewModel.toggleBackgroundImage() } | ||||
|         binding.llDonation.setOnClickListener { | ||||
| @@ -821,17 +820,9 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB | ||||
|  | ||||
|         viewModel.isShowNotice.observe(this) { | ||||
|             if (it) { | ||||
|                 binding.rlNotice.visibility = View.VISIBLE | ||||
|                 binding.llNotice.visibility = View.VISIBLE | ||||
|             } else { | ||||
|                 binding.rlNotice.visibility = View.GONE | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         viewModel.isExpandNotice.observe(this) { | ||||
|             binding.tvNotice.maxLines = if (it) { | ||||
|                 Int.MAX_VALUE | ||||
|             } else { | ||||
|                 1 | ||||
|                 binding.llNotice.visibility = View.GONE | ||||
|             } | ||||
|         } | ||||
|  | ||||
| @@ -1146,10 +1137,14 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB | ||||
|         isMicrophoneMute = !isMicrophoneMute | ||||
|         agora.muteLocalAudioStream(isMicrophoneMute) | ||||
|  | ||||
|         if (isMicrophoneMute) { | ||||
|             speakerListAdapter.muteSpeakers.add(SharedPreferenceManager.userId.toInt()) | ||||
|         if (SharedPreferenceManager.userId == viewModel.roomInfoResponse.creatorId) { | ||||
|             setMuteSpeakerCreator(isMicrophoneMute) | ||||
|         } else { | ||||
|             speakerListAdapter.muteSpeakers.remove(SharedPreferenceManager.userId.toInt()) | ||||
|             if (isMicrophoneMute) { | ||||
|                 speakerListAdapter.muteSpeakers.add(SharedPreferenceManager.userId.toInt()) | ||||
|             } else { | ||||
|                 speakerListAdapter.muteSpeakers.remove(SharedPreferenceManager.userId.toInt()) | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
| @@ -1459,6 +1454,14 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private fun setMuteSpeakerCreator(isMute: Boolean) { | ||||
|         binding.ivMute.visibility = if (isMute) { | ||||
|             View.VISIBLE | ||||
|         } else { | ||||
|             View.GONE | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private val rtcEventHandler = object : IRtcEngineEventHandler() { | ||||
|         @SuppressLint("NotifyDataSetChanged") | ||||
|         override fun onAudioVolumeIndication( | ||||
| @@ -1512,12 +1515,16 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB | ||||
|         override fun onUserMuteAudio(uid: Int, muted: Boolean) { | ||||
|             super.onUserMuteAudio(uid, muted) | ||||
|             handler.post { | ||||
|                 if (muted) { | ||||
|                     speakerListAdapter.muteSpeakers.add(uid) | ||||
|                 if (uid == viewModel.roomInfoResponse.creatorId.toInt()) { | ||||
|                     setMuteSpeakerCreator(muted) | ||||
|                 } else { | ||||
|                     speakerListAdapter.muteSpeakers.remove(uid) | ||||
|                     if (muted) { | ||||
|                         speakerListAdapter.muteSpeakers.add(uid) | ||||
|                     } else { | ||||
|                         speakerListAdapter.muteSpeakers.remove(uid) | ||||
|                     } | ||||
|                     speakerListAdapter.notifyDataSetChanged() | ||||
|                 } | ||||
|                 speakerListAdapter.notifyDataSetChanged() | ||||
|             } | ||||
|             Logger.e("onUserMuteAudio - uid: $uid, muted: $muted") | ||||
|         } | ||||
|   | ||||
| @@ -50,14 +50,10 @@ class LiveRoomViewModel( | ||||
|     val toastLiveData: LiveData<String?> | ||||
|         get() = _toastLiveData | ||||
|  | ||||
|     private val _isShowNotice = MutableLiveData(true) | ||||
|     private val _isShowNotice = MutableLiveData(false) | ||||
|     val isShowNotice: LiveData<Boolean> | ||||
|         get() = _isShowNotice | ||||
|  | ||||
|     private val _isExpandNotice = MutableLiveData(false) | ||||
|     val isExpandNotice: LiveData<Boolean> | ||||
|         get() = _isExpandNotice | ||||
|  | ||||
|     private val _totalDonationCan = MutableLiveData(0) | ||||
|     val totalDonationCan: LiveData<Int> | ||||
|         get() = _totalDonationCan | ||||
| @@ -361,11 +357,6 @@ class LiveRoomViewModel( | ||||
|  | ||||
|     fun toggleShowNotice() { | ||||
|         _isShowNotice.value = !isShowNotice.value!! | ||||
|         _isExpandNotice.value = false | ||||
|     } | ||||
|  | ||||
|     fun toggleExpandNotice() { | ||||
|         _isExpandNotice.value = !isExpandNotice.value!! | ||||
|     } | ||||
|  | ||||
|     fun toggleBackgroundImage() { | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 545 B | 
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/drawable-xxhdpi/ic_notice_triangle.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								app/src/main/res/drawable-xxhdpi/ic_notice_triangle.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 419 B | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB | 
| @@ -9,13 +9,13 @@ | ||||
|  | ||||
|     <ImageView | ||||
|         android:id="@+id/iv_cover" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_width="0dp" | ||||
|         android:layout_height="0dp" | ||||
|         android:contentDescription="@null" | ||||
|         android:visibility="gone" | ||||
|         app:layout_constraintBottom_toBottomOf="parent" | ||||
|         app:layout_constraintEnd_toEndOf="parent" | ||||
|         app:layout_constraintStart_toStartOf="parent" /> | ||||
|         app:layout_constraintStart_toStartOf="parent" | ||||
|         app:layout_constraintTop_toBottomOf="@id/ll_top" /> | ||||
|  | ||||
|     <View | ||||
|         android:layout_width="0dp" | ||||
| @@ -37,9 +37,70 @@ | ||||
|         app:layout_constraintBottom_toTopOf="@+id/rl_input_chat" | ||||
|         app:layout_constraintEnd_toStartOf="@+id/ll_option_buttons" | ||||
|         app:layout_constraintStart_toStartOf="parent" | ||||
|         app:layout_constraintTop_toBottomOf="@+id/ll_top" | ||||
|         app:layout_constraintTop_toBottomOf="@+id/fl_margin" | ||||
|         app:layout_goneMarginEnd="0dp" /> | ||||
|  | ||||
|     <FrameLayout | ||||
|         android:id="@+id/fl_margin" | ||||
|         android:layout_width="0dp" | ||||
|         android:layout_height="16dp" | ||||
|         android:background="@color/color_222222" | ||||
|         app:layout_constraintEnd_toEndOf="parent" | ||||
|         app:layout_constraintStart_toStartOf="parent" | ||||
|         app:layout_constraintTop_toBottomOf="@+id/ll_top" /> | ||||
|  | ||||
|     <LinearLayout | ||||
|         android:id="@+id/ll_notice" | ||||
|         android:layout_width="0dp" | ||||
|         android:layout_height="0dp" | ||||
|         android:layout_marginHorizontal="13.3dp" | ||||
|         android:layout_marginBottom="13.3dp" | ||||
|         android:orientation="vertical" | ||||
|         app:layout_constraintBottom_toTopOf="@+id/rl_input_chat" | ||||
|         app:layout_constraintEnd_toEndOf="parent" | ||||
|         app:layout_constraintStart_toStartOf="parent" | ||||
|         app:layout_constraintTop_toBottomOf="@+id/ll_top"> | ||||
|  | ||||
|         <ImageView | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:contentDescription="@null" | ||||
|             android:src="@drawable/ic_notice_triangle" /> | ||||
|  | ||||
|         <ScrollView | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:scrollbars="none"> | ||||
|  | ||||
|             <LinearLayout | ||||
|                 android:layout_width="wrap_content" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:background="@color/color_333333" | ||||
|                 android:orientation="vertical" | ||||
|                 android:padding="8dp"> | ||||
|  | ||||
|                 <TextView | ||||
|                     android:id="@+id/tv_notice_big" | ||||
|                     android:layout_width="wrap_content" | ||||
|                     android:layout_height="wrap_content" | ||||
|                     android:fontFamily="@font/gmarket_sans_bold" | ||||
|                     android:text="[방송공지] " | ||||
|                     android:textColor="@color/white" | ||||
|                     android:textSize="11.3sp" /> | ||||
|  | ||||
|                 <TextView | ||||
|                     android:id="@+id/tv_notice" | ||||
|                     android:layout_width="wrap_content" | ||||
|                     android:layout_height="wrap_content" | ||||
|                     android:fontFamily="@font/gmarket_sans_light" | ||||
|                     android:lineSpacingExtra="4dp" | ||||
|                     android:textColor="@color/white" | ||||
|                     android:textSize="11.3sp" | ||||
|                     tools:text="jkljkljkljkljkljkljkl" /> | ||||
|             </LinearLayout> | ||||
|         </ScrollView> | ||||
|     </LinearLayout> | ||||
|  | ||||
|     <LinearLayout | ||||
|         android:id="@+id/ll_top" | ||||
|         android:layout_width="0dp" | ||||
| @@ -67,7 +128,7 @@ | ||||
|                 android:paddingVertical="4.7dp" | ||||
|                 android:text="나가기" | ||||
|                 android:textColor="@color/color_ff5c49" | ||||
|                 android:textSize="10sp" | ||||
|                 android:textSize="12sp" | ||||
|                 tools:ignore="SmallSp" /> | ||||
|  | ||||
|             <LinearLayout | ||||
| @@ -91,7 +152,7 @@ | ||||
|                     android:paddingVertical="4.7dp" | ||||
|                     android:text="배경 OFF" | ||||
|                     android:textColor="@color/color_eeeeee" | ||||
|                     android:textSize="10sp" | ||||
|                     android:textSize="12sp" | ||||
|                     tools:ignore="SmallSp" /> | ||||
|  | ||||
|                 <ImageView | ||||
| @@ -101,7 +162,7 @@ | ||||
|                     android:layout_marginEnd="5.3dp" | ||||
|                     android:background="@drawable/bg_round_corner_5_3_transparent_bbbbbb" | ||||
|                     android:contentDescription="@null" | ||||
|                     android:padding="2.7dp" | ||||
|                     android:padding="4dp" | ||||
|                     android:src="@drawable/ic_share" /> | ||||
|  | ||||
|                 <ImageView | ||||
| @@ -128,19 +189,35 @@ | ||||
|                 android:background="@drawable/bg_round_corner_5_3_transparent_bbbbbb" | ||||
|                 android:padding="5.3dp"> | ||||
|  | ||||
|                 <ImageView | ||||
|                     android:id="@+id/iv_creator_profile" | ||||
|                     android:layout_width="33.3dp" | ||||
|                     android:layout_height="33.3dp" | ||||
|                     android:layout_centerVertical="true" | ||||
|                     android:contentDescription="@null" /> | ||||
|  | ||||
|                 <ImageView | ||||
|                     android:id="@+id/iv_creator_profile_bg" | ||||
|                 <RelativeLayout | ||||
|                     android:id="@+id/rl_creator_profile" | ||||
|                     android:layout_width="36.7dp" | ||||
|                     android:layout_height="36.7dp" | ||||
|                     android:background="@drawable/bg_round_corner_46_7_transparent_3bb9f1" | ||||
|                     android:contentDescription="@null" /> | ||||
|                     android:layout_height="36.7dp"> | ||||
|  | ||||
|                     <ImageView | ||||
|                         android:id="@+id/iv_creator_profile" | ||||
|                         android:layout_width="33.3dp" | ||||
|                         android:layout_height="33.3dp" | ||||
|                         android:layout_centerInParent="true" | ||||
|                         android:contentDescription="@null" /> | ||||
|  | ||||
|                     <ImageView | ||||
|                         android:id="@+id/iv_creator_profile_bg" | ||||
|                         android:layout_width="match_parent" | ||||
|                         android:layout_height="match_parent" | ||||
|                         android:layout_centerInParent="true" | ||||
|                         android:background="@drawable/bg_round_corner_46_7_transparent_3bb9f1" | ||||
|                         android:contentDescription="@null" /> | ||||
|  | ||||
|                     <ImageView | ||||
|                         android:id="@+id/iv_mute" | ||||
|                         android:layout_width="match_parent" | ||||
|                         android:layout_height="match_parent" | ||||
|                         android:layout_centerInParent="true" | ||||
|                         android:contentDescription="@null" | ||||
|                         android:src="@drawable/ic_mute" | ||||
|                         android:visibility="gone" /> | ||||
|                 </RelativeLayout> | ||||
|  | ||||
|                 <LinearLayout | ||||
|                     android:layout_width="wrap_content" | ||||
| @@ -148,7 +225,7 @@ | ||||
|                     android:layout_centerVertical="true" | ||||
|                     android:layout_marginHorizontal="5.3dp" | ||||
|                     android:layout_toStartOf="@+id/iv_creator_follow" | ||||
|                     android:layout_toEndOf="@+id/iv_creator_profile" | ||||
|                     android:layout_toEndOf="@+id/rl_creator_profile" | ||||
|                     android:orientation="vertical"> | ||||
|  | ||||
|                     <LinearLayout | ||||
| @@ -163,11 +240,11 @@ | ||||
|                             android:layout_height="wrap_content" | ||||
|                             android:layout_marginEnd="5.3dp" | ||||
|                             android:background="@drawable/bg_round_corner_2_6_601d14" | ||||
|                             android:paddingHorizontal="5.3dp" | ||||
|                             android:paddingVertical="3.3dp" | ||||
|                             android:padding="3.3dp" | ||||
|                             android:text="19" | ||||
|                             android:textColor="@color/color_e33621" | ||||
|                             android:textSize="12sp" /> | ||||
|                             android:textSize="10.7sp" | ||||
|                             tools:ignore="SmallSp" /> | ||||
|  | ||||
|                         <TextView | ||||
|                             android:id="@+id/tv_title" | ||||
| @@ -233,8 +310,7 @@ | ||||
|                 android:paddingVertical="5.3dp" | ||||
|                 android:text="공지" | ||||
|                 android:textColor="@color/color_3bb9f1" | ||||
|                 android:textSize="10.7sp" | ||||
|                 app:drawableStartCompat="@drawable/ic_notice" | ||||
|                 android:textSize="12sp" | ||||
|                 tools:ignore="SmallSp" /> | ||||
|  | ||||
|             <LinearLayout | ||||
| @@ -268,7 +344,7 @@ | ||||
|                         android:fontFamily="@font/gmarket_sans_medium" | ||||
|                         android:gravity="center_vertical" | ||||
|                         android:textColor="@color/color_bbbbbb" | ||||
|                         android:textSize="10.7sp" | ||||
|                         android:textSize="12sp" | ||||
|                         tools:ignore="SmallSp" | ||||
|                         tools:text="999,999,999,999" /> | ||||
|                 </LinearLayout> | ||||
| @@ -290,7 +366,7 @@ | ||||
|                         android:fontFamily="@font/gmarket_sans_medium" | ||||
|                         android:text="참여자" | ||||
|                         android:textColor="@color/color_bbbbbb" | ||||
|                         android:textSize="10.7sp" | ||||
|                         android:textSize="12sp" | ||||
|                         tools:ignore="SmallSp" /> | ||||
|  | ||||
|                     <TextView | ||||
| @@ -300,50 +376,12 @@ | ||||
|                         android:layout_marginStart="6.7dp" | ||||
|                         android:fontFamily="@font/gmarket_sans_bold" | ||||
|                         android:textColor="@color/color_bbbbbb" | ||||
|                         android:textSize="10.7sp" | ||||
|                         android:textSize="12sp" | ||||
|                         tools:ignore="RelativeOverlap,SmallSp" | ||||
|                         tools:text="18" /> | ||||
|                 </LinearLayout> | ||||
|             </LinearLayout> | ||||
|         </RelativeLayout> | ||||
|  | ||||
|         <ScrollView | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginTop="10dp" | ||||
|             android:scrollbars="none"> | ||||
|  | ||||
|             <RelativeLayout | ||||
|                 android:id="@+id/rl_notice" | ||||
|                 android:layout_width="match_parent" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:background="@color/color_3d2a6c" | ||||
|                 android:paddingHorizontal="26.7dp" | ||||
|                 android:paddingVertical="13.3dp"> | ||||
|  | ||||
|                 <TextView | ||||
|                     android:id="@+id/tv_notice_big" | ||||
|                     android:layout_width="wrap_content" | ||||
|                     android:layout_height="wrap_content" | ||||
|                     android:fontFamily="@font/gmarket_sans_bold" | ||||
|                     android:text="[공지] " | ||||
|                     android:textColor="@color/white" | ||||
|                     android:textSize="11.3sp" /> | ||||
|  | ||||
|                 <TextView | ||||
|                     android:id="@+id/tv_notice" | ||||
|                     android:layout_width="wrap_content" | ||||
|                     android:layout_height="wrap_content" | ||||
|                     android:layout_toEndOf="@+id/tv_notice_big" | ||||
|                     android:ellipsize="end" | ||||
|                     android:fontFamily="@font/gmarket_sans_light" | ||||
|                     android:lineSpacingExtra="4dp" | ||||
|                     android:maxLines="1" | ||||
|                     android:textColor="@color/white" | ||||
|                     android:textSize="11.3sp" | ||||
|                     tools:text="jkljkljkljkljkljkljkl" /> | ||||
|             </RelativeLayout> | ||||
|         </ScrollView> | ||||
|     </LinearLayout> | ||||
|  | ||||
|     <ImageView | ||||
| @@ -374,7 +412,7 @@ | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginBottom="13.3dp" | ||||
|             android:background="@drawable/bg_round_corner_10_99525252" | ||||
|             android:padding="10dp" | ||||
|             android:padding="8dp" | ||||
|             android:visibility="gone"> | ||||
|  | ||||
|             <ImageView | ||||
| @@ -391,7 +429,7 @@ | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginBottom="13.3dp" | ||||
|             android:background="@drawable/bg_round_corner_10_99525252" | ||||
|             android:padding="10dp" | ||||
|             android:padding="8dp" | ||||
|             android:visibility="gone"> | ||||
|  | ||||
|             <ImageView | ||||
| @@ -408,7 +446,7 @@ | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginBottom="13.3dp" | ||||
|             android:background="@drawable/bg_round_corner_10_99525252" | ||||
|             android:padding="10dp" | ||||
|             android:padding="8dp" | ||||
|             android:visibility="gone"> | ||||
|  | ||||
|             <ImageView | ||||
| @@ -426,7 +464,7 @@ | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginBottom="13.3dp" | ||||
|             android:background="@drawable/bg_round_corner_10_99525252" | ||||
|             android:padding="10dp"> | ||||
|             android:padding="8dp"> | ||||
|  | ||||
|             <ImageView | ||||
|                 android:id="@+id/iv_speaker_mute" | ||||
| @@ -443,7 +481,7 @@ | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginBottom="13.3dp" | ||||
|             android:background="@drawable/bg_round_corner_10_99525252" | ||||
|             android:padding="10dp"> | ||||
|             android:padding="8dp"> | ||||
|  | ||||
|             <ImageView | ||||
|                 android:layout_width="24dp" | ||||
| @@ -459,7 +497,7 @@ | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginBottom="13.3dp" | ||||
|             android:background="@drawable/bg_round_corner_10_99525252" | ||||
|             android:padding="10dp" | ||||
|             android:padding="8dp" | ||||
|             android:visibility="gone"> | ||||
|  | ||||
|             <ImageView | ||||
|   | ||||
		Reference in New Issue
	
	Block a user