feat(creator): 후원 empty 레이아웃을 보정한다
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<solid android:color="@color/white" />
|
<solid android:color="@color/soda_400" />
|
||||||
<corners android:radius="100dp" />
|
<corners android:radius="100dp" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|||||||
@@ -74,6 +74,37 @@
|
|||||||
android:lineSpacingMultiplier="1.45"
|
android:lineSpacingMultiplier="1.45"
|
||||||
android:text="@string/creator_channel_donation_empty_title"
|
android:text="@string/creator_channel_donation_empty_title"
|
||||||
android:textColor="@color/gray_500" />
|
android:textColor="@color/gray_500" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btn_creator_channel_donation_empty_write"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="44dp"
|
||||||
|
android:layout_marginTop="@dimen/spacing_14"
|
||||||
|
android:background="@drawable/bg_creator_channel_donation_empty_button"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="@dimen/spacing_12"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_creator_channel_donation_empty_write"
|
||||||
|
android:layout_width="@dimen/spacing_20"
|
||||||
|
android:layout_height="@dimen/spacing_20"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_new_donation"
|
||||||
|
app:tint="@color/white" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_creator_channel_donation_empty_write"
|
||||||
|
style="@style/Typography.Body2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="@dimen/spacing_6"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/creator_channel_donation_action"
|
||||||
|
android:textColor="@color/white" />
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -356,7 +356,7 @@
|
|||||||
<string name="creator_channel_donation_action">후원하기</string>
|
<string name="creator_channel_donation_action">후원하기</string>
|
||||||
<string name="creator_channel_donation_error_message">후원 내역을 불러오지 못했습니다.</string>
|
<string name="creator_channel_donation_error_message">후원 내역을 불러오지 못했습니다.</string>
|
||||||
<string name="creator_channel_donation_retry">다시 시도</string>
|
<string name="creator_channel_donation_retry">다시 시도</string>
|
||||||
<string name="creator_channel_donation_empty_title">처음으로 크리에이터를\n후원해 보세요!</string>
|
<string name="creator_channel_donation_empty_title">아직 후원이 없습니다.\n처음으로 크리에이터를 후원해 보세요!</string>
|
||||||
<string name="creator_channel_donation_empty_owner_title">후원 내역이 없습니다</string>
|
<string name="creator_channel_donation_empty_owner_title">후원 내역이 없습니다</string>
|
||||||
<string name="creator_channel_donation_can_format">%1$s캔</string>
|
<string name="creator_channel_donation_can_format">%1$s캔</string>
|
||||||
<string name="creator_channel_donation_fallback_message">%1$d캔을 후원하였습니다.</string>
|
<string name="creator_channel_donation_fallback_message">%1$d캔을 후원하였습니다.</string>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.app.Application
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.test.core.app.ApplicationProvider
|
import androidx.test.core.app.ApplicationProvider
|
||||||
@@ -30,6 +31,7 @@ class CreatorChannelDonationFragmentLayoutTest {
|
|||||||
val donationList = requireNotNull(root.findViewById<RecyclerView>(R.id.rv_creator_channel_donation))
|
val donationList = requireNotNull(root.findViewById<RecyclerView>(R.id.rv_creator_channel_donation))
|
||||||
val emptyContainer = requireNotNull(root.findViewById<View>(R.id.layout_creator_channel_donation_empty))
|
val emptyContainer = requireNotNull(root.findViewById<View>(R.id.layout_creator_channel_donation_empty))
|
||||||
val emptyMessage = requireNotNull(root.findViewById<TextView>(R.id.tv_creator_channel_donation_empty_message))
|
val emptyMessage = requireNotNull(root.findViewById<TextView>(R.id.tv_creator_channel_donation_empty_message))
|
||||||
|
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 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 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))
|
val donationButton = requireNotNull(root.findViewById<ImageView>(R.id.btn_creator_channel_donation_write))
|
||||||
@@ -38,6 +40,7 @@ class CreatorChannelDonationFragmentLayoutTest {
|
|||||||
assertSame(root, donationList.parent)
|
assertSame(root, donationList.parent)
|
||||||
assertSame(root, emptyContainer.parent)
|
assertSame(root, emptyContainer.parent)
|
||||||
assertSame(emptyContainer, emptyMessage.parent)
|
assertSame(emptyContainer, emptyMessage.parent)
|
||||||
|
assertSame(emptyContainer, emptyDonationButton.parent)
|
||||||
assertSame(root, errorMessage.parent)
|
assertSame(root, errorMessage.parent)
|
||||||
assertSame(root, retryButton.parent)
|
assertSame(root, retryButton.parent)
|
||||||
assertSame(root, donationButton.parent)
|
assertSame(root, donationButton.parent)
|
||||||
@@ -46,6 +49,29 @@ class CreatorChannelDonationFragmentLayoutTest {
|
|||||||
assertTrue(!layout.contains("creator_channel_donation_sort"))
|
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<View>(R.id.layout_creator_channel_donation_empty))
|
||||||
|
val emptyDonationButton = requireNotNull(root.findViewById<LinearLayout>(R.id.btn_creator_channel_donation_empty_write))
|
||||||
|
|
||||||
|
assertSame(emptyContainer, emptyDonationButton.parent)
|
||||||
|
assertNotNull(emptyDonationButton.findViewById<ImageView>(R.id.iv_creator_channel_donation_empty_write))
|
||||||
|
assertNotNull(emptyDonationButton.findViewById<TextView>(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("<solid android:color=\"@color/soda_400\" />")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `후원 count bar는 전체 label과 count만 제공하고 sort UI를 만들지 않는다`() {
|
fun `후원 count bar는 전체 label과 count만 제공하고 sort UI를 만들지 않는다`() {
|
||||||
val root = inflateView(R.layout.fragment_creator_channel_donation)
|
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_error_message\""))
|
||||||
assertTrue(strings.contains("name=\"creator_channel_donation_retry\""))
|
assertTrue(strings.contains("name=\"creator_channel_donation_retry\""))
|
||||||
}
|
}
|
||||||
|
assertTrue(ko.contains("name=\"creator_channel_donation_empty_title\">아직 후원이 없습니다.\\n처음으로 크리에이터를 후원해 보세요!"))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun inflateView(layoutResId: Int): View {
|
private fun inflateView(layoutResId: Int): View {
|
||||||
|
|||||||
Reference in New Issue
Block a user