Loading app/src/main/AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="content" /> <data android:host="*" /> <data android:mimeType="*/*" /> <data android:mimeType="text/*" /> </intent-filter> </activity> Loading app/src/main/java/it/niedermann/owncloud/notes/android/activity/EditNoteActivity.java +5 −5 Original line number Diff line number Diff line Loading @@ -177,19 +177,19 @@ public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragm private void launchReadonlyNote() { Intent intent = getIntent(); StringBuilder text = new StringBuilder(); StringBuilder content = new StringBuilder(); try { InputStream inputStream = getContentResolver().openInputStream(Objects.requireNonNull(intent.getData())); BufferedReader r = new BufferedReader(new InputStreamReader(Objects.requireNonNull(inputStream))); String mLine; while ((mLine = r.readLine()) != null) { text.append(mLine).append('\n'); String line; while ((line = r.readLine()) != null) { content.append(line).append('\n'); } } catch (IOException e) { e.printStackTrace(); } fragment = NoteReadonlyFragment.newInstance(text.toString()); fragment = NoteReadonlyFragment.newInstance(content.toString()); getSupportFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit(); } Loading app/src/main/java/it/niedermann/owncloud/notes/android/fragment/BaseNoteFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ public abstract class BaseNoteFragment extends Fragment implements CategoryDialo if (content == null) { throw new IllegalArgumentException(PARAM_NOTE_ID + " is not given, argument " + PARAM_NEWNOTE + " is missing and " + PARAM_CONTENT + " is missing."); } else { note = new DBNote(-1, -1, null, NoteUtil.generateNonEmptyNoteTitle(content, getContext()), content, false, "", null, DBStatus.VOID, -1, ""); note = new DBNote(-1, -1, null, NoteUtil.generateNonEmptyNoteTitle(content, getContext()), content, false, getString(R.string.category_readonly), null, DBStatus.VOID, -1, ""); } } else { note = db.getNote(localAccount.getId(), db.addNoteAndSync(localAccount.getId(), cloudNote)); Loading app/src/main/res/values/strings.xml +1 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ <string name="checkbox_could_not_be_toggled">Checkbox could not be toggled.</string> <string name="bulk_notes_deleted">Deleted %1$d notes</string> <string name="bulk_notes_restored">Restored %1$d notes</string> <string name="category_readonly">Read only</string> <!-- Array: note modes --> <string-array name="noteMode_entries"> Loading Loading
app/src/main/AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="content" /> <data android:host="*" /> <data android:mimeType="*/*" /> <data android:mimeType="text/*" /> </intent-filter> </activity> Loading
app/src/main/java/it/niedermann/owncloud/notes/android/activity/EditNoteActivity.java +5 −5 Original line number Diff line number Diff line Loading @@ -177,19 +177,19 @@ public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragm private void launchReadonlyNote() { Intent intent = getIntent(); StringBuilder text = new StringBuilder(); StringBuilder content = new StringBuilder(); try { InputStream inputStream = getContentResolver().openInputStream(Objects.requireNonNull(intent.getData())); BufferedReader r = new BufferedReader(new InputStreamReader(Objects.requireNonNull(inputStream))); String mLine; while ((mLine = r.readLine()) != null) { text.append(mLine).append('\n'); String line; while ((line = r.readLine()) != null) { content.append(line).append('\n'); } } catch (IOException e) { e.printStackTrace(); } fragment = NoteReadonlyFragment.newInstance(text.toString()); fragment = NoteReadonlyFragment.newInstance(content.toString()); getSupportFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit(); } Loading
app/src/main/java/it/niedermann/owncloud/notes/android/fragment/BaseNoteFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ public abstract class BaseNoteFragment extends Fragment implements CategoryDialo if (content == null) { throw new IllegalArgumentException(PARAM_NOTE_ID + " is not given, argument " + PARAM_NEWNOTE + " is missing and " + PARAM_CONTENT + " is missing."); } else { note = new DBNote(-1, -1, null, NoteUtil.generateNonEmptyNoteTitle(content, getContext()), content, false, "", null, DBStatus.VOID, -1, ""); note = new DBNote(-1, -1, null, NoteUtil.generateNonEmptyNoteTitle(content, getContext()), content, false, getString(R.string.category_readonly), null, DBStatus.VOID, -1, ""); } } else { note = db.getNote(localAccount.getId(), db.addNoteAndSync(localAccount.getId(), cloudNote)); Loading
app/src/main/res/values/strings.xml +1 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ <string name="checkbox_could_not_be_toggled">Checkbox could not be toggled.</string> <string name="bulk_notes_deleted">Deleted %1$d notes</string> <string name="bulk_notes_restored">Restored %1$d notes</string> <string name="category_readonly">Read only</string> <!-- Array: note modes --> <string-array name="noteMode_entries"> Loading