fix(donation): 후원 내역 고액 header 색상을 보정한다
This commit is contained in:
@@ -37,7 +37,7 @@ private fun CreatorChannelDonationResponse.toDonationUiModel(
|
||||
|
||||
@ColorRes
|
||||
internal fun calculateDonationHeaderColorRes(can: Int): Int = when {
|
||||
can >= 500 -> R.color.red_400
|
||||
can >= 501 -> R.color.red_400
|
||||
can >= 101 -> R.color.creator_channel_donation_cyan
|
||||
can >= 51 -> R.color.green_400
|
||||
else -> R.color.gray_200
|
||||
|
||||
@@ -133,6 +133,13 @@ class CreatorChannelDonationAdapter(
|
||||
item.can.moneyFormat()
|
||||
)
|
||||
tvCreatorChannelDonationMessage.text = item.message
|
||||
if (item.headerColorResId == R.color.red_400) {
|
||||
tvCreatorChannelDonationNickname.setTextColor(root.context.getColor(R.color.white))
|
||||
tvCreatorChannelDonationCreatedAt.setTextColor(root.context.getColor(R.color.gray_100))
|
||||
} else {
|
||||
tvCreatorChannelDonationNickname.setTextColor(root.context.getColor(R.color.black))
|
||||
tvCreatorChannelDonationCreatedAt.setTextColor(root.context.getColor(R.color.gray_700))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,6 +140,9 @@ class CreatorChannelDonationFragmentLayoutTest {
|
||||
fun `후원 item layout은 profile nickname createdAt can badge message를 제공한다`() {
|
||||
val item = inflateView(R.layout.item_creator_channel_donation)
|
||||
val layout = projectFile("app/src/main/res/layout/item_creator_channel_donation.xml").readText()
|
||||
val adapter = projectFile(
|
||||
"app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/ui/CreatorChannelDonationAdapter.kt"
|
||||
).readText()
|
||||
|
||||
assertNotNull(item.findViewById<View>(R.id.layout_creator_channel_donation_header))
|
||||
assertNotNull(item.findViewById<ImageView>(R.id.iv_creator_channel_donation_profile))
|
||||
@@ -150,6 +153,11 @@ class CreatorChannelDonationFragmentLayoutTest {
|
||||
assertNotNull(item.findViewById<TextView>(R.id.tv_creator_channel_donation_message))
|
||||
assertTrue(layout.contains("android:src=\"@drawable/ic_bar_cash\""))
|
||||
assertTrue(layout.contains("android:background=\"@drawable/bg_creator_channel_donation_card\""))
|
||||
assertTrue(adapter.contains("if (item.headerColorResId == R.color.red_400)"))
|
||||
assertTrue(adapter.contains("tvCreatorChannelDonationNickname.setTextColor(root.context.getColor(R.color.white))"))
|
||||
assertTrue(adapter.contains("tvCreatorChannelDonationCreatedAt.setTextColor(root.context.getColor(R.color.gray_100))"))
|
||||
assertTrue(adapter.contains("tvCreatorChannelDonationNickname.setTextColor(root.context.getColor(R.color.black))"))
|
||||
assertTrue(adapter.contains("tvCreatorChannelDonationCreatedAt.setTextColor(root.context.getColor(R.color.gray_700))"))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user