From: masensio Date: Mon, 3 Feb 2014 08:26:36 +0000 (+0100) Subject: OC-2772:Display a message if the user selects to share a file or folder that does... X-Git-Tag: oc-android-1.5.5~58^2~16 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/261d8a5167571ffbaa447cce8df24f32a53faf7d?hp=-c OC-2772:Display a message if the user selects to share a file or folder that does not exist on the server --- 261d8a5167571ffbaa447cce8df24f32a53faf7d diff --git a/owncloud-android-library b/owncloud-android-library index 781e7383..09b1c3c1 160000 --- a/owncloud-android-library +++ b/owncloud-android-library @@ -1 +1 @@ -Subproject commit 781e738347a87c2b24144e03f7fe8fe32603f2f3 +Subproject commit 09b1c3c15aa2644635796c93ee918f8b0a20ff7c diff --git a/res/values/strings.xml b/res/values/strings.xml index b4fff221..7d941c1a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -246,4 +246,5 @@ Please check your server configuration,maybe your quota is exceeded. Sorry, sharing is not enabled on your server. Please contact your administrator. + Unable to share this file or folder. Please, make sure it exists diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index e26843b1..9ae9dfed 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -1345,11 +1345,25 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa } 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.