From 995e54e00d47496a88485cf7842880cc02eaea68 Mon Sep 17 00:00:00 2001 From: iSmartCoding Date: Thu, 10 Aug 2023 14:06:36 +0800 Subject: [PATCH] Fix image video preview --- app/build.gradle.kts | 16 ++++++++-------- .../ismartcoding/plain/ui/file/FilesDialog.kt | 10 ++-------- lib/build.gradle.kts | 8 ++++---- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d54c5558..4f45bed0 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -55,14 +55,14 @@ android { } buildTypes { - debug { - isShrinkResources = true - isMinifyEnabled = true - ndk { - debugSymbolLevel = "SYMBOL_TABLE" - } - setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) - } +// debug { +// isShrinkResources = true +// isMinifyEnabled = true +// ndk { +// debugSymbolLevel = "SYMBOL_TABLE" +// } +// setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")) +// } release { signingConfig = signingConfigs.getByName("release") isShrinkResources = true diff --git a/app/src/main/java/com/ismartcoding/plain/ui/file/FilesDialog.kt b/app/src/main/java/com/ismartcoding/plain/ui/file/FilesDialog.kt index a5078524..68a7fa8b 100644 --- a/app/src/main/java/com/ismartcoding/plain/ui/file/FilesDialog.kt +++ b/app/src/main/java/com/ismartcoding/plain/ui/file/FilesDialog.kt @@ -129,16 +129,10 @@ class FilesDialog : BaseDialog() { val m = getModel() if (m.data.isDir) { navigateTo(m.data.path) - } else if (m.data.path.isVideoFast()) { + } else if (m.data.path.isVideoFast() || m.data.path.isImageFast()) { val items = getModelList() PreviewDialog().show( - items = items.filter { !it.data.isDir && it.data.path.isVideoFast() }.map { s -> PreviewItem(s.data.path, s.data.path) }, - initKey = m.data.path, - ) - } else if (m.data.path.isImageFast()) { - val items = getModelList() - PreviewDialog().show( - items = items.filter { !it.data.isDir && it.data.path.isImageFast() }.map { s -> PreviewItem(s.data.path, s.data.path) }, + items = items.filter { !it.data.isDir && (it.data.path.isVideoFast() || it.data.path.isImageFast()) }.map { s -> PreviewItem(s.data.path, s.data.path) }, initKey = m.data.path, ) } else if (m.data.path.isAudioFast()) { diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 6ffd4058..caa1bfe6 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -14,10 +14,10 @@ android { } buildTypes { - debug { - isMinifyEnabled = true - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") - } +// debug { +// isMinifyEnabled = true +// proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") +// } release { isMinifyEnabled = true proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")