From 8ef9e467dce4bd0189afd74f71b917e9ae9d6028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 9 May 2017 21:30:09 +0200 Subject: [PATCH] Fix sample code format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- developer_manual/android_library/examples.rst | 48 +++++++++---------- developer_manual/app/tutorial.rst | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/developer_manual/android_library/examples.rst b/developer_manual/android_library/examples.rst index 8167310c7..3b3d31af2 100644 --- a/developer_manual/android_library/examples.rst +++ b/developer_manual/android_library/examples.rst @@ -80,14 +80,14 @@ Code example private void startFolderCreation(String newFolderPath) { CreateRemoteFolderOperation createOperation = new CreateRemoteFolderOperation(newFolderPath, false); - createOperation.execute( mClient , this , mHandler); + createOperation.execute(mClient, this, mHandler); } @Override public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { if (operation instanceof CreateRemoteFolderOperation) { if (result.isSuccess()) { - // do your stuff here + // do your stuff here } } … @@ -107,7 +107,7 @@ Code example .. code-block:: java private void startReadRootFolder() { - ReadRemoteFolderOperation refreshOperation = new ReadRemoteFolderOperation(FileUtils.PATH_SEPARATOR);  + ReadRemoteFolderOperation refreshOperation = new ReadRemoteFolderOperation(FileUtils.PATH_SEPARATOR); // root folder refreshOperation.execute(mClient, this, mHandler); } @@ -164,7 +164,7 @@ Code example private void startRemoveFile(String filePath) { RemoveRemoteFileOperation removeOperation = new RemoveRemoteFileOperation(remotePath); - removeOperation.execute( mClient , this , mHandler); + removeOperation.execute(mClient, this, mHandler); } @Override @@ -197,7 +197,7 @@ Code example } @Override - public void onRemoteOperationFinish( RemoteOperation operation, RemoteOperationResult result) { + public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { if (operation instanceof DownloadRemoteFileOperation) { if (result.isSuccess()) { // do your stuff here @@ -206,7 +206,7 @@ Code example } @Override - public void onTransferProgress( long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileName) { + public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileName) { mHandler.post( new Runnable() { @Override public void run() { @@ -227,8 +227,8 @@ Code example .. code-block:: java - private void startUpload (File fileToUpload, String remotePath, String mimeType) { - UploadRemoteFileOperation uploadOperation = new UploadRemoteFileOperation( fileToUpload.getAbsolutePath(), remotePath, mimeType); + private void startUpload(File fileToUpload, String remotePath, String mimeType) { + UploadRemoteFileOperation uploadOperation = new UploadRemoteFileOperation(fileToUpload.getAbsolutePath(), remotePath, mimeType); uploadOperation.addDatatransferProgressListener(this); uploadOperation.execute(mClient, this, mHandler); } @@ -244,7 +244,7 @@ Code example @Override public void onTransferProgress(long progressRate, long totalTransferredSoFar, long totalToTransfer, String fileName) { - mHandler.post( new Runnable() { + mHandler.post(new Runnable() { @Override public void run() { // do your UI updates about progress here @@ -269,14 +269,14 @@ Code example private void startFileMove(String filePath, String newFilePath, boolean overwrite) { MoveRemoteFileOperation moveOperation = new MoveRemoteFileOperation(filePath, newFilePath, overwrite); - moveOperation.execute( mClient , this , mHandler); + moveOperation.execute(mClient, this, mHandler); } @Override public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { if (operation instanceof MoveRemoteFileOperation) { if (result.isSuccess()) { - // do your stuff here + // do your stuff here } } … @@ -295,16 +295,16 @@ Code example private void startAllSharesRetrieval() { GetRemoteSharesOperation getSharesOp = new GetRemoteSharesOperation(); - getSharesOp.execute( mClient , this , mHandler); + getSharesOp.execute(mClient, this, mHandler); } @Override - public void onRemoteOperationFinish( RemoteOperation operation, RemoteOperationResult result) { + public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { if (operation instanceof GetRemoteSharesOperation) { if (result.isSuccess()) { ArrayList< OCShare > shares = new ArrayList< OCShare >(); for (Object obj: result.getData()) { - shares.add(( OCShare) obj); + shares.add((OCShare) obj); } // do your stuff here } @@ -327,21 +327,21 @@ Code example private void startSharesRetrievalForFileOrFolder(String filePath, boolean getReshares) { GeteRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(filePath, getReshares, false); - operation.execute( mClient, this, mHandler); + operation.execute(mClient, this, mHandler); } private void startSharesRetrievalForFilesInFolder(String folderPath, boolean getReshares) { GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(folderPath, getReshares, true); - operation.execute( mClient, this, mHandler); + operation.execute(mClient, this, mHandler); } @Override - public void onRemoteOperationFinish( RemoteOperation operation, RemoteOperationResult result) { + public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { if (operation instanceof GetRemoteSharesForFileOperation) { if (result.isSuccess()) { ArrayList< OCShare > shares = new ArrayList< OCShare >(); for (Object obj: result.getData()) { - shares.add(( OCShare) obj); + shares.add((OCShare) obj); } // do your stuff here } @@ -367,7 +367,7 @@ Code example private void startCreationOfPublicShareForFile(String filePath, String password) { CreateRemoteShareOperation operation = new CreateRemoteShareOperation(filePath, ShareType.PUBLIC_LINK, "", false, password, 1); - operation.execute( mClient , this , mHandler); + operation.execute(mClient, this, mHandler); } private void startCreationOfGroupShareForFile(String filePath, String groupId) { @@ -381,10 +381,10 @@ Code example } @Override - public void onRemoteOperationFinish( RemoteOperation operation, RemoteOperationResult result) { + public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { if (operation instanceof CreateRemoteShareOperation) { if (result.isSuccess()) { - OCShare share = (OCShare) result.getData ().get(0); + OCShare share = (OCShare) result.getData().get(0); // do your stuff here } } @@ -405,14 +405,14 @@ Code example private void startShareRemoval(OCShare share) { RemoveRemoteShareOperation operation = new RemoveRemoteShareOperation((int) share.getIdRemoteShared()); - operation.execute( mClient, this, mHandler); + operation.execute(mClient, this, mHandler); } @Override - public void onRemoteOperationFinish( RemoteOperation operation, RemoteOperationResult result) { + public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { if (operation instanceof RemoveRemoteShareOperation) { if (result.isSuccess()) { - // do your stuff here + // do your stuff here } } } diff --git a/developer_manual/app/tutorial.rst b/developer_manual/app/tutorial.rst index e4dca9714..84fc75204 100644 --- a/developer_manual/app/tutorial.rst +++ b/developer_manual/app/tutorial.rst @@ -1045,7 +1045,7 @@ The template file **ownnotes/templates/part.navigation.php** contains the naviga