diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 6e485b6..55d73bb 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/.idea/misc.xml b/.idea/misc.xml index c0f68ed..99202cc 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -25,7 +25,7 @@ - + diff --git a/app/build.gradle b/app/build.gradle index 82755b6..dcb32be 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "ca.pkay.rcloneexplorer" minSdkVersion 21 targetSdkVersion 27 - versionCode 18 - versionName "1.3.2-DEV" + versionCode 19 + versionName "1.3.3-DEV" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/assets/changelog.md b/app/src/main/assets/changelog.md index 1fb2920..cb208ba 100644 --- a/app/src/main/assets/changelog.md +++ b/app/src/main/assets/changelog.md @@ -1,3 +1,11 @@ +### 1.3.3 +* **Fix:** Infinite loading for directories with large number of files +* **Fix:** Open as not working +* **Fix:** App launching behaviour +* **Fix:** Theme of password dialog + +*** + ### 1.3.2 * **New:** File options for individual files * **New:** Generate public link to file/folder (rclone link) diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png deleted file mode 100644 index a756346..0000000 Binary files a/app/src/main/ic_launcher-web.png and /dev/null differ diff --git a/app/src/main/ic_shortcut_onedrive-web.png b/app/src/main/ic_shortcut_onedrive-web.png deleted file mode 100644 index b135789..0000000 Binary files a/app/src/main/ic_shortcut_onedrive-web.png and /dev/null differ diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/Fragments/FileExplorerFragment.java b/app/src/main/java/ca/pkay/rcloneexplorer/Fragments/FileExplorerFragment.java index 3c7b69f..6636703 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/Fragments/FileExplorerFragment.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/Fragments/FileExplorerFragment.java @@ -478,21 +478,15 @@ private void showOpenAsDialog(final FileItem fileItem) { .setOnClickListener(new OpenAsDialog.OnClickListener() { @Override public void onClickText() { - if (recyclerViewAdapter.getNumberOfSelectedItems() == 1) { - new DownloadAndOpen(DownloadAndOpen.OPEN_AS_TEXT).execute(fileItem); - } + new DownloadAndOpen(DownloadAndOpen.OPEN_AS_TEXT).execute(fileItem); } @Override public void onClickAudio() { - if (recyclerViewAdapter.getNumberOfSelectedItems() == 1) { - new StreamTask(StreamTask.OPEN_AS_AUDIO).execute(fileItem); - } + new StreamTask(StreamTask.OPEN_AS_AUDIO).execute(fileItem); } @Override public void onClickVideo() { - if (recyclerViewAdapter.getNumberOfSelectedItems() == 1) { - new StreamTask(StreamTask.OPEN_AS_VIDEO).execute(fileItem); - } + new StreamTask(StreamTask.OPEN_AS_VIDEO).execute(fileItem); } @Override public void onClickImage() { diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/MainActivity.java b/app/src/main/java/ca/pkay/rcloneexplorer/MainActivity.java index f342a90..44b27fa 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/MainActivity.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/MainActivity.java @@ -331,6 +331,7 @@ private void askForConfigPassword() { .setMessage(R.string.please_enter_password) .setNegativeButton(R.string.cancel) .setPositiveButton(R.string.okay_confirmation) + .setDarkTheme(isDarkTheme) .setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) .setOnPositiveListener(new InputDialog.OnPositive() { @Override diff --git a/app/src/main/java/ca/pkay/rcloneexplorer/Rclone.java b/app/src/main/java/ca/pkay/rcloneexplorer/Rclone.java index abb7f35..792c3b6 100644 --- a/app/src/main/java/ca/pkay/rcloneexplorer/Rclone.java +++ b/app/src/main/java/ca/pkay/rcloneexplorer/Rclone.java @@ -111,11 +111,6 @@ public List getDirectoryContent(String remote, String path) { Process process; try { process = Runtime.getRuntime().exec(command); - process.waitFor(); - if (process.exitValue() != 0) { - logErrorOutput(process); - return null; - } BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; @@ -124,6 +119,12 @@ public List getDirectoryContent(String remote, String path) { output.append(line); } + process.waitFor(); + if (process.exitValue() != 0) { + logErrorOutput(process); + return null; + } + results = new JSONArray(output.toString()); } catch (IOException | InterruptedException | JSONException e) { @@ -159,12 +160,6 @@ public List getRemotes() { JSONObject remotesJSON; try { process = Runtime.getRuntime().exec(command); - process.waitFor(); - if (process.exitValue() != 0) { - Toasty.error(context, context.getString(R.string.error_getting_remotes), Toast.LENGTH_SHORT, true).show(); - logErrorOutput(process); - return new ArrayList<>(); - } BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; @@ -172,6 +167,13 @@ public List getRemotes() { output.append(line); } + process.waitFor(); + if (process.exitValue() != 0) { + Toasty.error(context, context.getString(R.string.error_getting_remotes), Toast.LENGTH_SHORT, true).show(); + logErrorOutput(process); + return new ArrayList<>(); + } + remotesJSON = new JSONObject(output.toString()); } catch (IOException | InterruptedException | JSONException e) { Toasty.error(context, context.getString(R.string.error_getting_remotes), Toast.LENGTH_SHORT, true).show(); @@ -574,14 +576,10 @@ public Boolean decryptConfig(String password) { try { process = Runtime.getRuntime().exec(command, environmentalVars); - process.waitFor(); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { e.printStackTrace(); return false; } - if (process.exitValue() != 0) { - return false; - } ArrayList result = new ArrayList<>(); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); @@ -595,6 +593,17 @@ public Boolean decryptConfig(String password) { return false; } + try { + process.waitFor(); + } catch (InterruptedException e) { + e.printStackTrace(); + return false; + } + + if (process.exitValue() != 0) { + return false; + } + String appsFileDir = context.getFilesDir().getPath(); File file = new File(appsFileDir, "rclone.conf");