Skip to content

Commit

Permalink
fix glide image loader
Browse files Browse the repository at this point in the history
  • Loading branch information
MashudiSudonym committed Apr 27, 2021
1 parent 6324e9b commit d2115fe
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ class UpdateUserProfileActivity : AppCompatActivity() {
inPurgeable = true
}
BitmapFactory.decodeFile(currentPhotoPath, bmOptions)?.also { bitmap ->

Glide.with(this).load(bitmap).apply(
RequestOptions().centerCrop().placeholder(R.drawable.ic_baseline_person_pin)
.error(R.drawable.ic_broken_image)
).into(updateUserProfileBinding.imgProfile)
updateUserProfileBinding.imgProfile.setImageBitmap(bitmap)
}
} else {
layout.snackBarWarningLong(getString(R.string.data_error_null))
Expand Down Expand Up @@ -109,10 +105,7 @@ class UpdateUserProfileActivity : AppCompatActivity() {
MediaStore.Images.Media.getBitmap(this.contentResolver, photoPathURI)
}

Glide.with(this).load(bitmap).apply(
RequestOptions().centerCrop().placeholder(R.drawable.ic_baseline_person_pin)
.error(R.drawable.ic_broken_image)
).into(updateUserProfileBinding.imgProfile)
updateUserProfileBinding.imgProfile.setImageBitmap(bitmap)
}
} else {
layout.snackBarWarningLong(getString(R.string.data_error_null))
Expand Down

0 comments on commit d2115fe

Please sign in to comment.