Loading app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -227,6 +227,7 @@ public class NotesRepository { } } db.getAccountDao().deleteAccount(account); db.getAccountDao().deleteAccount(account); notifyWidgets(); } } public Account getAccountByName(String accountName) { public Account getAccountByName(String accountName) { Loading app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,11 @@ public class NoteListWidgetFactory implements RemoteViewsService.RemoteViewsFact dbNotes.clear(); dbNotes.clear(); try { try { data = repo.getNoteListWidgetData(appWidgetId); data = repo.getNoteListWidgetData(appWidgetId); if (data == null) { return; } Log.v(TAG, "--- data - " + data); Log.v(TAG, "--- data - " + data); switch (data.getMode()) { switch (data.getMode()) { case MODE_DISPLAY_ALL: case MODE_DISPLAY_ALL: Loading Loading @@ -87,11 +92,19 @@ public class NoteListWidgetFactory implements RemoteViewsService.RemoteViewsFact @Override @Override public int getCount() { public int getCount() { if (data == null) { return 0; } return dbNotes.size() + 1; return dbNotes.size() + 1; } } @Override @Override public RemoteViews getViewAt(int position) { public RemoteViews getViewAt(int position) { if (data == null) { return null; } final RemoteViews note_content; final RemoteViews note_content; if (position == 0) { if (position == 0) { Loading app/src/main/java/it/niedermann/owncloud/notes/widget/singlenote/SingleNoteWidget.java +13 −13 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,9 @@ public class SingleNoteWidget extends AppWidgetProvider { final var data = repo.getSingleNoteWidgetData(appWidgetId); final var data = repo.getSingleNoteWidgetData(appWidgetId); if (data != null) { if (data != null) { templateIntent.putExtra(BaseNoteFragment.PARAM_ACCOUNT_ID, data.getAccountId()); templateIntent.putExtra(BaseNoteFragment.PARAM_ACCOUNT_ID, data.getAccountId()); } else { Log.i(TAG, "onUpdate has been triggered before the user finished configuring the widget"); } final var serviceIntent = new Intent(context, SingleNoteWidgetService.class); final var serviceIntent = new Intent(context, SingleNoteWidgetService.class); serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); Loading @@ -47,9 +50,6 @@ public class SingleNoteWidget extends AppWidgetProvider { awm.notifyAppWidgetViewDataChanged(appWidgetId, R.id.single_note_widget_lv); awm.notifyAppWidgetViewDataChanged(appWidgetId, R.id.single_note_widget_lv); awm.updateAppWidget(appWidgetId, views); awm.updateAppWidget(appWidgetId, views); } else { Log.i(TAG, "onUpdate has been triggered before the user finished configuring the widget"); } } } } } Loading app/src/main/java/it/niedermann/owncloud/notes/widget/singlenote/SingleNoteWidgetFactory.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -51,6 +51,7 @@ public class SingleNoteWidgetFactory implements RemoteViewsService.RemoteViewsFa Log.e(TAG, "Error: note not found"); Log.e(TAG, "Error: note not found"); } } } else { } else { note = null; Log.w(TAG, "Widget with ID " + appWidgetId + " seems to be not configured yet."); Log.w(TAG, "Widget with ID " + appWidgetId + " seems to be not configured yet."); } } } } Loading Loading
app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -227,6 +227,7 @@ public class NotesRepository { } } db.getAccountDao().deleteAccount(account); db.getAccountDao().deleteAccount(account); notifyWidgets(); } } public Account getAccountByName(String accountName) { public Account getAccountByName(String accountName) { Loading
app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,11 @@ public class NoteListWidgetFactory implements RemoteViewsService.RemoteViewsFact dbNotes.clear(); dbNotes.clear(); try { try { data = repo.getNoteListWidgetData(appWidgetId); data = repo.getNoteListWidgetData(appWidgetId); if (data == null) { return; } Log.v(TAG, "--- data - " + data); Log.v(TAG, "--- data - " + data); switch (data.getMode()) { switch (data.getMode()) { case MODE_DISPLAY_ALL: case MODE_DISPLAY_ALL: Loading Loading @@ -87,11 +92,19 @@ public class NoteListWidgetFactory implements RemoteViewsService.RemoteViewsFact @Override @Override public int getCount() { public int getCount() { if (data == null) { return 0; } return dbNotes.size() + 1; return dbNotes.size() + 1; } } @Override @Override public RemoteViews getViewAt(int position) { public RemoteViews getViewAt(int position) { if (data == null) { return null; } final RemoteViews note_content; final RemoteViews note_content; if (position == 0) { if (position == 0) { Loading
app/src/main/java/it/niedermann/owncloud/notes/widget/singlenote/SingleNoteWidget.java +13 −13 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,9 @@ public class SingleNoteWidget extends AppWidgetProvider { final var data = repo.getSingleNoteWidgetData(appWidgetId); final var data = repo.getSingleNoteWidgetData(appWidgetId); if (data != null) { if (data != null) { templateIntent.putExtra(BaseNoteFragment.PARAM_ACCOUNT_ID, data.getAccountId()); templateIntent.putExtra(BaseNoteFragment.PARAM_ACCOUNT_ID, data.getAccountId()); } else { Log.i(TAG, "onUpdate has been triggered before the user finished configuring the widget"); } final var serviceIntent = new Intent(context, SingleNoteWidgetService.class); final var serviceIntent = new Intent(context, SingleNoteWidgetService.class); serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); Loading @@ -47,9 +50,6 @@ public class SingleNoteWidget extends AppWidgetProvider { awm.notifyAppWidgetViewDataChanged(appWidgetId, R.id.single_note_widget_lv); awm.notifyAppWidgetViewDataChanged(appWidgetId, R.id.single_note_widget_lv); awm.updateAppWidget(appWidgetId, views); awm.updateAppWidget(appWidgetId, views); } else { Log.i(TAG, "onUpdate has been triggered before the user finished configuring the widget"); } } } } } Loading
app/src/main/java/it/niedermann/owncloud/notes/widget/singlenote/SingleNoteWidgetFactory.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -51,6 +51,7 @@ public class SingleNoteWidgetFactory implements RemoteViewsService.RemoteViewsFa Log.e(TAG, "Error: note not found"); Log.e(TAG, "Error: note not found"); } } } else { } else { note = null; Log.w(TAG, "Widget with ID " + appWidgetId + " seems to be not configured yet."); Log.w(TAG, "Widget with ID " + appWidgetId + " seems to be not configured yet."); } } } } Loading