비밀 미션

- 비밀 미션 이용 최소 금액 : 10캔 으로 설정
This commit is contained in:
klaus 2024-11-21 00:26:08 +09:00
parent 71f5dc9ef1
commit b67df96c85
3 changed files with 40 additions and 12 deletions

View File

@ -516,10 +516,12 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
LayoutInflater.from(this),
isLiveDonation = true
) { can, message, isSecret ->
if (can > 0) {
donation(can, message, isSecret)
} else {
if (isSecret && can < 10) {
showToast("비밀 미션은 최소 10캔 이상부터 이용이 가능합니다.")
} else if (can < 1) {
showToast("1캔 이상 후원하실 수 있습니다.")
} else {
donation(can, message, isSecret)
}
}

View File

@ -53,15 +53,36 @@ class LiveRoomDonationDialog(
val can = dialogView.etDonationCan.text.toString().toInt()
val message = dialogView.etDonationMessage.text.toString().prefix(200)
if (can > 0) {
bottomSheetDialog.dismiss()
onClickDonation(can, message, dialogView.tvSecret.isSelected)
if (isLiveDonation) {
val isSecret = dialogView.tvSecret.isSelected
if (isSecret && can < 10) {
Toast.makeText(
activity,
"비밀 미션은 최소 10캔 이상부터 이용이 가능합니다.",
Toast.LENGTH_LONG
).show()
} else if (can < 1) {
Toast.makeText(
activity,
"1캔 이상 후원하실 수 있습니다.",
Toast.LENGTH_LONG
).show()
} else {
bottomSheetDialog.dismiss()
onClickDonation(can, message, isSecret)
}
} else {
Toast.makeText(
activity,
"1캔 이상 후원하실 수 있습니다.",
Toast.LENGTH_LONG
).show()
if (can > 0) {
bottomSheetDialog.dismiss()
onClickDonation(can, message, dialogView.tvSecret.isSelected)
} else {
Toast.makeText(
activity,
"1캔 이상 후원하실 수 있습니다.",
Toast.LENGTH_LONG
).show()
}
}
} catch (e: NumberFormatException) {
Toast.makeText(
@ -82,6 +103,11 @@ class LiveRoomDonationDialog(
} else {
"함께 보낼 메시지 입력(최대 200자)"
}
dialogView.etDonationCan.hint = if (!isSelected) {
"10캔 이상 입력하세요"
} else {
"1캔 이상 입력하세요"
}
}
dialogView.tvSecret.isSelected = false
} else {

View File

@ -100,7 +100,7 @@
android:layout_marginHorizontal="20dp"
android:background="@drawable/bg_round_corner_6_7_88333333"
android:fontFamily="@font/gmarket_sans_medium"
android:hint="몇 캔을 후원할까요?"
android:hint="1캔 이상 입력하세요"
android:importantForAutofill="no"
android:inputType="numberSigned"
android:padding="13.3dp"