Save checkbox state if opening volume fails
This commit is contained in:
parent
e00abdf5bb
commit
b6b8bba666
@ -520,10 +520,12 @@ class MainActivity : BaseActivity(), VolumeAdapter.Listener {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun askForPassword(volume: Volume, position: Int) {
|
private fun askForPassword(volume: Volume, position: Int, savePasswordHash: Boolean = false) {
|
||||||
val dialogBinding = DialogOpenVolumeBinding.inflate(layoutInflater)
|
val dialogBinding = DialogOpenVolumeBinding.inflate(layoutInflater)
|
||||||
if (!usfFingerprint || fingerprintProtector == null || volume.encryptedHash != null) {
|
if (!usfFingerprint || fingerprintProtector == null || volume.encryptedHash != null) {
|
||||||
dialogBinding.checkboxSavePassword.visibility = View.GONE
|
dialogBinding.checkboxSavePassword.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
dialogBinding.checkboxSavePassword.isChecked = savePasswordHash
|
||||||
}
|
}
|
||||||
dialogBinding.checkboxDefaultOpen.isChecked = defaultVolumeName == volume.name
|
dialogBinding.checkboxDefaultOpen.isChecked = defaultVolumeName == volume.name
|
||||||
val dialog = CustomAlertDialogBuilder(this, themeValue)
|
val dialog = CustomAlertDialogBuilder(this, themeValue)
|
||||||
@ -594,7 +596,7 @@ class MainActivity : BaseActivity(), VolumeAdapter.Listener {
|
|||||||
.setMessage(R.string.open_volume_failed_msg)
|
.setMessage(R.string.open_volume_failed_msg)
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, null)
|
||||||
.setOnDismissListener {
|
.setOnDismissListener {
|
||||||
askForPassword(volume, position)
|
askForPassword(volume, position, savePasswordHash)
|
||||||
}
|
}
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user