Skip to content

Commit 845a015

Browse files
committed
Widgets: send update when refreshing clock and date
1 parent f97c6a7 commit 845a015

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: app/src/main/java/com/thewizrd/simpleweather/widgets/WidgetUpdaterHelper.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -1660,14 +1660,15 @@ object WidgetUpdaterHelper {
16601660
if (WidgetUtils.isClockWidget(widgetType)) {
16611661
val mAppWidgetManager = AppWidgetManager.getInstance(context)
16621662

1663-
val views = RemoteViews(context.packageName, info.widgetLayoutId)
16641663
for (appWidgetId in appWidgetIds) {
16651664
if (!settingsManager.useFollowGPS() && WidgetUtils.isGPS(appWidgetId)) return
16661665
val locationData = getLocation(context, appWidgetId)
16671666

16681667
// Widget dimensions
1668+
val views = RemoteViews(context.packageName, info.widgetLayoutId)
16691669
val newOptions = mAppWidgetManager.getAppWidgetOptions(appWidgetId)
16701670
buildClock(context, info, locationData, views, appWidgetId, newOptions)
1671+
mAppWidgetManager.partiallyUpdateAppWidget(appWidgetId, views)
16711672
}
16721673
}
16731674
}
@@ -1742,15 +1743,16 @@ object WidgetUpdaterHelper {
17421743

17431744
if (WidgetUtils.isDateWidget(widgetType)) {
17441745
val mAppWidgetManager = AppWidgetManager.getInstance(context)
1745-
val views = RemoteViews(context.packageName, info.widgetLayoutId)
17461746

17471747
for (appWidgetId in appWidgetIds) {
17481748
if (!settingsManager.useFollowGPS() && WidgetUtils.isGPS(appWidgetId)) return
17491749
val locationData = getLocation(context, appWidgetId)
17501750

17511751
// Widget dimensions
1752+
val views = RemoteViews(context.packageName, info.widgetLayoutId)
17521753
val newOptions = mAppWidgetManager.getAppWidgetOptions(appWidgetId)
17531754
buildDate(context, info, locationData, views, appWidgetId, newOptions)
1755+
mAppWidgetManager.partiallyUpdateAppWidget(appWidgetId, views)
17541756
}
17551757
}
17561758
}

0 commit comments

Comments
 (0)