Skip to content

Commit 16159b3

Browse files
committed
Keep password dialog displayed until correct password is entered or cancelled
This requires updates to Simple-Commons to be merged first SimpleMobileTools/Simple-Commons#1725
1 parent 85559ab commit 16159b3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ android {
6464
}
6565

6666
dependencies {
67-
implementation 'com.github.SimpleMobileTools:Simple-Commons:db25f91be3'
67+
implementation 'com.github.esensar:Simple-Commons:26a4275f9b'
6868
implementation 'com.github.tibbi:AndroidPdfViewer:e6a533125b'
6969
implementation 'com.github.Stericson:RootTools:df729dcb13'
7070
implementation 'com.github.Stericson:RootShell:1.6'

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/PDFViewerActivity.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import kotlinx.android.synthetic.main.activity_pdf_viewer.top_shadow
2727
class PDFViewerActivity : SimpleActivity() {
2828
private var realFilePath = ""
2929
private var isFullScreen = false
30+
private var passwordDialog: EnterPasswordDialog? = null
3031

3132
override fun onCreate(savedInstanceState: Bundle?) {
3233
showTransparentTop = true
@@ -113,9 +114,9 @@ class PDFViewerActivity : SimpleActivity() {
113114
// already entered a password and it was wrong
114115
if (filePassword != null) {
115116
showErrorToast(getString(R.string.invalid_password))
116-
finish()
117+
passwordDialog?.clearPassword()
117118
} else {
118-
EnterPasswordDialog(
119+
passwordDialog = EnterPasswordDialog(
119120
this,
120121
callback = { password ->
121122
loadPdfViewer(uri, password)
@@ -130,6 +131,9 @@ class PDFViewerActivity : SimpleActivity() {
130131
finish()
131132
}
132133
}
134+
.onLoad {
135+
passwordDialog?.dismiss(notify = false)
136+
}
133137
.load()
134138

135139
showSystemUI(true)

0 commit comments

Comments
 (0)