Skip to content

Commit

Permalink
Fix image video preview
Browse files Browse the repository at this point in the history
  • Loading branch information
ismartcoding committed Aug 10, 2023
1 parent 2d71c8f commit 995e54e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
16 changes: 8 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 2 additions & 8 deletions app/src/main/java/com/ismartcoding/plain/ui/file/FilesDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,10 @@ class FilesDialog : BaseDialog<DialogFilesBinding>() {
val m = getModel<FileModel>()
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<FileModel>()
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<FileModel>()
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()) {
Expand Down
8 changes: 4 additions & 4 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 995e54e

Please sign in to comment.