From ecaa1f01e8516f0196dc772ec470fa51237f563a Mon Sep 17 00:00:00 2001 From: klaus Date: Mon, 22 Jun 2026 22:06:46 +0900 Subject: [PATCH] =?UTF-8?q?feat(creator):=20=ED=9B=84=EC=9B=90=20empty=20?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=EC=9D=84=20=EB=B3=B4?= =?UTF-8?q?=EC=A0=95=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._creator_channel_donation_empty_button.xml | 2 +- .../fragment_creator_channel_donation.xml | 31 +++++++++++++++++++ app/src/main/res/values/strings.xml | 2 +- ...reatorChannelDonationFragmentLayoutTest.kt | 27 ++++++++++++++++ 4 files changed, 60 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/drawable/bg_creator_channel_donation_empty_button.xml b/app/src/main/res/drawable/bg_creator_channel_donation_empty_button.xml index 319b4fb9..edc8e6b0 100644 --- a/app/src/main/res/drawable/bg_creator_channel_donation_empty_button.xml +++ b/app/src/main/res/drawable/bg_creator_channel_donation_empty_button.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/res/layout/fragment_creator_channel_donation.xml b/app/src/main/res/layout/fragment_creator_channel_donation.xml index e6371a89..0042a0b5 100644 --- a/app/src/main/res/layout/fragment_creator_channel_donation.xml +++ b/app/src/main/res/layout/fragment_creator_channel_donation.xml @@ -74,6 +74,37 @@ android:lineSpacingMultiplier="1.45" android:text="@string/creator_channel_donation_empty_title" android:textColor="@color/gray_500" /> + + + + + + + 후원하기 후원 내역을 불러오지 못했습니다. 다시 시도 - 처음으로 크리에이터를\n후원해 보세요! + 아직 후원이 없습니다.\n처음으로 크리에이터를 후원해 보세요! 후원 내역이 없습니다 %1$s캔 %1$d캔을 후원하였습니다. diff --git a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/CreatorChannelDonationFragmentLayoutTest.kt b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/CreatorChannelDonationFragmentLayoutTest.kt index 82fe0ec4..671fcfd8 100644 --- a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/CreatorChannelDonationFragmentLayoutTest.kt +++ b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/CreatorChannelDonationFragmentLayoutTest.kt @@ -4,6 +4,7 @@ import android.app.Application import android.view.LayoutInflater import android.view.View import android.widget.ImageView +import android.widget.LinearLayout import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import androidx.test.core.app.ApplicationProvider @@ -30,6 +31,7 @@ class CreatorChannelDonationFragmentLayoutTest { val donationList = requireNotNull(root.findViewById(R.id.rv_creator_channel_donation)) val emptyContainer = requireNotNull(root.findViewById(R.id.layout_creator_channel_donation_empty)) val emptyMessage = requireNotNull(root.findViewById(R.id.tv_creator_channel_donation_empty_message)) + val emptyDonationButton = requireNotNull(root.findViewById(R.id.btn_creator_channel_donation_empty_write)) val errorMessage = requireNotNull(root.findViewById(R.id.tv_creator_channel_donation_error_message)) val retryButton = requireNotNull(root.findViewById(R.id.btn_creator_channel_donation_retry)) val donationButton = requireNotNull(root.findViewById(R.id.btn_creator_channel_donation_write)) @@ -38,6 +40,7 @@ class CreatorChannelDonationFragmentLayoutTest { assertSame(root, donationList.parent) assertSame(root, emptyContainer.parent) assertSame(emptyContainer, emptyMessage.parent) + assertSame(emptyContainer, emptyDonationButton.parent) assertSame(root, errorMessage.parent) assertSame(root, retryButton.parent) assertSame(root, donationButton.parent) @@ -46,6 +49,29 @@ class CreatorChannelDonationFragmentLayoutTest { assertTrue(!layout.contains("creator_channel_donation_sort")) } + @Test + fun `후원 empty layout은 Figma 중앙 capsule 후원하기 button을 제공한다`() { + val root = inflateView(R.layout.fragment_creator_channel_donation) + val layout = projectFile("app/src/main/res/layout/fragment_creator_channel_donation.xml").readText() + + val emptyContainer = requireNotNull(root.findViewById(R.id.layout_creator_channel_donation_empty)) + val emptyDonationButton = requireNotNull(root.findViewById(R.id.btn_creator_channel_donation_empty_write)) + + assertSame(emptyContainer, emptyDonationButton.parent) + assertNotNull(emptyDonationButton.findViewById(R.id.iv_creator_channel_donation_empty_write)) + assertNotNull(emptyDonationButton.findViewById(R.id.tv_creator_channel_donation_empty_write)) + assertTrue(layout.contains("android:text=\"@string/creator_channel_donation_empty_title\"")) + assertTrue(layout.contains("android:text=\"@string/creator_channel_donation_action\"")) + assertTrue(layout.contains("android:background=\"@drawable/bg_creator_channel_donation_empty_button\"")) + assertTrue(layout.contains("android:layout_marginTop=\"@dimen/spacing_14\"")) + assertTrue(layout.contains("android:src=\"@drawable/ic_new_donation\"")) + assertTrue( + projectFile("app/src/main/res/drawable/bg_creator_channel_donation_empty_button.xml") + .readText() + .contains("") + ) + } + @Test fun `후원 count bar는 전체 label과 count만 제공하고 sort UI를 만들지 않는다`() { val root = inflateView(R.layout.fragment_creator_channel_donation) @@ -112,6 +138,7 @@ class CreatorChannelDonationFragmentLayoutTest { assertTrue(strings.contains("name=\"creator_channel_donation_error_message\"")) assertTrue(strings.contains("name=\"creator_channel_donation_retry\"")) } + assertTrue(ko.contains("name=\"creator_channel_donation_empty_title\">아직 후원이 없습니다.\\n처음으로 크리에이터를 후원해 보세요!")) } private fun inflateView(layoutResId: Int): View {