feat(creator): 후원 랭킹 레이아웃을 보정한다

This commit is contained in:
2026-06-22 23:22:34 +09:00
parent 9b19be7775
commit 0122c8c5ed
3 changed files with 95 additions and 19 deletions

View File

@@ -34,7 +34,6 @@ class CreatorChannelDonationFragmentLayoutTest {
val emptyDonationButton = requireNotNull(root.findViewById<LinearLayout>(R.id.btn_creator_channel_donation_empty_write))
val errorMessage = requireNotNull(root.findViewById<TextView>(R.id.tv_creator_channel_donation_error_message))
val retryButton = requireNotNull(root.findViewById<TextView>(R.id.btn_creator_channel_donation_retry))
val donationButton = requireNotNull(root.findViewById<ImageView>(R.id.btn_creator_channel_donation_write))
assertSame(root, countBar.parent)
assertSame(root, donationList.parent)
@@ -43,9 +42,9 @@ class CreatorChannelDonationFragmentLayoutTest {
assertSame(emptyContainer, emptyDonationButton.parent)
assertSame(root, errorMessage.parent)
assertSame(root, retryButton.parent)
assertSame(root, donationButton.parent)
assertTrue(layout.contains("android:background=\"@color/black\""))
assertTrue(layout.contains("tools:listitem=\"@layout/item_creator_channel_donation\""))
assertTrue(!layout.contains("btn_creator_channel_donation_write"))
assertTrue(!layout.contains("creator_channel_donation_sort"))
}
@@ -89,6 +88,9 @@ class CreatorChannelDonationFragmentLayoutTest {
fun `후원 ranking item layout은 타이틀 grid 전체보기 button을 제공한다`() {
val item = inflateView(R.layout.item_creator_channel_donation_ranking)
val layout = projectFile("app/src/main/res/layout/item_creator_channel_donation_ranking.xml").readText()
val adapter = projectFile(
"app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/ui/CreatorChannelDonationAdapter.kt"
).readText()
assertNotNull(item.findViewById<TextView>(R.id.tv_creator_channel_donation_ranking_title))
assertNotNull(item.findViewById<RecyclerView>(R.id.rv_creator_channel_donation_ranking_members))
@@ -97,15 +99,40 @@ class CreatorChannelDonationFragmentLayoutTest {
assertTrue(layout.contains("android:text=\"@string/creator_channel_donation_ranking_all\""))
assertTrue(layout.contains("android:layout_marginHorizontal=\"@dimen/spacing_14\""))
assertTrue(layout.contains("android:background=\"@drawable/bg_creator_channel_donation_card\""))
assertTrue(layout.contains("android:layout_width=\"match_parent\""))
assertTrue(adapter.contains("GridLayoutManager(itemView.context, 4)"))
assertTrue(adapter.contains("CreatorChannelDonationRankingItemDecoration(itemView.context, spanCount = 4)"))
assertTrue(adapter.contains("column * spacing / spanCount"))
assertTrue(adapter.contains("spacing - (column + 1) * spacing / spanCount"))
}
@Test
fun `후원 ranking member item layout은 프로필 닉네임 rank overlay를 제공한다`() {
val item = inflateView(R.layout.item_creator_channel_donation_ranking_member)
val layout = projectFile("app/src/main/res/layout/item_creator_channel_donation_ranking_member.xml").readText()
assertNotNull(item.findViewById<ImageView>(R.id.iv_creator_channel_donation_ranking_profile))
assertNotNull(item.findViewById<TextView>(R.id.tv_creator_channel_donation_ranking_rank))
assertNotNull(item.findViewById<TextView>(R.id.tv_creator_channel_donation_ranking_nickname))
assertTrue(layout.contains("@+id/layout_creator_channel_donation_ranking_profile"))
assertTrue(layout.contains("android:clipChildren=\"false\""))
assertTrue(layout.contains("app:layout_constraintDimensionRatio=\"1:1\""))
assertTrue(layout.contains("android:layout_marginTop=\"6dp\""))
assertTrue(layout.contains("android:fontFamily=\"@font/pattaya_regular\""))
assertTrue(layout.contains("android:textSize=\"28sp\""))
assertTrue(layout.contains("app:layout_constraintGuide_percent=\"0.63\""))
assertTrue(
layout.contains(
"app:layout_constraintTop_toTopOf=\"@id/guideline_creator_channel_donation_ranking_rank_top\""
)
)
assertTrue(
!layout.contains(
"app:layout_constraintBottom_toBottomOf=\"@id/iv_creator_channel_donation_ranking_profile\""
)
)
assertTrue(!layout.contains("android:translationY=\"@dimen/spacing_8\""))
assertTrue(!layout.contains("android:paddingBottom=\"@dimen/spacing_4\""))
}
@Test