OC-2772:Display a message if the user selects to share a file or folder that does...
authormasensio <masensio@solidgear.es>
Mon, 3 Feb 2014 08:26:36 +0000 (09:26 +0100)
committermasensio <masensio@solidgear.es>
Mon, 3 Feb 2014 08:26:36 +0000 (09:26 +0100)
owncloud-android-library
res/values/strings.xml
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

index 781e738..09b1c3c 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 781e738347a87c2b24144e03f7fe8fe32603f2f3
+Subproject commit 09b1c3c15aa2644635796c93ee918f8b0a20ff7c
index b4fff22..7d941c1 100644 (file)
        <string name="failed_upload_quota_exceeded_text">Please check your server configuration,maybe your quota is exceeded.</string>
        
        <string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your administrator.</string>
        <string name="failed_upload_quota_exceeded_text">Please check your server configuration,maybe your quota is exceeded.</string>
        
        <string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your administrator.</string>
+       <string name="share_link_file_no_exist">Unable to share this file or folder. Please, make sure it exists</string>
 </resources>
 </resources>
index e26843b..9ae9dfe 100644 (file)
@@ -1345,11 +1345,25 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
 
         } else if (operation instanceof CreateFolderOperation) {
             onCreateFolderOperationFinish((CreateFolderOperation)operation, result);
 
         } else if (operation instanceof CreateFolderOperation) {
             onCreateFolderOperationFinish((CreateFolderOperation)operation, result);
+        
+        } else if (operation instanceof CreateShareOperation) {
+            onCreateShareOperation((CreateShareOperation) operation, result);
         }
         
     }
 
 
         }
         
     }
 
 
+    private void onCreateShareOperation(CreateShareOperation operation, RemoteOperationResult result) {
+        if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
+            // Show a Message
+            Toast t = Toast.makeText(this, getString(R.string.share_link_file_no_exist), Toast.LENGTH_LONG);
+            t.show();
+        }
+        
+        refeshListOfFilesFragment();
+        
+    }
+
     /**
      * Updates the view associated to the activity after the finish of an operation trying to remove a 
      * file. 
     /**
      * Updates the view associated to the activity after the finish of an operation trying to remove a 
      * file.