Skip to content

Commit

Permalink
[ADD/#8] placeholder, error, fallback 이미지 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
b1urrrr committed May 12, 2023
1 parent d3c3115 commit 2e8e9e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_image_not_supported.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#AAAAAA"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M21.9,21.9l-8.49,-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1 0.9,2 2,2h13.17l2.31,2.31L21.9,21.9zM5,18l3.5,-4.5l2.5,3.01L12.17,15l3,3H5zM21,18.17L5.83,3H19c1.1,0 2,0.9 2,2V18.17z"/>
</vector>

0 comments on commit 2e8e9e5

Please sign in to comment.