#275 when deleting the last image using preview jump to vault content

As well as fixing a logged IndexOutOfBoundsException when deleting the image with the last indices from the list.
This commit is contained in:
Julian Raufelder 2021-02-24 15:09:16 +01:00
parent bd36b4d337
commit d8d4c6f9e7
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D
2 changed files with 13 additions and 1 deletions

View File

@ -203,7 +203,17 @@ class ImagePreviewActivity : BaseActivity(), ImagePreviewView, ConfirmDeleteClou
override fun onImageDeleted(index: Int) { override fun onImageDeleted(index: Int) {
imagePreviewSliderAdapter.deletePage(index) 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) { private fun setControlViewVisibility(visibility: Int) {

View File

@ -433,6 +433,8 @@
<string name="dialog_beta_confirmation_title">Beta release</string> <string name="dialog_beta_confirmation_title">Beta release</string>
<string name="dialog_beta_confirmation">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.</string> <string name="dialog_beta_confirmation">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.</string>
<string name="dialog_no_more_images_to_display">No more images to display&#8230;</string>
<string name="permission_snackbar_auth_local_vault">Cryptomator needs storage access to use local vaults</string> <string name="permission_snackbar_auth_local_vault">Cryptomator needs storage access to use local vaults</string>
<string name="permission_snackbar_auth_auto_upload">Cryptomator needs storage access to use auto photo upload</string> <string name="permission_snackbar_auth_auto_upload">Cryptomator needs storage access to use auto photo upload</string>