diff --git a/app/src/main/java/org/p2p/wallet/history/ui/detailsbottomsheet/HistoryTransactionDetailsPresenter.kt b/app/src/main/java/org/p2p/wallet/history/ui/detailsbottomsheet/HistoryTransactionDetailsPresenter.kt index 2d24cac498..80493583b8 100644 --- a/app/src/main/java/org/p2p/wallet/history/ui/detailsbottomsheet/HistoryTransactionDetailsPresenter.kt +++ b/app/src/main/java/org/p2p/wallet/history/ui/detailsbottomsheet/HistoryTransactionDetailsPresenter.kt @@ -218,7 +218,7 @@ class HistoryTransactionDetailsPresenter( if (!transaction.status.isPending()) { showFee(transaction.fees) } - showTransferView(transaction.token.logoUrl, R.drawable.ic_placeholder_image) + showTransferView(transaction.token.logoUrl, R.drawable.ic_placeholder_v2) showStateTitleValue( resources.getString( if (transaction.isBurn) R.string.transaction_details_burn @@ -235,7 +235,7 @@ class HistoryTransactionDetailsPresenter( view?.showSubtitle(resources.getString(R.string.details_pending)) showProgressTransactionInProgress() } - showTransferView(transaction.token.logoUrl, R.drawable.ic_placeholder_image) + showTransferView(transaction.token.logoUrl, R.drawable.ic_placeholder_v2) if (transaction.fees != null && !transaction.status.isPending()) { showFee(transaction.fees) } @@ -259,7 +259,7 @@ class HistoryTransactionDetailsPresenter( view?.showSubtitle(resources.getString(R.string.details_pending)) showProgressTransactionInProgress() } - showTransferView(transaction.token.logoUrl, R.drawable.ic_placeholder_image) + showTransferView(transaction.token.logoUrl, R.drawable.ic_placeholder_v2) if (transaction.fees != null && !transaction.status.isPending()) { showFee(transaction.fees) } diff --git a/app/src/main/java/org/p2p/wallet/history/ui/sendvialink/HistorySendLinkDetailsBottomSheet.kt b/app/src/main/java/org/p2p/wallet/history/ui/sendvialink/HistorySendLinkDetailsBottomSheet.kt index a83750d876..100fa9a883 100644 --- a/app/src/main/java/org/p2p/wallet/history/ui/sendvialink/HistorySendLinkDetailsBottomSheet.kt +++ b/app/src/main/java/org/p2p/wallet/history/ui/sendvialink/HistorySendLinkDetailsBottomSheet.kt @@ -108,7 +108,7 @@ class HistorySendLinkDetailsBottomSheet : private fun renderContent(state: ViewState.Content) = with(binding) { val tokenIconContainer = state.iconUrl?.let(DrawableContainer::invoke) - ?: DrawableContainer.invoke(R.drawable.ic_placeholder_image) + ?: DrawableContainer.invoke(R.drawable.ic_placeholder_v2) imageViewSecondIcon.bind(ImageViewCellModel(icon = tokenIconContainer, clippingShape = shapeCircle())) textViewSubtitle.bind(TextViewCellModel.Raw(TextContainer(state.formattedDate))) diff --git a/app/src/main/java/org/p2p/wallet/home/ui/main/delegates/token/TokenDelegate.kt b/app/src/main/java/org/p2p/wallet/home/ui/main/delegates/token/TokenDelegate.kt index 92bfbc0dca..30e1291c2f 100644 --- a/app/src/main/java/org/p2p/wallet/home/ui/main/delegates/token/TokenDelegate.kt +++ b/app/src/main/java/org/p2p/wallet/home/ui/main/delegates/token/TokenDelegate.kt @@ -54,13 +54,11 @@ private fun AdapterDelegateViewBindingViewHolder with(transaction) { tokenIconUrl = token.logoUrl - iconRes = R.drawable.ic_placeholder_image + iconRes = R.drawable.ic_placeholder_v2 startTitle = resources.getString(getTitle()) startSubtitle = resources.getString( diff --git a/app/src/main/java/org/p2p/wallet/send/ui/search/adapter/SearchErrorViewHolder.kt b/app/src/main/java/org/p2p/wallet/send/ui/search/adapter/SearchErrorViewHolder.kt index de9a42b519..ebef9f2d1a 100644 --- a/app/src/main/java/org/p2p/wallet/send/ui/search/adapter/SearchErrorViewHolder.kt +++ b/app/src/main/java/org/p2p/wallet/send/ui/search/adapter/SearchErrorViewHolder.kt @@ -1,8 +1,9 @@ package org.p2p.wallet.send.ui.search.adapter -import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView +import android.view.ViewGroup import com.bumptech.glide.Glide +import timber.log.Timber import org.p2p.wallet.R import org.p2p.wallet.databinding.ItemSearchInvalidResultBinding import org.p2p.wallet.send.model.SearchResult @@ -12,7 +13,6 @@ import org.p2p.wallet.utils.toPx import org.p2p.wallet.utils.viewbinding.getString import org.p2p.wallet.utils.viewbinding.inflateViewBinding import org.p2p.wallet.utils.withTextOrGone -import timber.log.Timber class SearchErrorViewHolder( parent: ViewGroup, @@ -70,8 +70,8 @@ class SearchErrorViewHolder( Glide.with(this) .load(iconUrl) .circleCrop() - .error(R.drawable.ic_placeholder_image) - .placeholder(R.drawable.ic_placeholder_image) + .error(R.drawable.ic_placeholder_v2) + .placeholder(R.drawable.ic_placeholder_v2) .into(this) } } diff --git a/app/src/main/java/org/p2p/wallet/send/ui/search/adapter/SearchViewHolder.kt b/app/src/main/java/org/p2p/wallet/send/ui/search/adapter/SearchViewHolder.kt index f9a2a7cde4..07c886b769 100644 --- a/app/src/main/java/org/p2p/wallet/send/ui/search/adapter/SearchViewHolder.kt +++ b/app/src/main/java/org/p2p/wallet/send/ui/search/adapter/SearchViewHolder.kt @@ -87,8 +87,8 @@ class SearchViewHolder( Glide.with(root) .load(imageObject) .circleCrop() - .error(R.drawable.ic_placeholder_image) - .placeholder(R.drawable.ic_placeholder_image) + .error(R.drawable.ic_placeholder_v2) + .placeholder(R.drawable.ic_placeholder_v2) .into(walletImageView) } } diff --git a/core/src/main/java/org/p2p/core/common/DrawableContainer.kt b/core/src/main/java/org/p2p/core/common/DrawableContainer.kt index 1d1612ab76..c397183f0d 100644 --- a/core/src/main/java/org/p2p/core/common/DrawableContainer.kt +++ b/core/src/main/java/org/p2p/core/common/DrawableContainer.kt @@ -39,7 +39,7 @@ sealed class DrawableContainer : Parcelable { val requestBuilder: RequestBuilder = Glide.with(imageView.context) .`as`(PictureDrawable::class.java) .listener(SvgSoftwareLayerSetter()) - val placeholder: Int = R.drawable.ic_placeholder_image + val placeholder: Int = R.drawable.ic_placeholder_v2 if (iconUrl.contains(".svg")) { requestBuilder diff --git a/core/src/main/java/org/p2p/core/glide/GlideManager.kt b/core/src/main/java/org/p2p/core/glide/GlideManager.kt index 427bb85f8a..d92599f24c 100644 --- a/core/src/main/java/org/p2p/core/glide/GlideManager.kt +++ b/core/src/main/java/org/p2p/core/glide/GlideManager.kt @@ -27,13 +27,15 @@ class GlideManager(context: Context) { url: String?, size: Int = DEFAULT_IMAGE_SIZE, circleCrop: Boolean = false, - placeholder: Int = R.drawable.ic_placeholder_image + placeholder: Int = R.drawable.ic_placeholder_v2 ) { if (url?.contains(".svg") == true) { requestBuilder .load(Uri.parse(url)) .apply(RequestOptions().override(size, size)) .scaleCrop(url, circleCrop) + .placeholder(placeholder) + .error(placeholder) .into(imageView) } else { Glide diff --git a/core/src/main/res/drawable/ic_placeholder_v2.xml b/core/src/main/res/drawable/ic_placeholder_v2.xml new file mode 100644 index 0000000000..d67fabde43 --- /dev/null +++ b/core/src/main/res/drawable/ic_placeholder_v2.xml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/ui-kit/src/main/kotlin/org/p2p/uikit/atoms/UiKitTransactionImageView.kt b/ui-kit/src/main/kotlin/org/p2p/uikit/atoms/UiKitTransactionImageView.kt index d8e19c6851..39021f99d8 100644 --- a/ui-kit/src/main/kotlin/org/p2p/uikit/atoms/UiKitTransactionImageView.kt +++ b/ui-kit/src/main/kotlin/org/p2p/uikit/atoms/UiKitTransactionImageView.kt @@ -49,7 +49,7 @@ class UiKitTransactionImageView @JvmOverloads constructor( tokenIconUrl: String ) = with(binding) { imageViewToken.scaleType = ImageView.ScaleType.FIT_CENTER - glideManager.load(imageViewToken, tokenIconUrl, IMAGE_SIZE, circleCrop = true) + glideManager.load(imageView = imageViewToken, url = tokenIconUrl, size = IMAGE_SIZE, circleCrop = true) } fun setStatusIcon(@DrawableRes statusIcon: Int?) { diff --git a/ui-kit/src/main/kotlin/org/p2p/uikit/utils/ImageViewExtensions.kt b/ui-kit/src/main/kotlin/org/p2p/uikit/utils/ImageViewExtensions.kt index 30c46e7dd3..77a1b2db1b 100644 --- a/ui-kit/src/main/kotlin/org/p2p/uikit/utils/ImageViewExtensions.kt +++ b/ui-kit/src/main/kotlin/org/p2p/uikit/utils/ImageViewExtensions.kt @@ -21,7 +21,7 @@ fun ImageView.loadUrl( url: String?, size: Int = DEFAULT_IMAGE_SIZE, circleCrop: Boolean = false, - placeholder: Int = R.drawable.ic_placeholder_image + placeholder: Int = R.drawable.ic_placeholder_v2 ) { glide.load( imageView = this,