diff --git a/res/menu/file_actions_menu.xml b/res/menu/file_actions_menu.xml index 1e78a367fc..05722063ad 100644 --- a/res/menu/file_actions_menu.xml +++ b/res/menu/file_actions_menu.xml @@ -29,5 +29,6 @@ + diff --git a/res/values-de-rCH/strings.xml b/res/values-de-rCH/strings.xml index d995da1c47..c5d7ce4f0f 100644 --- a/res/values-de-rCH/strings.xml +++ b/res/values-de-rCH/strings.xml @@ -10,6 +10,7 @@ Ordner anlegen Einstellungen Details + Teile Datei Allgemein Mehr Konten diff --git a/res/values-de-rDE/strings.xml b/res/values-de-rDE/strings.xml index ca43de3dc4..97a67e93c1 100644 --- a/res/values-de-rDE/strings.xml +++ b/res/values-de-rDE/strings.xml @@ -10,6 +10,7 @@ Ordner anlegen Einstellungen Details + Teile Datei Allgemein Mehr Konten diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 17b92e997a..06f49d41d7 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -10,6 +10,7 @@ Ordner anlegen Einstellungen Details + Teile Datei Allgemein Mehr Konten diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml index e4b215ae66..4ec67dda83 100644 --- a/res/values-en-rGB/strings.xml +++ b/res/values-en-rGB/strings.xml @@ -10,6 +10,7 @@ Create directory Settings Details + Share General More Accounts diff --git a/res/values/strings.xml b/res/values/strings.xml index f6871a6a63..6c392b2420 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -11,7 +11,7 @@ Create directory Settings Details - + Share General More Accounts diff --git a/res/values/styles.xml b/res/values/styles.xml index 034ca5cbb7..c65cbadd70 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -59,7 +59,7 @@ - diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index 6653064558..5780e58a59 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -42,9 +42,10 @@ import com.owncloud.android.ui.preview.PreviewImageFragment; import com.owncloud.android.ui.preview.PreviewMediaFragment; import com.owncloud.android.utils.Log_OC; - import android.accounts.Account; import android.app.Activity; +import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.view.ContextMenu; @@ -221,6 +222,7 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName toHide.add(R.id.action_cancel_upload); toHide.add(R.id.action_sync_file); toHide.add(R.id.action_see_details); + toHide.add(R.id.action_share_file); if ( mContainerActivity.getFileDownloaderBinder().isDownloading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile) || mContainerActivity.getFileUploaderBinder().isUploading(AccountUtils.getCurrentOwnCloudAccount(getActivity()), targetFile) ) { toDisable.add(R.id.action_rename_file); @@ -359,6 +361,14 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName ((FileFragment.ContainerActivity)getActivity()).showDetails(mTargetFile); return true; } + case R.id.action_share_file: { + Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); + // set MimeType + sharingIntent.setType(mTargetFile.getMimetype()); + sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+mTargetFile.getStoragePath())); + startActivity(Intent.createChooser(sharingIntent, "Share via")); + return true; + } default: return super.onContextItemSelected(item); } diff --git a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java index 4785a13488..88f40b829c 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -310,11 +310,23 @@ public class PreviewImageFragment extends FileFragment implements OnRemoteOper seeDetails(); return true; } + case R.id.action_share_file: { + shareFile(); + return true; + } default: return false; } } + + private void shareFile(){ + Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); + // set MimeType + sharingIntent.setType(getFile().getMimetype()); + sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+getFile().getStoragePath())); + startActivity(Intent.createChooser(sharingIntent, "Share via")); + }