Clean up PDFViewerActivity for consistency
This commit is contained in:
parent
4d0a7121cc
commit
85559abbf4
|
@ -110,15 +110,19 @@ class PDFViewerActivity : SimpleActivity() {
|
||||||
.onTap { toggleFullScreen() }
|
.onTap { toggleFullScreen() }
|
||||||
.onError {
|
.onError {
|
||||||
if (it is PdfPasswordException) {
|
if (it is PdfPasswordException) {
|
||||||
// Already entered a password and it was wrong
|
// already entered a password and it was wrong
|
||||||
if (filePassword != null) {
|
if (filePassword != null) {
|
||||||
showErrorToast(getString(R.string.invalid_password))
|
showErrorToast(getString(R.string.invalid_password))
|
||||||
finish()
|
finish()
|
||||||
} else {
|
} else {
|
||||||
EnterPasswordDialog(
|
EnterPasswordDialog(
|
||||||
this,
|
this,
|
||||||
callback = { password -> loadPdfViewer(uri, password) },
|
callback = { password ->
|
||||||
cancelCallback = { finish() }
|
loadPdfViewer(uri, password)
|
||||||
|
},
|
||||||
|
cancelCallback = {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue