라이브 후원
- 비밀후원을 체크하면 힌트 메시지에 '비밀' 추가 - 후원메시지 최대 길이 50 -> 200 변경
This commit is contained in:
parent
a556378ffe
commit
936074081c
|
@ -46,3 +46,11 @@ fun String.fontSpan(typeface: Typeface?, text: String): SpannableString {
|
||||||
|
|
||||||
return spannableString
|
return spannableString
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun String.prefix(length: Int): String {
|
||||||
|
return if (this.length >= length) {
|
||||||
|
this.substring(0, length)
|
||||||
|
} else {
|
||||||
|
this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import kr.co.vividnext.sodalive.common.Constants
|
||||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||||
import kr.co.vividnext.sodalive.databinding.DialogLiveRoomDonationBinding
|
import kr.co.vividnext.sodalive.databinding.DialogLiveRoomDonationBinding
|
||||||
import kr.co.vividnext.sodalive.extensions.moneyFormat
|
import kr.co.vividnext.sodalive.extensions.moneyFormat
|
||||||
|
import kr.co.vividnext.sodalive.extensions.prefix
|
||||||
import kr.co.vividnext.sodalive.mypage.can.charge.CanChargeActivity
|
import kr.co.vividnext.sodalive.mypage.can.charge.CanChargeActivity
|
||||||
|
|
||||||
class LiveRoomDonationDialog(
|
class LiveRoomDonationDialog(
|
||||||
|
@ -50,7 +51,7 @@ class LiveRoomDonationDialog(
|
||||||
dialogView.tvDonation.setOnClickListener {
|
dialogView.tvDonation.setOnClickListener {
|
||||||
try {
|
try {
|
||||||
val can = dialogView.etDonationCan.text.toString().toInt()
|
val can = dialogView.etDonationCan.text.toString().toInt()
|
||||||
val message = dialogView.etDonationMessage.text.toString()
|
val message = dialogView.etDonationMessage.text.toString().prefix(200)
|
||||||
|
|
||||||
if (can > 0) {
|
if (can > 0) {
|
||||||
bottomSheetDialog.dismiss()
|
bottomSheetDialog.dismiss()
|
||||||
|
@ -71,10 +72,17 @@ class LiveRoomDonationDialog(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogView.rlSecret.visibility = if (isLiveDonation) {
|
if (isLiveDonation) {
|
||||||
View.VISIBLE
|
dialogView.rlSecret.visibility = View.VISIBLE
|
||||||
|
dialogView.chkSecret.setOnCheckedChangeListener { _, isSecret ->
|
||||||
|
dialogView.etDonationMessage.hint = if (isSecret) {
|
||||||
|
"함께 보낼 비밀 메시지 입력(최대 200자)"
|
||||||
} else {
|
} else {
|
||||||
View.GONE
|
"함께 보낼 메시지 입력(최대 200자)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dialogView.rlSecret.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
setupView()
|
setupView()
|
||||||
|
|
|
@ -104,7 +104,7 @@
|
||||||
android:textColor="@color/color_eeeeee"
|
android:textColor="@color/color_eeeeee"
|
||||||
android:textColorHint="@color/color_777777"
|
android:textColorHint="@color/color_777777"
|
||||||
android:textCursorDrawable="@drawable/edit_text_cursor"
|
android:textCursorDrawable="@drawable/edit_text_cursor"
|
||||||
android:textSize="14.7sp"
|
android:textSize="13.3sp"
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -195,16 +195,16 @@
|
||||||
android:layout_marginStart="10.3dp"
|
android:layout_marginStart="10.3dp"
|
||||||
android:background="@drawable/bg_round_corner_6_7_88333333"
|
android:background="@drawable/bg_round_corner_6_7_88333333"
|
||||||
android:fontFamily="@font/gmarket_sans_medium"
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
android:hint="함께 보낼 메시지 입력(최대 50자)"
|
android:hint="함께 보낼 메시지 입력(최대 200자)"
|
||||||
android:importantForAutofill="no"
|
android:importantForAutofill="no"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:maxLength="50"
|
android:maxLength="200"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:padding="13.3dp"
|
android:padding="13.3dp"
|
||||||
android:textColor="@color/color_eeeeee"
|
android:textColor="@color/color_eeeeee"
|
||||||
android:textColorHint="@color/color_777777"
|
android:textColorHint="@color/color_777777"
|
||||||
android:textCursorDrawable="@drawable/edit_text_cursor"
|
android:textCursorDrawable="@drawable/edit_text_cursor"
|
||||||
android:textSize="14.7sp"
|
android:textSize="13.3sp"
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue