forked from hardcoresushi/DroidFS
Bug fix on last image deletion
This commit is contained in:
parent
e5413653d0
commit
4378c962fc
@ -124,13 +124,25 @@ class ImageViewer: FileViewerActivity() {
|
||||
}
|
||||
wasMapped = true
|
||||
}
|
||||
currentMappedImageIndex = if (deltaX < 0){
|
||||
MiscUtils.incrementIndex(currentMappedImageIndex, mappedImages)
|
||||
if (mappedImages.size == 0){ //can happen on deleting images
|
||||
ColoredAlertDialogBuilder(this)
|
||||
.keepFullScreen()
|
||||
.setTitle(R.string.error)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.ok) { _, _ ->
|
||||
goBackToExplorer()
|
||||
}
|
||||
.setMessage(R.string.no_more_images)
|
||||
.show()
|
||||
} else {
|
||||
MiscUtils.decrementIndex(currentMappedImageIndex, mappedImages)
|
||||
currentMappedImageIndex = if (deltaX < 0){
|
||||
MiscUtils.incrementIndex(currentMappedImageIndex, mappedImages)
|
||||
} else {
|
||||
MiscUtils.decrementIndex(currentMappedImageIndex, mappedImages)
|
||||
}
|
||||
filePath = mappedImages[currentMappedImageIndex].fullPath
|
||||
loadImage()
|
||||
}
|
||||
filePath = mappedImages[currentMappedImageIndex].fullPath
|
||||
loadImage()
|
||||
}
|
||||
|
||||
fun onClickDelete(view: View) {
|
||||
|
@ -179,4 +179,5 @@
|
||||
<string name="error_cipher_null">Error cipher is null</string>
|
||||
<string name="key_permanently_invalidated_exception">KeyPermanentlyInvalidatedException</string>
|
||||
<string name="key_permanently_invalidated_exception_msg">It looks like you have added a new fingerprint. Saved passwords hash have become unusable.</string>
|
||||
<string name="no_more_images">No more images found.</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user