fix(gift): 선물 화면의 기본 이미지를 제거한다

This commit is contained in:
2026-10-28 17:07:42 +09:00
parent b56c15d518
commit d4b5e44d1f
6 changed files with 19 additions and 18 deletions
@@ -68,8 +68,6 @@ class GiftSendRequestActivity : BaseActivity<ActivityGiftSendRequestBinding>(Act
?.let { profileImageUrl -> ?.let { profileImageUrl ->
binding.ivCreatorProfile.loadUrl(profileImageUrl) { binding.ivCreatorProfile.loadUrl(profileImageUrl) {
transformations(CircleCropTransformation()) transformations(CircleCropTransformation())
placeholder(R.drawable.bg_placeholder)
error(R.drawable.bg_placeholder)
} }
} }
binding.btnBack.setOnClickListener { finish() } binding.btnBack.setOnClickListener { finish() }
@@ -8,6 +8,7 @@ import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.viewbinding.ViewBinding import androidx.viewbinding.ViewBinding
import coil.load import coil.load
import coil.dispose
import kr.co.vividnext.sodalive.R import kr.co.vividnext.sodalive.R
import kr.co.vividnext.sodalive.databinding.ItemGiftInboxAddressBannerBinding import kr.co.vividnext.sodalive.databinding.ItemGiftInboxAddressBannerBinding
import kr.co.vividnext.sodalive.databinding.ItemGiftInboxEmptyReceivedBinding import kr.co.vividnext.sodalive.databinding.ItemGiftInboxEmptyReceivedBinding
@@ -69,10 +70,11 @@ class GiftInboxAdapter(
is ItemGiftInboxSentBinding -> { is ItemGiftInboxSentBinding -> {
val card = (row as GiftInboxRow.Card).card val card = (row as GiftInboxRow.Card).card
binding.counterpartNickname.text = card.counterpartNickname binding.counterpartNickname.text = card.counterpartNickname
binding.counterpartProfileImage.load(card.counterpartProfileImageUrl ?: R.drawable.ic_placeholder_profile) { if (card.counterpartProfileImageUrl.isNullOrBlank()) {
placeholder(R.drawable.ic_placeholder_profile) binding.counterpartProfileImage.dispose()
fallback(R.drawable.ic_placeholder_profile) binding.counterpartProfileImage.setImageDrawable(null)
error(R.drawable.ic_placeholder_profile) } else {
binding.counterpartProfileImage.load(card.counterpartProfileImageUrl)
} }
binding.status.text = card.status.resId?.let(context::getString) ?: card.status.message binding.status.text = card.status.resId?.let(context::getString) ?: card.status.message
binding.date.isVisible = card.createdDate.isNotEmpty() binding.date.isVisible = card.createdDate.isNotEmpty()
@@ -83,10 +85,11 @@ class GiftInboxAdapter(
is ItemGiftInboxReceivedBinding -> { is ItemGiftInboxReceivedBinding -> {
val card = (row as GiftInboxRow.Card).card val card = (row as GiftInboxRow.Card).card
binding.counterpartNickname.text = card.counterpartNickname binding.counterpartNickname.text = card.counterpartNickname
binding.counterpartProfileImage.load(card.counterpartProfileImageUrl ?: R.drawable.ic_placeholder_profile) { if (card.counterpartProfileImageUrl.isNullOrBlank()) {
placeholder(R.drawable.ic_placeholder_profile) binding.counterpartProfileImage.dispose()
fallback(R.drawable.ic_placeholder_profile) binding.counterpartProfileImage.setImageDrawable(null)
error(R.drawable.ic_placeholder_profile) } else {
binding.counterpartProfileImage.load(card.counterpartProfileImageUrl)
} }
binding.status.text = card.status.resId?.let(context::getString) ?: card.status.message binding.status.text = card.status.resId?.let(context::getString) ?: card.status.message
binding.date.isVisible = card.createdDate.isNotEmpty() binding.date.isVisible = card.createdDate.isNotEmpty()
@@ -99,8 +99,7 @@
android:id="@+id/iv_creator_profile" android:id="@+id/iv_creator_profile"
android:layout_width="42dp" android:layout_width="42dp"
android:layout_height="42dp" android:layout_height="42dp"
android:contentDescription="@string/a11y_feed_profile_image" android:contentDescription="@string/a11y_feed_profile_image" />
android:src="@drawable/bg_placeholder" />
<TextView <TextView
android:id="@+id/tv_creator_nickname" android:id="@+id/tv_creator_nickname"
@@ -18,8 +18,7 @@
android:id="@+id/counterpart_profile_image" android:id="@+id/counterpart_profile_image"
android:layout_width="@dimen/spacing_20" android:layout_width="@dimen/spacing_20"
android:layout_height="@dimen/spacing_20" android:layout_height="@dimen/spacing_20"
android:contentDescription="@null" android:contentDescription="@null" />
android:src="@drawable/ic_placeholder_profile" />
<TextView <TextView
android:id="@+id/counterpart_nickname" android:id="@+id/counterpart_nickname"
style="@style/Typography.Caption3" style="@style/Typography.Caption3"
@@ -39,8 +39,7 @@
android:id="@+id/counterpart_profile_image" android:id="@+id/counterpart_profile_image"
android:layout_width="@dimen/gift_inbox_avatar_size" android:layout_width="@dimen/gift_inbox_avatar_size"
android:layout_height="@dimen/gift_inbox_avatar_size" android:layout_height="@dimen/gift_inbox_avatar_size"
android:contentDescription="@null" android:contentDescription="@null" />
android:src="@drawable/ic_placeholder_profile" />
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -1194,7 +1194,7 @@ class GiftNavigationTest {
@Test @Test
@Config(qualifiers = "ko") @Config(qualifiers = "ko")
@GraphicsMode(GraphicsMode.Mode.NATIVE) @GraphicsMode(GraphicsMode.Mode.NATIVE)
fun `선물 신청 화면은 프로필 ImageView를 바인딩하고 URL이 없으면 placeholder를 유지한다`() { fun `선물 신청 화면은 실제 프로필만 요청하고 URL이 없으면 빈 이미지로 시작한다`() {
val profileImageUrl = "https://example.com/creator-profile.jpg" val profileImageUrl = "https://example.com/creator-profile.jpg"
if (!ImageLoaderProvider.isInitialized) { if (!ImageLoaderProvider.isInitialized) {
ImageLoaderProvider.init(ApplicationProvider.getApplicationContext()) ImageLoaderProvider.init(ApplicationProvider.getApplicationContext())
@@ -1238,7 +1238,10 @@ class GiftNavigationTest {
assertEquals(listOf(profileImageUrl), requests.map { it.data }) assertEquals(listOf(profileImageUrl), requests.map { it.data })
assertEquals(listOf(CircleCropTransformation()), requests.single().transformations) assertEquals(listOf(CircleCropTransformation()), requests.single().transformations)
assertNotNull(withoutProfileImage.drawable) assertNull(requests.single().placeholder)
assertNull(requests.single().error)
assertNull(requests.single().fallback)
assertNull(withoutProfileImage.drawable)
withProfileController.pause().stop().destroy() withProfileController.pause().stop().destroy()
withoutProfileController.pause().stop().destroy() withoutProfileController.pause().stop().destroy()