Removed unnecessary isRemoveAppProtectionLayout parameter

This commit is contained in:
dankito 2020-10-07 20:52:17 +02:00
parent 26baf222d6
commit e345d6d6cb
1 changed files with 5 additions and 5 deletions

View File

@ -70,20 +70,20 @@ open class ProtectAppSettingsDialog : SettingsDialogBase() {
btnShowBiometricAuthenticationSection.visibility = if (isBiometricAuthenticationSupported) View.VISIBLE else View.GONE btnShowBiometricAuthenticationSection.visibility = if (isBiometricAuthenticationSupported) View.VISIBLE else View.GONE
btnShowBiometricAuthenticationSection.setOnCheckedChangeListener { _, isChecked -> btnShowBiometricAuthenticationSection.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) { if (isChecked) {
showAuthenticationLayout(rootView, lytBiometricAuthentication, false) showAuthenticationLayout(rootView, lytBiometricAuthentication)
} }
} }
btnShowPasswordAuthenticationSection.setOnCheckedChangeListener { _, isChecked -> btnShowPasswordAuthenticationSection.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) { if (isChecked) {
showAuthenticationLayout(rootView, lytPasswordAuthentication, false) showAuthenticationLayout(rootView, lytPasswordAuthentication)
checkIfEnteredPasswordsMatch() checkIfEnteredPasswordsMatch()
} }
} }
btnShowRemoveAppProtectionSection.setOnCheckedChangeListener { _, isChecked -> btnShowRemoveAppProtectionSection.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) { if (isChecked) {
showAuthenticationLayout(rootView, lytRemoveAppProtection, true) showAuthenticationLayout(rootView, lytRemoveAppProtection)
} }
} }
@ -106,14 +106,14 @@ open class ProtectAppSettingsDialog : SettingsDialogBase() {
} }
} }
protected open fun showAuthenticationLayout(rootView: View, authenticationLayoutToShow: ViewGroup, isRemoveAppProtectionLayout: Boolean) { protected open fun showAuthenticationLayout(rootView: View, authenticationLayoutToShow: ViewGroup) {
lytBiometricAuthentication.visibility = View.GONE lytBiometricAuthentication.visibility = View.GONE
lytPasswordAuthentication.visibility = View.GONE lytPasswordAuthentication.visibility = View.GONE
lytRemoveAppProtection.visibility = View.GONE lytRemoveAppProtection.visibility = View.GONE
authenticationLayoutToShow.visibility = View.VISIBLE authenticationLayoutToShow.visibility = View.VISIBLE
if (isRemoveAppProtectionLayout) { if (authenticationLayoutToShow == lytRemoveAppProtection) {
btnSetAuthenticationMethod.setText(R.string.dialog_protect_app_settings_button_remove_app_protection_title) btnSetAuthenticationMethod.setText(R.string.dialog_protect_app_settings_button_remove_app_protection_title)
btnSetAuthenticationMethod.setBackgroundResource(R.color.destructiveColor) btnSetAuthenticationMethod.setBackgroundResource(R.color.destructiveColor)
btnSetAuthenticationMethod.isEnabled = true btnSetAuthenticationMethod.isEnabled = true