Skip to content

Commit

Permalink
[#13] 뱃지가 달린 Round Image View 추가
Browse files Browse the repository at this point in the history
- 불필요한 Annotation 제거및 URL Patterns 확인구문 제거
  • Loading branch information
DongJun-H committed Apr 14, 2022
1 parent edd6c47 commit 9705d3b
Showing 1 changed file with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,11 @@ class BadgeRoundImageView @JvmOverloads constructor(
}

@RequiresPermission(Manifest.permission.INTERNET)
@Throws(IOException::class)
fun setBigCircleImgSrc(imgUrl: String, isImageCropped: Boolean = false) {
if (Patterns.WEB_URL.matcher(imgUrl).matches()) {
if (isImageCropped) {
Glide.with(context).load(imgUrl).centerCrop().into(binding.imgBigCircle)
} else
Glide.with(context).load(imgUrl).into(binding.imgBigCircle)
}
if (isImageCropped) {
Glide.with(context).load(imgUrl).centerCrop().into(binding.imgBigCircle)
} else
Glide.with(context).load(imgUrl).into(binding.imgBigCircle)
}

fun setBigCircleImageBg(@ColorRes bgResId: Int) {
Expand All @@ -105,14 +102,11 @@ class BadgeRoundImageView @JvmOverloads constructor(
}

@RequiresPermission(Manifest.permission.INTERNET)
@Throws(IOException::class)
fun setBadgeImgSrc(imgUrl: String, isImageCropped: Boolean = false) {
if (Patterns.WEB_URL.matcher(imgUrl).matches()) {
if (isImageCropped) {
Glide.with(context).load(imgUrl).centerCrop().into(binding.imgBadgeSymbol)
} else
Glide.with(context).load(imgUrl).into(binding.imgBadgeSymbol)
}
if (isImageCropped) {
Glide.with(context).load(imgUrl).centerCrop().into(binding.imgBadgeSymbol)
} else
Glide.with(context).load(imgUrl).into(binding.imgBadgeSymbol)
}

fun setBadgeImageBg(@ColorRes bgResId: Int) {
Expand Down

0 comments on commit 9705d3b

Please sign in to comment.