From b5199fff882416f86db57cb65b3937b18b1c9655 Mon Sep 17 00:00:00 2001 From: Vishal Nehra Date: Mon, 10 Apr 2023 01:43:50 +0530 Subject: [PATCH] 3733: Refactor code --- .../amaze/filemanager/filesystem/files/FileUtils.java | 11 ++++++----- gradle.properties | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/amaze/filemanager/filesystem/files/FileUtils.java b/app/src/main/java/com/amaze/filemanager/filesystem/files/FileUtils.java index ddead630b6..d55e7f09b3 100644 --- a/app/src/main/java/com/amaze/filemanager/filesystem/files/FileUtils.java +++ b/app/src/main/java/com/amaze/filemanager/filesystem/files/FileUtils.java @@ -395,15 +395,16 @@ public static void shareFiles( ArrayList uris = new ArrayList<>(); boolean isGenericFileType = false; - String mime = files.size() > 1 ? MimeTypes.getMimeType(files.get(0).getPath(), - files.get(0).isDirectory()) : null; + String mime = + files.size() > 1 + ? MimeTypes.getMimeType(files.get(0).getPath(), files.get(0).isDirectory()) + : null; for (File f : files) { uris.add(FileProvider.getUriForFile(activity, activity.getPackageName(), f)); - if (mime == null - || !mime.equals(MimeTypes.getMimeType(f.getPath(), f.isDirectory()))) { + if (!isGenericFileType + && (mime == null || !mime.equals(MimeTypes.getMimeType(f.getPath(), f.isDirectory())))) { isGenericFileType = true; - break; } } diff --git a/gradle.properties b/gradle.properties index 31554fde00..43a38b9251 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,4 +20,6 @@ org.gradle.jvmargs=-Xmx4608M -XX:+UseParallelGC org.gradle.parallel=true # https://github.com/usefulness/easylauncher-gradle-plugin/issues/408 -android.disableResourceValidation=true \ No newline at end of file +android.disableResourceValidation=true +# for macs, omit for other operating systems +#org.gradle.java.home=/Applications/Android Studio.app/Contents/jre/Contents/Home \ No newline at end of file