fix: default bitmap width/height
This commit is contained in:
parent
b1982013dc
commit
5ae1ead2c9
1 changed files with 7 additions and 2 deletions
|
@ -85,8 +85,13 @@ class UpcomingWidget : AppWidgetProvider() {
|
||||||
) as GradientDrawable
|
) as GradientDrawable
|
||||||
gradientDrawable.colors = intArrayOf(backgroundColor, backgroundFade)
|
gradientDrawable.colors = intArrayOf(backgroundColor, backgroundFade)
|
||||||
val widgetSizeProvider = WidgetSizeProvider(context)
|
val widgetSizeProvider = WidgetSizeProvider(context)
|
||||||
val (width, height) = widgetSizeProvider.getWidgetsSize(appWidgetId)
|
var (width, height) = widgetSizeProvider.getWidgetsSize(appWidgetId)
|
||||||
gradientDrawable.cornerRadius = 50f
|
if (width > 0 && height > 0) {
|
||||||
|
gradientDrawable.cornerRadius = 50f
|
||||||
|
} else {
|
||||||
|
width = 300
|
||||||
|
height = 300
|
||||||
|
}
|
||||||
|
|
||||||
val intentTemplate = Intent(context, MainActivity::class.java)
|
val intentTemplate = Intent(context, MainActivity::class.java)
|
||||||
intentTemplate.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
intentTemplate.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue