diff --git a/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ImagePreviewActivity.kt b/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ImagePreviewActivity.kt index 7834f891..f44a24f8 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ImagePreviewActivity.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ImagePreviewActivity.kt @@ -203,7 +203,17 @@ class ImagePreviewActivity : BaseActivity(), ImagePreviewView, ConfirmDeleteClou override fun onImageDeleted(index: Int) { imagePreviewSliderAdapter.deletePage(index) - updateTitle(index) + + presenter.pageIndexes.size.let { + when { + it == 0 -> { + showMessage(getString(R.string.dialog_no_more_images_to_display )) + finish() + } + it > index -> updateTitle(index) + it <= index -> updateTitle(index - 1) + } + } } private fun setControlViewVisibility(visibility: Int) { diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 9059d03e..f7532163 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -433,6 +433,8 @@ Beta release This is a beta release which introduces the support of vault format 7. Please make sure that you don\'t use your production vault for testing or have a good backup strategy. + No more images to display… + Cryptomator needs storage access to use local vaults Cryptomator needs storage access to use auto photo upload