Skip to content

Commit

Permalink
removing some redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
tibbi authored May 18, 2021
1 parent 78e5ed3 commit ffb1f73
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ffb1f73

Please sign in to comment.