Skip to content

Commit

Permalink
fix: centerCrop 설정을 BindingAdapter 에 위임
Browse files Browse the repository at this point in the history
- xml 속성으로 centerCrop을 주게 되면 Round Corner가 제대로 적용되지 않는 현상 발생
- Glide의 api로 제공되는 centerCrop() 메서드를 활용
  • Loading branch information
Junyoung-WON committed Jul 24, 2024
1 parent 933a6aa commit 780c1f8
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ fun ImageView.loadImageWithGlide(
Glide.with(context)
.load(url)
.placeholder(placeHolder)
.centerCrop()
.error(placeHolder)
.into(this)
}
Expand Down Expand Up @@ -91,6 +92,7 @@ fun ImageView.setRoundedCornerImageWithGlide(
Glide.with(context)
.load(url)
.placeholder(placeHolder)
.centerCrop()
.apply(RequestOptions.bitmapTransform(RoundedCorners(roundingRadius)))
.error(placeHolder)
.into(this)
Expand Down

0 comments on commit 780c1f8

Please sign in to comment.