mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
OC-2771: Add pop-up message if the server doesn't support Share API and Share Link option is selected
This commit is contained in:
parent
f7bb011b7e
commit
0f7d8d8453
2 changed files with 16 additions and 2 deletions
|
@ -244,4 +244,6 @@
|
|||
<string name="failed_upload_retry_do_nothing_text">do nothing you are not online for instant upload</string>
|
||||
<string name="failed_upload_failure_text">Failure Message: </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>
|
||||
</resources>
|
||||
|
|
|
@ -75,7 +75,6 @@ import com.owncloud.android.lib.operations.common.RemoteOperation;
|
|||
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.operations.common.ShareType;
|
||||
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
|
||||
|
||||
import com.owncloud.android.operations.CreateShareOperation;
|
||||
import com.owncloud.android.operations.RemoveFileOperation;
|
||||
import com.owncloud.android.operations.RenameFileOperation;
|
||||
|
@ -1347,6 +1346,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
} else if (operation instanceof CreateFolderOperation) {
|
||||
onCreateFolderOperationFinish((CreateFolderOperation)operation, result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1572,9 +1572,21 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
|
||||
|
||||
public void shareFileWithLink(OCFile file) {
|
||||
|
||||
if (isSharedSupported()) {
|
||||
// Create the Share
|
||||
CreateShareOperation createShare = new CreateShareOperation(file.getRemotePath(), ShareType.PUBLIC_LINK, "", false, "", 1);
|
||||
createShare.execute(getStorageManager(), this, this, mHandler, this);
|
||||
|
||||
|
||||
// TODO
|
||||
// Get the link --> when the operation is finished
|
||||
|
||||
} else {
|
||||
// Show a Message
|
||||
Toast t = Toast.makeText(this, getString(R.string.share_link_no_support_share_api), Toast.LENGTH_LONG);
|
||||
t.show();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue