瀏覽代碼

fix codacy

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 10 月之前
父節點
當前提交
72f86fce20

+ 4 - 2
app/src/main/java/com/owncloud/android/ui/adapter/OCShareToOCFileConverter.kt

@@ -16,11 +16,13 @@ object OCShareToOCFileConverter {
     private const val MILLIS_PER_SECOND = 1000
 
     /**
-     * Generates a list of incomplete [OCFile] from a list of [OCShare]. Retrieving OCFile directly by path may fail in cases like
+     * Generates a list of incomplete [OCFile] from a list of [OCShare]. Retrieving OCFile directly by path may fail
+     * in cases like
      * when a shared file is located at a/b/c/d/a.txt. To display a.txt in the shared tab, the device needs the OCFile.
      * On first launch, the app may not be aware of the file until the exact path is accessed.
      *
-     * Server implementation needed to get file size, thumbnails e.g. : <a href="https://github.com/nextcloud/server/issues/4456g</a>.
+     * Server implementation needed to get file size, thumbnails e.g. :
+     * <a href="https://github.com/nextcloud/server/issues/4456g</a>.
      *
      * Note: This works only for files shared *by* the user, not files shared *with* the user.
      */

+ 10 - 12
app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -1139,18 +1139,16 @@ public class OCFileListFragment extends ExtendedListFragment implements
                 Log_OC.d(TAG, "no public key for " + user.getAccountName());
 
                 FragmentManager fragmentManager = getParentFragmentManager();
-                if (fragmentManager.findFragmentByTag(SETUP_ENCRYPTION_DIALOG_TAG) == null) {
-                    if (requireActivity() instanceof FileActivity fileActivity) {
-                        fileActivity.connectivityService.isNetworkAndServerAvailable(result -> {
-                            if (result) {
-                                SetupEncryptionDialogFragment dialog = SetupEncryptionDialogFragment.newInstance(user, position);
-                                dialog.setTargetFragment(this, SETUP_ENCRYPTION_REQUEST_CODE);
-                                dialog.show(fragmentManager, SETUP_ENCRYPTION_DIALOG_TAG);
-                            } else {
-                                DisplayUtils.showSnackMessage(fileActivity, R.string.encrypted_folder_setup_no_internet_error);
-                            }
-                        });
-                    }
+                if (fragmentManager.findFragmentByTag(SETUP_ENCRYPTION_DIALOG_TAG) == null && requireActivity() instanceof FileActivity fileActivity) {
+                    fileActivity.connectivityService.isNetworkAndServerAvailable(result -> {
+                        if (result) {
+                            SetupEncryptionDialogFragment dialog = SetupEncryptionDialogFragment.newInstance(user, position);
+                            dialog.setTargetFragment(this, SETUP_ENCRYPTION_REQUEST_CODE);
+                            dialog.show(fragmentManager, SETUP_ENCRYPTION_DIALOG_TAG);
+                        } else {
+                            DisplayUtils.showSnackMessage(fileActivity, R.string.encrypted_folder_setup_no_internet_error);
+                        }
+                    });
                 }
             }
         } else {