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 14, 2023
1 parent c7d14c1 commit 8c9fef2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<uses-permission
android:requiredFeature="@string/ark_file_picker_pick"
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />

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("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

0 comments on commit 8c9fef2

Please sign in to comment.