mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-17 21:47:28 +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"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
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"
|
<item android:id="@+id/save"
|
||||||
android:title="@string/media_preview__save_title"
|
android:title="@string/media_preview__save_title"
|
||||||
android:icon="@drawable/ic_save_white_24dp"
|
android:icon="@drawable/ic_save_white_24dp"
|
||||||
|
@ -1237,6 +1237,7 @@
|
|||||||
|
|
||||||
<!-- media_preview -->
|
<!-- media_preview -->
|
||||||
<string name="media_preview__save_title">Save</string>
|
<string name="media_preview__save_title">Save</string>
|
||||||
|
<string name="media_preview__forward_title">Forward</string>
|
||||||
|
|
||||||
<!-- media_overview -->
|
<!-- media_overview -->
|
||||||
<string name="media_overview__save_all">Save all</string>
|
<string name="media_overview__save_all">Save all</string>
|
||||||
|
@ -166,6 +166,13 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
|||||||
image.setImageDrawable(null);
|
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() {
|
private void saveToDisk() {
|
||||||
SaveAttachmentTask.showWarningDialog(this, new DialogInterface.OnClickListener() {
|
SaveAttachmentTask.showWarningDialog(this, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -192,8 +199,9 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
|||||||
super.onOptionsItemSelected(item);
|
super.onOptionsItemSelected(item);
|
||||||
|
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.save: saveToDisk(); return true;
|
case R.id.media_preview__forward: forward(); return true;
|
||||||
case android.R.id.home: finish(); return true;
|
case R.id.save: saveToDisk(); return true;
|
||||||
|
case android.R.id.home: finish(); return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user