removing some redundant code

This commit is contained in:
Tibor Kaputa 2021-05-18 17:41:09 +02:00 committed by GitHub
parent 78e5ed3b5c
commit ffb1f7368b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 12 deletions

View File

@ -119,21 +119,11 @@ class SettingsActivity : SimpleActivity() {
private fun setupPressBackTwice() {
settings_press_back_twice.isChecked = config.pressBackTwice
settings_press_back_twice_holder.setOnClickListener {
if (config.pressBackTwice) {
togglePressBackTwice()
} else {
handleHiddenFolderPasswordProtection {
togglePressBackTwice()
}
}
settings_press_back_twice.toggle()
config.pressBackTwice = settings_press_back_twice.isChecked
}
}
private fun togglePressBackTwice() {
settings_press_back_twice.toggle()
config.pressBackTwice = settings_press_back_twice.isChecked
}
private fun setupHiddenItemPasswordProtection() {
settings_password_protection.isChecked = config.isHiddenPasswordProtectionOn
settings_password_protection_holder.setOnClickListener {