diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 2a00a1f6..0f0decc3 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -58,9 +58,12 @@
/>
+ android:name="it.niedermann.owncloud.notes.android.activity.EditNoteActivity"
+ android:label="@string/menu_edit"
+ android:parentActivityName="it.niedermann.owncloud.notes.android.activity.NotesListViewActivity"
+ android:windowSoftInputMode="stateHidden"
+ android:launchMode="singleTask"
+ >
@@ -68,14 +71,6 @@
-
-
() {
- @Override
- public void onCompleted() {
- }
-
- @Override
- public void onError(Throwable e) {
- }
-
- @Override
- public void onNext(CharSequence charSequence) {
- editTextField.setText(charSequence, TextView.BufferType.SPANNABLE);
- }
- });
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.menu_menu_create, menu);
- return true;
- }
-
- /**
- * Main-Menu
- */
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- int id = item.getItemId();
- switch (id) {
- case R.id.action_create_save:
- saveAndClose(false);
- return true;
- case R.id.action_create_cancel:
- finish();
- return true;
- default:
- return super.onOptionsItemSelected(item);
- }
- }
-
- @Override
- public void onBackPressed() {
- saveAndClose(true);
- }
-
- /**
- * Saves as new note and closes the Activity.
- * @param implicit If true
, the note is only saved if non-empty.
- */
- private void saveAndClose(boolean implicit) {
- editTextField.setEnabled(false);
- String content = editTextField.getText().toString();
- if(!implicit || !content.isEmpty()) {
- NoteSQLiteOpenHelper db = NoteSQLiteOpenHelper.getInstance(this);
- Intent data = new Intent(this, NotesListViewActivity.class);
- String category = categoryPreselection==null ? null : categoryPreselection.category;
- boolean favorite = categoryPreselection!=null && categoryPreselection.favorite!=null ? categoryPreselection.favorite : false;
- data.putExtra(NotesListViewActivity.CREATED_NOTE, db.getNote(db.addNoteAndSync(content, category, favorite)));
- setResult(RESULT_OK, data);
- }
- finish();
- }
-
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
-
- if (requestCode == server_settings) {
- if (resultCode != RESULT_OK) {
- // User has not setup the server config and no note can be created
- finish();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/EditNoteActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/EditNoteActivity.java
index 1d782122..10260167 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/EditNoteActivity.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/EditNoteActivity.java
@@ -11,16 +11,21 @@ import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
+import java.util.Calendar;
+
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.android.fragment.BaseNoteFragment;
import it.niedermann.owncloud.notes.android.fragment.NoteEditFragment;
import it.niedermann.owncloud.notes.android.fragment.NotePreviewFragment;
+import it.niedermann.owncloud.notes.model.Category;
+import it.niedermann.owncloud.notes.model.CloudNote;
import it.niedermann.owncloud.notes.model.DBNote;
import it.niedermann.owncloud.notes.util.NoteUtil;
public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragment.NoteFragmentListener {
public static final String PARAM_NOTE_ID = "noteId";
+ public static final String PARAM_CATEGORY = "category";
private BaseNoteFragment fragment;
@@ -29,7 +34,7 @@ public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragm
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
- createFragmentByPreference();
+ launchNoteFragment();
} else {
fragment = (BaseNoteFragment) getFragmentManager().findFragmentById(android.R.id.content);
}
@@ -48,16 +53,32 @@ public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragm
getFragmentManager().beginTransaction().detach(fragment).commit();
fragment = null;
}
- createFragmentByPreference();
+ launchNoteFragment();
}
private long getNoteId() {
return getIntent().getLongExtra(PARAM_NOTE_ID, 0);
}
- private void createFragmentByPreference() {
+ /**
+ * Starts the note fragment for an existing note or a new note.
+ * The actual behavior is triggered by the activity's intent.
+ */
+ private void launchNoteFragment() {
long noteId = getNoteId();
+ if(noteId>0) {
+ launchExistingNote(noteId);
+ } else {
+ launchNewNote();
+ }
+ }
+ /**
+ * Starts a {@link NoteEditFragment} or {@link NotePreviewFragment} for an existing note.
+ * The type of fragment (view-mode) is chosen based on the user preferences.
+ * @param noteId ID of the existing note.
+ */
+ private void launchExistingNote(long noteId) {
final String prefKeyNoteMode = getString(R.string.pref_key_note_mode);
final String prefKeyLastMode = getString(R.string.pref_key_last_note_mode);
final String prefValueEdit = getString(R.string.pref_value_mode_edit);
@@ -67,19 +88,21 @@ public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragm
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
String mode = preferences.getString(prefKeyNoteMode, prefValueEdit);
String lastMode = preferences.getString(prefKeyLastMode, prefValueEdit);
+ boolean editMode = true;
if (prefValuePreview.equals(mode) || (prefValueLast.equals(mode) && prefValuePreview.equals(lastMode))) {
- createFragment(noteId, false);
- /* TODO enhancement: store last mode in note
- for cross device functionality per note mode should be stored on the server.
- } else if(prefValueLast.equals(mode) && prefValuePreview.equals(note.getMode())) {
- createPreviewFragment(note);
- */
- } else {
- createFragment(noteId, true);
+ editMode = false;
}
+ launchExistingNote(noteId, editMode);
}
- private void createFragment(long noteId, boolean edit) {
+ /**
+ * Starts a {@link NoteEditFragment} or {@link NotePreviewFragment} for an existing note.
+ * @param noteId ID of the existing note.
+ * @param edit View-mode of the fragment:
+ * true
for {@link NoteEditFragment},
+ * false
for {@link NotePreviewFragment}.
+ */
+ private void launchExistingNote(long noteId, boolean edit) {
// save state of the fragment in order to resume with the same note and originalNote
Fragment.SavedState savedState = null;
if(fragment != null) {
@@ -96,6 +119,31 @@ public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragm
getFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit();
}
+ /**
+ * Starts the {@link NoteEditFragment} with a new note.
+ * Content ("share" functionality), category and favorite attribute can be preset.
+ */
+ private void launchNewNote() {
+ Intent intent = getIntent();
+
+ String category = null;
+ boolean favorite = false;
+ if(intent.hasExtra(PARAM_CATEGORY)) {
+ Category categoryPreselection = (Category) intent.getSerializableExtra(PARAM_CATEGORY);
+ category = categoryPreselection.category;
+ favorite = categoryPreselection.favorite!=null ? categoryPreselection.favorite : false;
+ }
+
+ String content = "";
+ if (Intent.ACTION_SEND.equals(intent.getAction()) && "text/plain".equals(intent.getType())) {
+ content = intent.getStringExtra(Intent.EXTRA_TEXT);
+ }
+
+ CloudNote newNote = new CloudNote(0, Calendar.getInstance(), NoteUtil.generateNonEmptyNoteTitle(content, this), content, favorite, category, null);
+ fragment = NoteEditFragment.newInstanceWithNewNote(newNote);
+ getFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit();
+ }
+
@Override
public void onBackPressed() {
fragment.onPrepareClose();
@@ -117,11 +165,11 @@ public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragm
return true;
case R.id.menu_preview:
fragment.onPrepareClose();
- createFragment(getNoteId(), false);
+ launchExistingNote(getNoteId(), false);
return true;
case R.id.menu_edit:
fragment.onPrepareClose();
- createFragment(getNoteId(), true);
+ launchExistingNote(getNoteId(), true);
return true;
default:
return super.onOptionsItemSelected(item);
@@ -143,6 +191,7 @@ public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragm
} else {
preferences.edit().putString(prefKeyLastMode, getString(R.string.pref_value_mode_preview)).apply();
}
+ fragment.onFinalClose();
finish();
}
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java
index af61b229..cf910951 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java
@@ -182,8 +182,8 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
findViewById(R.id.fab_create).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- Intent createIntent = new Intent(getApplicationContext(), CreateNoteActivity.class);
- createIntent.putExtra(CreateNoteActivity.PARAM_CATEGORY, navigationSelection);
+ Intent createIntent = new Intent(getApplicationContext(), EditNoteActivity.class);
+ createIntent.putExtra(EditNoteActivity.PARAM_CATEGORY, navigationSelection);
startActivityForResult(createIntent, create_note_cmd);
}
});
@@ -362,7 +362,7 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
// add notification
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
PendingIntent newNoteIntent = PendingIntent.getActivity(this, 0,
- new Intent(this, CreateNoteActivity.class)
+ new Intent(this, EditNoteActivity.class)
.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP),
0);
builder.setSmallIcon(R.drawable.ic_action_new)
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/CreateNoteWidget.java b/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/CreateNoteWidget.java
index d1226047..d025015b 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/CreateNoteWidget.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/CreateNoteWidget.java
@@ -8,7 +8,7 @@ import android.content.Intent;
import android.widget.RemoteViews;
import it.niedermann.owncloud.notes.R;
-import it.niedermann.owncloud.notes.android.activity.CreateNoteActivity;
+import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
/**
* Implementation of App Widget functionality.
@@ -20,7 +20,7 @@ public class CreateNoteWidget extends AppWidgetProvider {
// Construct the RemoteViews object
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_create_note);
- Intent intent = new Intent(context, CreateNoteActivity.class);
+ Intent intent = new Intent(context, EditNoteActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
views.setOnClickPendingIntent(R.id.widget_create_note, pendingIntent);
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidget.java b/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidget.java
index 3996cd11..4375da6d 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidget.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/android/appwidget/NoteListWidget.java
@@ -10,7 +10,6 @@ import android.net.Uri;
import android.widget.RemoteViews;
import it.niedermann.owncloud.notes.R;
-import it.niedermann.owncloud.notes.android.activity.CreateNoteActivity;
import it.niedermann.owncloud.notes.android.activity.EditNoteActivity;
import it.niedermann.owncloud.notes.android.activity.NotesListViewActivity;
@@ -35,7 +34,7 @@ public class NoteListWidget extends AppWidgetProvider {
views.setOnClickPendingIntent(R.id.widget_note_list_title, pendingIntent);
// Launch create note activity if user taps "+" sign in header
- intent = new Intent(context, CreateNoteActivity.class);
+ intent = new Intent(context, EditNoteActivity.class);
pendingIntent = PendingIntent.getActivity(
context,
0,
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/BaseNoteFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/BaseNoteFragment.java
index a501af0c..f143a09f 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/BaseNoteFragment.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/BaseNoteFragment.java
@@ -14,6 +14,7 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import it.niedermann.owncloud.notes.R;
+import it.niedermann.owncloud.notes.model.CloudNote;
import it.niedermann.owncloud.notes.model.DBNote;
import it.niedermann.owncloud.notes.persistence.NoteSQLiteOpenHelper;
import it.niedermann.owncloud.notes.util.ICallback;
@@ -26,10 +27,12 @@ public abstract class BaseNoteFragment extends Fragment implements CategoryDialo
}
public static final String PARAM_NOTE_ID = "noteId";
+ public static final String PARAM_NEWNOTE = "newNote";
private static final String SAVEDKEY_NOTE = "note";
private static final String SAVEDKEY_ORIGINAL_NOTE = "original_note";
protected DBNote note;
+ @Nullable
private DBNote originalNote;
private NoteSQLiteOpenHelper db;
private NoteFragmentListener listener;
@@ -39,7 +42,16 @@ public abstract class BaseNoteFragment extends Fragment implements CategoryDialo
super.onCreate(savedInstanceState);
if(savedInstanceState==null) {
long id = getArguments().getLong(PARAM_NOTE_ID);
- note = originalNote = db.getNote(id);
+ if(id>0) {
+ note = originalNote = db.getNote(id);
+ } else {
+ CloudNote cloudNote = (CloudNote) getArguments().getSerializable(PARAM_NEWNOTE);
+ if(cloudNote == null) {
+ throw new IllegalArgumentException(PARAM_NOTE_ID + " is not given and argument " + PARAM_NEWNOTE +" is missing.");
+ }
+ note = db.getNote(db.addNoteAndSync(cloudNote));
+ originalNote = null;
+ }
} else {
note = (DBNote) savedInstanceState.getSerializable(SAVEDKEY_NOTE);
originalNote = (DBNote) savedInstanceState.getSerializable(SAVEDKEY_ORIGINAL_NOTE);
@@ -101,11 +113,15 @@ public abstract class BaseNoteFragment extends Fragment implements CategoryDialo
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_cancel:
- db.updateNoteAndSync(originalNote, null, null);
+ if(originalNote == null) {
+ db.deleteNoteAndSync(note.getId());
+ } else {
+ db.updateNoteAndSync(originalNote, null, null);
+ }
listener.close();
return true;
case R.id.menu_delete:
- db.deleteNoteAndSync(originalNote.getId());
+ db.deleteNoteAndSync(note.getId());
listener.close();
return true;
case R.id.menu_favorite:
@@ -135,6 +151,12 @@ public abstract class BaseNoteFragment extends Fragment implements CategoryDialo
saveNote(null);
}
+ public void onFinalClose() {
+ if(originalNote==null && getContent().isEmpty()) {
+ db.deleteNoteAndSync(note.getId());
+ }
+ }
+
/**
* Save the current state in the database and schedule synchronization if needed.
*
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NoteEditFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NoteEditFragment.java
index 3ebb7a97..651033c9 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NoteEditFragment.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NoteEditFragment.java
@@ -11,6 +11,7 @@ import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
+import android.view.WindowManager;
import android.widget.TextView;
import com.yydcdut.rxmarkdown.RxMDEditText;
@@ -18,6 +19,7 @@ import com.yydcdut.rxmarkdown.RxMarkdown;
import com.yydcdut.rxmarkdown.syntax.edit.EditFactory;
import it.niedermann.owncloud.notes.R;
+import it.niedermann.owncloud.notes.model.CloudNote;
import it.niedermann.owncloud.notes.util.ICallback;
import it.niedermann.owncloud.notes.util.MarkDownUtil;
import rx.Subscriber;
@@ -35,7 +37,15 @@ public class NoteEditFragment extends BaseNoteFragment {
public static NoteEditFragment newInstance(long noteId) {
NoteEditFragment f = new NoteEditFragment();
Bundle b = new Bundle();
- b.putSerializable(PARAM_NOTE_ID, noteId);
+ b.putLong(PARAM_NOTE_ID, noteId);
+ f.setArguments(b);
+ return f;
+ }
+
+ public static NoteEditFragment newInstanceWithNewNote(CloudNote newNote) {
+ NoteEditFragment f = new NoteEditFragment();
+ Bundle b = new Bundle();
+ b.putSerializable(PARAM_NEWNOTE, newNote);
f.setArguments(b);
return f;
}
@@ -63,6 +73,10 @@ public class NoteEditFragment extends BaseNoteFragment {
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
+ if(note.getContent().isEmpty()) {
+ getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
+ }
+
// workaround for issue yydcdut/RxMarkdown#41
note.setContent(note.getContent().replace("\r\n", "\n"));
@@ -139,7 +153,7 @@ public class NoteEditFragment extends BaseNoteFragment {
}
private RxMDEditText getContentView() {
- return (RxMDEditText) getView().findViewById(R.id.editContent);
+ return getView().findViewById(R.id.editContent);
}
/**
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NotePreviewFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NotePreviewFragment.java
index 5530cb63..7b565563 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NotePreviewFragment.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NotePreviewFragment.java
@@ -25,7 +25,7 @@ public class NotePreviewFragment extends BaseNoteFragment {
public static NotePreviewFragment newInstance(long noteId) {
NotePreviewFragment f = new NotePreviewFragment();
Bundle b = new Bundle();
- b.putSerializable(PARAM_NOTE_ID, noteId);
+ b.putLong(PARAM_NOTE_ID, noteId);
f.setArguments(b);
return f;
}
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteSQLiteOpenHelper.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteSQLiteOpenHelper.java
index eb8eda7e..a8afcb69 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteSQLiteOpenHelper.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteSQLiteOpenHelper.java
@@ -165,7 +165,7 @@ public class NoteSQLiteOpenHelper extends SQLiteOpenHelper {
*/
@SuppressWarnings("UnusedReturnValue")
public long addNoteAndSync(String content, String category, boolean favorite) {
- CloudNote note = new CloudNote(0, Calendar.getInstance(), NoteUtil.generateNoteTitle(content), content, favorite, category, null);
+ CloudNote note = new CloudNote(0, Calendar.getInstance(), NoteUtil.generateNonEmptyNoteTitle(content, getContext()), content, favorite, category, null);
return addNoteAndSync(note);
}
@@ -429,7 +429,7 @@ public class NoteSQLiteOpenHelper extends SQLiteOpenHelper {
if(newContent==null) {
newNote = new DBNote(oldNote.getId(), oldNote.getRemoteId(), oldNote.getModified(), oldNote.getTitle(), oldNote.getContent(), oldNote.isFavorite(), oldNote.getCategory(), oldNote.getEtag(), DBStatus.LOCAL_EDITED);
} else {
- newNote = new DBNote(oldNote.getId(), oldNote.getRemoteId(), Calendar.getInstance(), NoteUtil.generateNoteTitle(newContent), newContent, oldNote.isFavorite(), oldNote.getCategory(), oldNote.getEtag(), DBStatus.LOCAL_EDITED);
+ newNote = new DBNote(oldNote.getId(), oldNote.getRemoteId(), Calendar.getInstance(), NoteUtil.generateNonEmptyNoteTitle(newContent, getContext()), newContent, oldNote.isFavorite(), oldNote.getCategory(), oldNote.getEtag(), DBStatus.LOCAL_EDITED);
}
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/util/NoteUtil.java b/app/src/main/java/it/niedermann/owncloud/notes/util/NoteUtil.java
index 7f2c8f1f..68e45b74 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/util/NoteUtil.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/util/NoteUtil.java
@@ -1,10 +1,13 @@
package it.niedermann.owncloud.notes.util;
+import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.util.regex.Pattern;
+import it.niedermann.owncloud.notes.R;
+
/**
* Provides basic functionality for Note operations.
* Created by stefan on 06.10.15.
@@ -50,7 +53,7 @@ public class NoteUtil {
* @param line String - a single Line which ends with \n
* @return boolean isEmpty
*/
- public static boolean isEmptyLine(@Nullable String line) {
+ private static boolean isEmptyLine(@Nullable String line) {
return removeMarkDown(line).trim().length() == 0;
}
@@ -62,7 +65,7 @@ public class NoteUtil {
* @return truncated string
*/
@NonNull
- public static String truncateString(@NonNull String str, int len) {
+ private static String truncateString(@NonNull String str, int len) {
return str.substring(0, Math.min(len, str.length()));
}
@@ -80,6 +83,15 @@ public class NoteUtil {
return "";
}
+ @NonNull
+ public static String generateNonEmptyNoteTitle(@NonNull String content, Context context) {
+ String title = generateNoteTitle(content);
+ if(title.isEmpty()) {
+ title = context.getString(R.string.action_create);
+ }
+ return title;
+ }
+
/**
* Generates a title of a content String (reads fist linew which is not empty)
*
@@ -87,7 +99,7 @@ public class NoteUtil {
* @return excerpt String
*/
@NonNull
- public static String generateNoteTitle(@NonNull String content) {
+ static String generateNoteTitle(@NonNull String content) {
return getLineWithoutMarkDown(content, 0);
}
@@ -99,7 +111,7 @@ public class NoteUtil {
* @return lineContent String
*/
@NonNull
- public static String getLineWithoutMarkDown(@NonNull String content, int lineNumber) {
+ private static String getLineWithoutMarkDown(@NonNull String content, int lineNumber) {
String line = "";
if (content.contains("\n")) {
String[] lines = content.split("\n");
diff --git a/app/src/main/res/layout/activity_create.xml b/app/src/main/res/layout/activity_create.xml
deleted file mode 100644
index a3392dea..00000000
--- a/app/src/main/res/layout/activity_create.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_edit.xml b/app/src/main/res/layout/activity_edit.xml
index 8f736edf..092cf2b9 100644
--- a/app/src/main/res/layout/activity_edit.xml
+++ b/app/src/main/res/layout/activity_edit.xml
@@ -1,23 +1,18 @@
-
+ tools:context="it.niedermann.owncloud.notes.android.activity.EditNoteActivity">
-
-
-
-
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_single_note.xml b/app/src/main/res/layout/activity_single_note.xml
index 1940a6eb..b97b38d4 100644
--- a/app/src/main/res/layout/activity_single_note.xml
+++ b/app/src/main/res/layout/activity_single_note.xml
@@ -1,18 +1,13 @@
-
+ tools:context="it.niedermann.owncloud.notes.android.activity.EditNoteActivity">
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/shortcuts.xml b/app/src/main/res/xml/shortcuts.xml
index 1e5b0179..2746513a 100644
--- a/app/src/main/res/xml/shortcuts.xml
+++ b/app/src/main/res/xml/shortcuts.xml
@@ -9,7 +9,7 @@
+ android:targetClass="it.niedermann.owncloud.notes.android.activity.EditNoteActivity" />
\ No newline at end of file