Skip to content

Commit

Permalink
Merge pull request leonlatsch#201 from leonlatsch/release/1.4.3
Browse files Browse the repository at this point in the history
Release: 1.4.3
  • Loading branch information
leonlatsch authored Jan 9, 2023
2 parents 93d895f + d504a5a commit 612a728
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .idea/copyright/Leon_Latsch.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020-2022 Leon Latsch
Copyright 2020-2023 Leon Latsch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Also available at **[IzzyOnDroid (F-Droid)](https://apt.izzysoft.de/fdroid/index

LICENSE
=======
Copyright 2020-2022 Leon Latsch
Copyright 2020-2023 Leon Latsch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,47 +76,53 @@ class PhotoViewHolder(
}

private fun loadPhoto() {
GlobalScope.launch(Dispatchers.IO) {
val photo = photoRepository.get(photoId)
try {
GlobalScope.launch(Dispatchers.IO) {
val photo = photoRepository.get(photoId)

val data = if (photo.type.isVideo) {
photoRepository.loadVideoPreview(photo)
} else {
photoRepository.loadPhoto(photo)
}
if (data == null) {
Timber.d("Error loading photo data for photo: $photoId")
return@launch
}

initUiElements(photo)

if (photo.type.isGif) {
onMain {
Glide.with(context)
.asGif()
.load(data)
.into(imageView)
}
} else {

val bitmap = if (photo.type.isVideo) {
Glide.with(context)
.asBitmap()
.load(data)
.submit()
.get()
val data = if (photo.type.isVideo) {
photoRepository.loadVideoPreview(photo)
} else {
normalizeExifOrientation(data)
photoRepository.loadPhoto(photo)
}
if (data == null) {
Timber.d("Error loading photo data for photo: $photoId")
return@launch
}

initUiElements(photo)

bitmap ?: return@launch
if (photo.type.isGif) {
onMain {
Glide.with(context)
.asGif()
.load(data)
.into(imageView)
}
} else {

onMain {
imageView.setImageBitmap(bitmap)
val bitmap = if (photo.type.isVideo) {
Glide.with(context)
.asBitmap()
.load(data)
.submit()
.get()
} else {
normalizeExifOrientation(data)
}

bitmap ?: return@launch

onMain {
imageView.setImageBitmap(bitmap)
}
}
}
} catch (e: Exception) {
Timber.d("Error loading your photo: $e")
return
}

}

private fun initUiElements(photo: Photo) = onMain {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<!-- COMMON -->
<string name="app_name">Photok</string>
<string name="common_copyright_notice">Copyright \u00A9 2020–2022 Leon Latsch</string>
<string name="common_copyright_notice">Copyright \u00A9 2020-2023 Leon Latsch</string>
<string name="common_slash">/</string>
<string name="common_percent">%</string>
<string name="common_pipe">|</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<!-- COMMON -->
<string name="app_name">Photok</string>
<string name="common_copyright_notice">Copyright \u00A9 2020–2022 Leon Latsch</string>
<string name="common_copyright_notice">Copyright \u00A9 2020-2023 Leon Latsch</string>
<string name="common_slash">/</string>
<string name="common_percent">%</string>
<string name="common_pipe">|</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<!-- COMMON -->
<string name="app_name">Photok</string>
<string name="common_copyright_notice">Copyright \u00A9 2020–2022 Leon Latsch</string>
<string name="common_copyright_notice">Copyright \u00A9 2020-2023 Leon Latsch</string>
<string name="common_slash">/</string>
<string name="common_percent">%</string>
<string name="common_pipe">|</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<!-- COMMON -->
<string name="app_name">Photok</string>
<string name="common_copyright_notice">Copyright \u00A9 2020–2022 Leon Latsch</string>
<string name="common_copyright_notice">Copyright \u00A9 2020-2023 Leon Latsch</string>
<string name="common_slash">/</string>
<string name="common_percent">%</string>
<string name="common_pipe">|</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<!-- COMMON -->
<string name="app_name">Photok</string>
<string name="common_copyright_notice">Direitos autorais \u00A9 2020–2022 Leon Latsch</string>
<string name="common_copyright_notice">Direitos autorais \u00A9 2020-2023 Leon Latsch</string>
<string name="common_slash">/</string>
<string name="common_percent">%</string>
<string name="common_pipe">|</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<!-- COMMON -->
<string name="app_name">Photok</string>
<string name="common_copyright_notice">版权所有 \u00A9 2020–2022 Leon Latsch</string>
<string name="common_copyright_notice">版权所有 \u00A9 2020-2023 Leon Latsch</string>
<string name="common_slash">/</string>
<string name="common_percent">%</string>
<string name="common_pipe">|</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<!-- COMMON -->
<string name="app_name">Photok</string>
<string name="common_copyright_notice">Copyright \u00A9 2020–2022 Leon Latsch</string>
<string name="common_copyright_notice">Copyright \u00A9 2020–2023 Leon Latsch</string>
<string name="common_slash">/</string>
<string name="common_percent">%</string>
<string name="common_pipe">|</string>
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#Sat Oct 08 14:39:42 UTC 2022
#Mon Jan 09 21:20:58 UTC 2023
kotlin.code.style=official
kapt.incremental.apt=true
android.databinding.incremental=true
appVersionName=1.4.2
appVersionName=1.4.3
org.gradle.jvmargs=-Xmx2048m
appVersionCode=23
appVersionCode=24
android.useAndroidX=true
android.enableJetifier=true

0 comments on commit 612a728

Please sign in to comment.