fix: default bitmap width/height

This commit is contained in:
rebelonion 2024-03-26 00:07:48 -05:00
parent b1982013dc
commit 5ae1ead2c9

View file

@ -85,8 +85,13 @@ class UpcomingWidget : AppWidgetProvider() {
) as GradientDrawable
gradientDrawable.colors = intArrayOf(backgroundColor, backgroundFade)
val widgetSizeProvider = WidgetSizeProvider(context)
val (width, height) = widgetSizeProvider.getWidgetsSize(appWidgetId)
var (width, height) = widgetSizeProvider.getWidgetsSize(appWidgetId)
if (width > 0 && height > 0) {
gradientDrawable.cornerRadius = 50f
} else {
width = 300
height = 300
}
val intentTemplate = Intent(context, MainActivity::class.java)
intentTemplate.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK