diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/widget/SingleNoteWidget.java b/app/src/main/java/it/niedermann/owncloud/notes/android/widget/SingleNoteWidget.java index 72debc9f..73d28921 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/widget/SingleNoteWidget.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/widget/SingleNoteWidget.java @@ -5,6 +5,7 @@ import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.Context; import android.content.Intent; +import android.util.Log; import android.widget.RemoteViews; import it.niedermann.owncloud.notes.R; @@ -17,29 +18,20 @@ import it.niedermann.owncloud.notes.model.Note; * Created by stefan on 08.10.15. */ public class SingleNoteWidget extends AppWidgetProvider { - public final static String ACTION_SHOW_NOTE = "ACTION_SHOW_NOTE"; public static void updateAppWidget(Note note, Context context, AppWidgetManager appWidgetManager, int appWidgetId) { RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.widget_single_note); if (note != null) { updateViews.setTextViewText(R.id.single_note_content, note.getSpannableContent()); - //FIXME does not work! Intent intent = new Intent(context, NoteActivity.class); - //intent.setAction(ACTION_SHOW_NOTE); intent.putExtra(NotesListViewActivity.SELECTED_NOTE, note); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); updateViews.setOnClickPendingIntent(R.id.single_note, pendingIntent); } + Log.v("Note", "Note is null: " + (note == null)); appWidgetManager.updateAppWidget(appWidgetId, updateViews); } - @Override - public void onReceive(Context context, Intent intent) { - super.onReceive(context, intent); - //if (intent.getAction().equals(ACTION_SHOW_NOTE)) { - //} - } - @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { for (int i = 0; i < appWidgetIds.length; i++) { diff --git a/app/src/main/res/layout/activity_select_single_note.xml b/app/src/main/res/layout/activity_select_single_note.xml index f49b10c4..2a4872ac 100644 --- a/app/src/main/res/layout/activity_select_single_note.xml +++ b/app/src/main/res/layout/activity_select_single_note.xml @@ -1,5 +1,7 @@ - diff --git a/app/src/main/res/layout/fragment_no_notes.xml b/app/src/main/res/layout/fragment_no_notes.xml new file mode 100644 index 00000000..b496a4f0 --- /dev/null +++ b/app/src/main/res/layout/fragment_no_notes.xml @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index c60f49c4..205ac9d2 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -2,6 +2,7 @@ ownCloud Notes + Noch keine Notizen vorhanden Neue Notiz Einstellungen Speichern diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 069efce4..6c72b828 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,6 +2,7 @@ ownCloud Notes + No notes yet New Note Settings Save