mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-26 23:27:55 +03:00
parent
5cde97fe73
commit
10de6d0adf
4 changed files with 8 additions and 7 deletions
|
@ -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>
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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…
Reference in a new issue