From: masensio Date: Wed, 19 Feb 2014 09:33:27 +0000 (+0100) Subject: OC-3016: Add option 'send_files_to_other_apps' with default value 'on' X-Git-Tag: oc-android-1.5.5~22^2~19 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/8db07c67b6e403ea44b3b9ca1f5d2b5e82858f77?ds=sidebyside;hp=--cc OC-3016: Add option 'send_files_to_other_apps' with default value 'on' --- 8db07c67b6e403ea44b3b9ca1f5d2b5e82858f77 diff --git a/res/values/setup.xml b/res/values/setup.xml index 2e07ae4b..c08f497e 100644 --- a/res/values/setup.xml +++ b/res/values/setup.xml @@ -21,6 +21,10 @@ off off + + on + + #FFFFFF #FFFFFF diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index 58edf6ed..50faf04f 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -252,6 +252,17 @@ public class FileDetailFragment extends FileFragment implements item.setVisible(false); item.setEnabled(false); } + + // Send file + item = menu.findItem(R.id.action_send_file); + boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on"); + if (item != null && sendEnabled) { + item.setVisible(true); + item.setEnabled(true); + } else { + item.setVisible(false); + item.setEnabled(false); + } } diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index a4919cab..e902b05f 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -263,6 +263,12 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName toHide.add(R.id.action_unshare_file); } + // Send file + boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on"); + if (!sendEnabled) { + toHide.add(R.id.action_send_file); + } + for (int i : toHide) { item = menu.findItem(i); if (item != null) { diff --git a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java index 2ea1e1f6..3a374e08 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -250,6 +250,12 @@ public class PreviewImageFragment extends FileFragment implements OnRemoteOper toHide.add(R.id.action_unshare_file); } + // Send file + boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on"); + if (!sendEnabled) { + toHide.add(R.id.action_send_file); + } + for (int i : toHide) { item = menu.findItem(i); if (item != null) { diff --git a/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java b/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java index d2b5e509..7fa399ae 100644 --- a/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java @@ -295,6 +295,12 @@ public class PreviewMediaFragment extends FileFragment implements toHide.add(R.id.action_unshare_file); } + // Send file + boolean sendEnabled = getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on"); + if (!sendEnabled) { + toHide.add(R.id.action_send_file); + } + for (int i : toHide) { item = menu.findItem(i); if (item != null) {