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