fix(live-room): 채팅 얼림 토글 UI와 안내 문구를 정렬한다
This commit is contained in:
@@ -63,8 +63,8 @@ android {
|
||||
applicationId "kr.co.vividnext.sodalive"
|
||||
minSdk 23
|
||||
targetSdk 35
|
||||
versionCode 227
|
||||
versionName "1.52.1"
|
||||
versionCode 229
|
||||
versionName "1.53.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
||||
@@ -275,27 +275,13 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
}
|
||||
|
||||
private fun updateChatFreezeToggleUi() {
|
||||
if (isChatFrozen) {
|
||||
binding.tvChatFreezeSwitch.text = getString(R.string.screen_live_room_chat_freeze_on_label)
|
||||
binding.tvChatFreezeSwitch.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
applicationContext,
|
||||
R.color.color_3bb9f1
|
||||
)
|
||||
)
|
||||
binding.tvChatFreezeSwitch
|
||||
.setBackgroundResource(R.drawable.bg_round_corner_5_3_transparent_3bb9f1)
|
||||
} else {
|
||||
binding.tvChatFreezeSwitch.text = getString(R.string.screen_live_room_chat_freeze_off_label)
|
||||
binding.tvChatFreezeSwitch.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
applicationContext,
|
||||
R.color.color_eeeeee
|
||||
)
|
||||
)
|
||||
binding.tvChatFreezeSwitch
|
||||
.setBackgroundResource(R.drawable.bg_round_corner_5_3_transparent_bbbbbb)
|
||||
}
|
||||
binding.tvChatFreezeSwitch.setBackgroundResource(
|
||||
if (isChatFrozen) {
|
||||
R.drawable.bg_round_corner_10_803bb9f1
|
||||
} else {
|
||||
R.drawable.bg_round_corner_10_99525252
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun showChatFreezeWarning() {
|
||||
@@ -306,15 +292,16 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
).show()
|
||||
}
|
||||
|
||||
private fun buildChatFreezeStatusMessage(isFrozen: Boolean, actorNickname: String): String {
|
||||
return getString(
|
||||
if (isFrozen) {
|
||||
R.string.screen_live_room_chat_freeze_started
|
||||
private fun buildChatFreezeStatusMessage(isFrozen: Boolean, isForHost: Boolean): String {
|
||||
return if (isFrozen) {
|
||||
if (isForHost) {
|
||||
"“🧊 모두들 얼음!” 채팅창을 얼렸습니다."
|
||||
} else {
|
||||
R.string.screen_live_room_chat_freeze_ended
|
||||
},
|
||||
actorNickname
|
||||
)
|
||||
"“🧊 모두들 얼음!” 채팅창이 얼었습니다."
|
||||
}
|
||||
} else {
|
||||
"“💧땡! “ 채팅창 얼리기가 해제되었습니다."
|
||||
}
|
||||
}
|
||||
|
||||
private fun addChatFreezeStatusMessage(message: String) {
|
||||
@@ -338,7 +325,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
|
||||
val noticeMessage = buildChatFreezeStatusMessage(
|
||||
isFrozen = nextChatFrozen,
|
||||
actorNickname = SharedPreferenceManager.nickname
|
||||
isForHost = true
|
||||
)
|
||||
|
||||
addChatFreezeStatusMessage(noticeMessage)
|
||||
@@ -347,7 +334,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
rawMessage = Gson().toJson(
|
||||
LiveRoomChatRawMessage(
|
||||
type = LiveRoomChatRawMessageType.TOGGLE_CHAT_FREEZE,
|
||||
message = noticeMessage,
|
||||
message = "",
|
||||
can = 0,
|
||||
donationMessage = "",
|
||||
isChatFrozen = nextChatFrozen
|
||||
@@ -1245,7 +1232,10 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
|
||||
if (!isHost && response.isChatFrozen && !hasShownInitialChatFreezeNotice) {
|
||||
addChatFreezeStatusMessage(
|
||||
getString(R.string.screen_live_room_chat_freeze_started)
|
||||
buildChatFreezeStatusMessage(
|
||||
isFrozen = true,
|
||||
isForHost = false
|
||||
)
|
||||
)
|
||||
hasShownInitialChatFreezeNotice = true
|
||||
}
|
||||
@@ -2342,16 +2332,10 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
val frozen = message.isChatFrozen ?: false
|
||||
setChatFrozenState(frozen)
|
||||
|
||||
val statusMessage = if (message.message.isNotBlank()) {
|
||||
message.message
|
||||
} else {
|
||||
buildChatFreezeStatusMessage(
|
||||
isFrozen = frozen,
|
||||
actorNickname = nickname.ifBlank {
|
||||
viewModel.getManagerNickname()
|
||||
}
|
||||
)
|
||||
}
|
||||
val statusMessage = buildChatFreezeStatusMessage(
|
||||
isFrozen = frozen,
|
||||
isForHost = false
|
||||
)
|
||||
|
||||
addChatFreezeStatusMessage(statusMessage)
|
||||
}
|
||||
|
||||
BIN
app/src/main/res/drawable-xxxhdpi/ic_ice.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/ic_ice.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#803BB9F1" />
|
||||
<corners android:radius="10dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#803BB9F1" />
|
||||
</shape>
|
||||
@@ -268,22 +268,6 @@
|
||||
android:visibility="gone"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_chat_freeze_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_round_corner_5_3_transparent_bbbbbb"
|
||||
android:fontFamily="@font/medium"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="4.7dp"
|
||||
android:text="@string/screen_live_room_chat_freeze_off_label"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_signature_switch"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -632,6 +616,24 @@
|
||||
app:layout_constraintBottom_toTopOf="@+id/rl_input_chat"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/tv_chat_freeze_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="13.3dp"
|
||||
android:background="@drawable/bg_round_corner_10_99525252"
|
||||
android:padding="10dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_chat_freeze"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_ice" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speaker_mute"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user