Skip to content

Commit

Permalink
[bug] Fix crash in Android Navigator: #412
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancoltech committed Dec 5, 2023
1 parent c7d14c1 commit 9067374
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ android {

dependencies {
//For local developments of arklib-android:
releaseImplementation "dev.arkbuilders:arklib:$ark_lib_version"
debugImplementation "dev.arkbuilders:arklib-debug:$ark_lib_version"
//def arklibVersion = '999'
def arklibVersion = '0.3.4-snapshot-crash-28'

// releaseImplementation "dev.arkbuilders:arklib:$ark_lib_version"
debugImplementation "dev.arkbuilders:arklib-debug:$arklibVersion"
implementation("dev.arkbuilders:components:$ark_components_version") {
exclude group: "dev.arkbuilders", module: "arklib"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ class TagLabeledNStorage(
override suspend fun init() {
val storage = locateStorage()
if (storage?.exists() == true) {
val json = Json.decodeFromStream<JsonTagLabeledN>(storage.inputStream())
tagLabeledAmount.putAll(json.data)
try {
val json = Json.decodeFromStream<JsonTagLabeledN>(storage.inputStream())
tagLabeledAmount.putAll(json.data)
} catch (exception: Exception) {
Timber.e("tuancoltech" + " TagLabeledNStorage.init exception: " + exception.message)
}

} else {
index.allIds()
.associateWith { tagsStorage.getTags(it) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import dev.arkbuilders.arklib.ResourceId
import dev.arkbuilders.arklib.data.meta.Metadata
import dev.arkbuilders.arklib.data.preview.PreviewLocator
import dev.arkbuilders.arklib.data.preview.PreviewStatus
import dev.arkbuilders.arklib.utils.ImageUtils.loadGlideZoomImage
import dev.arkbuilders.arklib.utils.ImageUtils.loadImage
import dev.arkbuilders.arklib.utils.ImageUtils.loadSubsamplingImage
import timber.log.Timber

Expand Down Expand Up @@ -95,7 +95,7 @@ class PreviewImageViewHolder(
}

val path = locator.fullscreen()
loadGlideZoomImage(id, path, ivZoom)
loadImage(id, path, ivZoom, false)
loadSubsamplingImage(path, ivSubsampling)
}

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,6 @@ allprojects {
maven { url "https://plugins.gradle.org/m2/" }
gradlePluginPortal()
maven { url 'https://jitpack.io' }
mavenLocal()
}
}

0 comments on commit 9067374

Please sign in to comment.