OC-3016: Add option 'send_files_to_other_apps' with default value 'on'
authormasensio <masensio@solidgear.es>
Wed, 19 Feb 2014 09:33:27 +0000 (10:33 +0100)
committermasensio <masensio@solidgear.es>
Wed, 19 Feb 2014 09:33:27 +0000 (10:33 +0100)
res/values/setup.xml
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
src/com/owncloud/android/ui/preview/PreviewImageFragment.java
src/com/owncloud/android/ui/preview/PreviewMediaFragment.java

index 2e07ae4..c08f497 100644 (file)
     <string name="auth_method_oauth2">off</string>
     <string name="auth_method_saml_web_sso">off</string>
     
+    <!-- Flags to enable/disable some features -->
+    <string name = "send_files_to_other_apps">on</string>
+    
+    
     <!-- Colors -->
     <color name="login_background_color">#FFFFFF</color>
     <color name="login_logo_background_color">#FFFFFF</color>
index 58edf6e..50faf04 100644 (file)
@@ -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);
+        }
     }
 
     
index a4919ca..e902b05 100644 (file)
@@ -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) {
index 2ea1e1f..3a374e0 100644 (file)
@@ -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) {
index d2b5e50..7fa399a 100644 (file)
@@ -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) {