Skip to content

Commit

Permalink
feat: 둥근 모서리로 이미지를 로딩하는 Coil 바인딩 어댑터 작성
Browse files Browse the repository at this point in the history
- 세 속성이 모두 필요하다.
- coilRoundedCornerImageUrl: 출력하고자 하는 이미지 url
- coilPlaceHolder: placeHolder의 url
- coilRoundingRadius: 모서리의 둥근 정도를 Float으로 설정
  • Loading branch information
Junyoung-WON committed Jul 24, 2024
1 parent 7c305dd commit 933a6aa
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ fun ImageView.setCircleImageWithCoil(
}
}

@BindingAdapter(
value = ["coilRoundedCornerImageUrl", "coilPlaceHolder", "coilRoundingRadius"],
)
fun ImageView.setRoundedCornerImageWithCoil(
url: String?,
placeHolder: Drawable? = null,
roundingRadius: Float,
) {
load(url) {
placeholder(placeHolder)
transformations(RoundedCornersTransformation(roundingRadius))
error(placeHolder)
}
}

@BindingAdapter(
value = ["glideImageUrl", "glidePlaceHolder"],
)
Expand Down

0 comments on commit 933a6aa

Please sign in to comment.