try catching an exception at an editor filter applying
This commit is contained in:
parent
f066f4b84a
commit
4958402919
1 changed files with 18 additions and 11 deletions
|
@ -583,18 +583,25 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||||
if (currPrimaryAction == PRIMARY_ACTION_FILTER && bottom_actions_filter_list.adapter == null) {
|
if (currPrimaryAction == PRIMARY_ACTION_FILTER && bottom_actions_filter_list.adapter == null) {
|
||||||
Thread {
|
Thread {
|
||||||
val thumbnailSize = resources.getDimension(R.dimen.bottom_filters_thumbnail_size).toInt()
|
val thumbnailSize = resources.getDimension(R.dimen.bottom_filters_thumbnail_size).toInt()
|
||||||
val bitmap = Glide.with(this)
|
|
||||||
.asBitmap()
|
|
||||||
.load(uri).listener(object : RequestListener<Bitmap> {
|
|
||||||
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean {
|
|
||||||
showErrorToast(e.toString())
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onResourceReady(resource: Bitmap?, model: Any?, target: Target<Bitmap>?, dataSource: DataSource?, isFirstResource: Boolean) = false
|
val bitmap = try {
|
||||||
})
|
Glide.with(this)
|
||||||
.submit(thumbnailSize, thumbnailSize)
|
.asBitmap()
|
||||||
.get()
|
.load(uri).listener(object : RequestListener<Bitmap> {
|
||||||
|
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean {
|
||||||
|
showErrorToast(e.toString())
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResourceReady(resource: Bitmap?, model: Any?, target: Target<Bitmap>?, dataSource: DataSource?, isFirstResource: Boolean) = false
|
||||||
|
})
|
||||||
|
.submit(thumbnailSize, thumbnailSize)
|
||||||
|
.get()
|
||||||
|
} catch (e: GlideException) {
|
||||||
|
showErrorToast(e)
|
||||||
|
finish()
|
||||||
|
return@Thread
|
||||||
|
}
|
||||||
|
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
val filterThumbnailsManager = FilterThumbnailsManager()
|
val filterThumbnailsManager = FilterThumbnailsManager()
|
||||||
|
|
Loading…
Reference in a new issue