Skip to content

Commit

Permalink
Changed sharing content behavior by stripping out title string
Browse files Browse the repository at this point in the history
Originally the sharing option was designed to include the title string within the content to avoid loosing it while sharing a note to messaging apps (Telegram, Whatsapp, other) but it was a workaround for all of them actually not checking the Intent.EXTRA_SUBJECT field
Closes #948
  • Loading branch information
federicoiosue committed Dec 16, 2023
1 parent d1e1289 commit 8037bc5
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,6 @@ public void switchToDetail(Note note) {


public void shareNote(Note note) {
String titleText = note.getTitle();

String contentText = titleText
+ System.getProperty("line.separator")
+ note.getContent();

Intent shareIntent = new Intent();
// Prepare sharing intent with only text
if (note.getAttachmentsList().isEmpty()) {
Expand Down Expand Up @@ -558,8 +552,8 @@ public void shareNote(Note note) {

shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
}
shareIntent.putExtra(Intent.EXTRA_SUBJECT, titleText);
shareIntent.putExtra(Intent.EXTRA_TEXT, contentText);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, note.getTitle());
shareIntent.putExtra(Intent.EXTRA_TEXT, note.getContent());

startActivity(Intent.createChooser(shareIntent, getResources().getString(R.string.share_message_chooser)));
}
Expand Down

0 comments on commit 8037bc5

Please sign in to comment.