#496 Ensure widgets update when notifyNotesChanged is called.

This commit is contained in:
Daniel Bailey 2018-11-23 17:29:40 +00:00 committed by Niedermann IT-Dienstleistungen
parent 93fdb5049e
commit 66e34876b3
2 changed files with 4 additions and 0 deletions

View file

@ -76,6 +76,7 @@ public class NoteListWidget extends AppWidgetProvider {
views.setPendingIntentTemplate(R.id.note_list_widget_lv_dark, templatePI);
views.setRemoteAdapter(appWidgetId, R.id.note_list_widget_lv_dark, serviceIntent);
views.setEmptyView(R.id.note_list_widget_lv_dark, R.id.widget_note_list_placeholder_tv_dark);
awm.notifyAppWidgetViewDataChanged(appWidgetId, R.id.note_list_widget_lv_dark);
} else {
views = new RemoteViews(context.getPackageName(), R.layout.widget_note_list);
views.setTextViewText(R.id.widget_note_list_title_tv, getWidgetTitle(context, displayMode, category));
@ -85,6 +86,7 @@ public class NoteListWidget extends AppWidgetProvider {
views.setPendingIntentTemplate(R.id.note_list_widget_lv, templatePI);
views.setRemoteAdapter(appWidgetId, R.id.note_list_widget_lv, serviceIntent);
views.setEmptyView(R.id.note_list_widget_lv, R.id.widget_note_list_placeholder_tv);
awm.notifyAppWidgetViewDataChanged(appWidgetId, R.id.note_list_widget_lv);
}
awm.updateAppWidget(appWidgetId, views);

View file

@ -47,11 +47,13 @@ public class SingleNoteWidget extends AppWidgetProvider {
views.setPendingIntentTemplate(R.id.single_note_widget_lv_dark, templatePendingIntent);
views.setRemoteAdapter(R.id.single_note_widget_lv_dark, serviceIntent);
views.setEmptyView(R.id.single_note_widget_lv_dark, R.id.widget_single_note_placeholder_tv_dark);
awm.notifyAppWidgetViewDataChanged(appWidgetId, R.id.single_note_widget_lv_dark);
} else {
views = new RemoteViews(context.getPackageName(), R.layout.widget_single_note);
views.setPendingIntentTemplate(R.id.single_note_widget_lv, templatePendingIntent);
views.setRemoteAdapter(R.id.single_note_widget_lv, serviceIntent);
views.setEmptyView(R.id.single_note_widget_lv, R.id.widget_single_note_placeholder_tv);
awm.notifyAppWidgetViewDataChanged(appWidgetId, R.id.single_note_widget_lv);
}
awm.updateAppWidget(appWidgetId, views);