mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Add forward button to MediaPreview
Closes #5833 Related to #4906 // FREEBIE
This commit is contained in:
parent
0945b19364
commit
a3244de587
@ -1,6 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item android:id="@+id/media_preview__forward"
|
||||
android:title="@string/media_preview__forward_title"
|
||||
android:icon="@drawable/ic_forward_white_24dp"
|
||||
app:showAsAction="always"/>
|
||||
<item android:id="@+id/save"
|
||||
android:title="@string/media_preview__save_title"
|
||||
android:icon="@drawable/ic_save_white_24dp"
|
||||
|
@ -1237,6 +1237,7 @@
|
||||
|
||||
<!-- media_preview -->
|
||||
<string name="media_preview__save_title">Save</string>
|
||||
<string name="media_preview__forward_title">Forward</string>
|
||||
|
||||
<!-- media_overview -->
|
||||
<string name="media_overview__save_all">Save all</string>
|
||||
|
@ -166,6 +166,13 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
||||
image.setImageDrawable(null);
|
||||
}
|
||||
|
||||
private void forward() {
|
||||
Intent composeIntent = new Intent(this, ShareActivity.class);
|
||||
composeIntent.putExtra(Intent.EXTRA_STREAM, mediaUri);
|
||||
composeIntent.setType(mediaType);
|
||||
startActivity(composeIntent);
|
||||
}
|
||||
|
||||
private void saveToDisk() {
|
||||
SaveAttachmentTask.showWarningDialog(this, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
@ -192,8 +199,9 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
||||
super.onOptionsItemSelected(item);
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.save: saveToDisk(); return true;
|
||||
case android.R.id.home: finish(); return true;
|
||||
case R.id.media_preview__forward: forward(); return true;
|
||||
case R.id.save: saveToDisk(); return true;
|
||||
case android.R.id.home: finish(); return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user