mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
catch exceptions at filling the widget
This commit is contained in:
parent
f7e126d69e
commit
81276cb878
2 changed files with 11 additions and 9 deletions
|
@ -78,7 +78,7 @@ dependencies {
|
|||
|
||||
//implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
|
||||
//implementation 'com.github.tibbi:subsampling-scale-image-view:v3.10.1-fork'
|
||||
implementation 'com.github.tibbi:subsampling-scale-image-view:4.0.0'
|
||||
implementation 'com.github.tibbi:subsampling-scale-image-view:fcb724fb0a'
|
||||
|
||||
// implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
||||
implementation 'com.github.tibbi:PhotoView:2.3.0-fork'
|
||||
|
|
|
@ -52,14 +52,16 @@ class MyWidgetProvider : AppWidgetProvider() {
|
|||
val height = appWidgetOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT)
|
||||
|
||||
val widgetSize = (Math.max(width, height) * density).toInt()
|
||||
val image = Glide.with(context)
|
||||
.asBitmap()
|
||||
.load(path)
|
||||
.apply(options)
|
||||
.submit(widgetSize, widgetSize)
|
||||
.get()
|
||||
|
||||
views.setImageViewBitmap(R.id.widget_imageview, image)
|
||||
try {
|
||||
val image = Glide.with(context)
|
||||
.asBitmap()
|
||||
.load(path)
|
||||
.apply(options)
|
||||
.submit(widgetSize, widgetSize)
|
||||
.get()
|
||||
views.setImageViewBitmap(R.id.widget_imageview, image)
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
|
||||
setupAppOpenIntent(context, views, R.id.widget_holder, it)
|
||||
appWidgetManager.updateAppWidget(it.widgetId, views)
|
||||
|
|
Loading…
Reference in a new issue