From 2e8e9e5b6d5a4588eb26a451705e52afda26c028 Mon Sep 17 00:00:00 2001 From: b1urrrr Date: Fri, 12 May 2023 19:32:04 +0900 Subject: [PATCH] =?UTF-8?q?[ADD/#8]=20placeholder,=20error,=20fallback=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/android/go/sopt/util/binding/BindingAdapter.kt | 5 ++++- app/src/main/res/drawable/ic_image_not_supported.xml | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/ic_image_not_supported.xml diff --git a/app/src/main/java/org/android/go/sopt/util/binding/BindingAdapter.kt b/app/src/main/java/org/android/go/sopt/util/binding/BindingAdapter.kt index 99653e6..a4096a1 100644 --- a/app/src/main/java/org/android/go/sopt/util/binding/BindingAdapter.kt +++ b/app/src/main/java/org/android/go/sopt/util/binding/BindingAdapter.kt @@ -4,13 +4,16 @@ import android.widget.ImageView import androidx.databinding.BindingAdapter import coil.load import coil.transform.RoundedCornersTransformation +import org.android.go.sopt.R object BindingAdapter { @JvmStatic @BindingAdapter("setRoundedCornersImage") fun ImageView.setRoundedCornersImage(img: String?) { load(img) { - // TODO: placeholder & load error 이미지 추가 + placeholder(R.mipmap.ic_go_sopt) + error(R.drawable.ic_image_not_supported) + fallback(R.drawable.ic_image_not_supported) transformations(RoundedCornersTransformation(50f)) } } diff --git a/app/src/main/res/drawable/ic_image_not_supported.xml b/app/src/main/res/drawable/ic_image_not_supported.xml new file mode 100644 index 0000000..d5a32e1 --- /dev/null +++ b/app/src/main/res/drawable/ic_image_not_supported.xml @@ -0,0 +1,5 @@ + + +