Skip to content

Commit

Permalink
fix: Ktlint reports fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitorbp committed Aug 21, 2024
1 parent 66d991c commit 7d67070
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
binding.explanation.visibility = View.INVISIBLE
supportActionBar?.setDisplayHomeAsUpEnabled(false) //Don´t show the back arrow
}

ACTION_CREATE -> { //Create a new password
if (confirmingPassCode) {
//the app was in the passcode confirmation
Expand All @@ -138,22 +139,26 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
intent.extras?.getBoolean(EXTRAS_MIGRATION) == true -> {
supportActionBar?.setDisplayHomeAsUpEnabled(false)
}

intent.extras?.getBoolean(EXTRAS_LOCK_ENFORCED) == true -> {
supportActionBar?.setDisplayHomeAsUpEnabled(false)
}

else -> {
supportActionBar?.setDisplayHomeAsUpEnabled(true)
}
}
}
}

ACTION_REMOVE -> { // Remove password
// pass code preference has just been disabled in Preferences;
// will confirm user knows pass code, then remove it
binding.header.text = getString(R.string.pass_code_remove_your_pass_code)
binding.explanation.visibility = View.INVISIBLE
supportActionBar?.setDisplayHomeAsUpEnabled(true)
}

else -> {
throw IllegalArgumentException(R.string.illegal_argument_exception_message.toString() + " ")
}
Expand Down Expand Up @@ -233,12 +238,14 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
else -> actionCheckError()
}
}

PasscodeAction.REMOVE -> {
when (status.type) {
PasscodeType.OK -> actionRemoveOk()
else -> actionRemoveError()
}
}

PasscodeAction.CREATE -> {
when (status.type) {
PasscodeType.NO_CONFIRM -> actionCreateNoConfirm()
Expand Down Expand Up @@ -423,6 +430,7 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
BiometricStatus.ENABLED_BY_USER -> {
passCodeViewModel.setBiometricsState(enabled = true)
}

BiometricStatus.DISABLED_BY_USER -> {
passCodeViewModel.setBiometricsState(enabled = false)
}
Expand All @@ -436,9 +444,11 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
ACTION_REMOVE -> {
return PasscodeAction.REMOVE
}

ACTION_CREATE -> {
return PasscodeAction.CREATE
}

else -> {
return PasscodeAction.CHECK
}
Expand All @@ -451,12 +461,14 @@ class PassCodeActivity : AppCompatActivity(), NumberKeyboardListener, EnableBiom
findViewById<View>(R.id.lock_time).requestFocus()
true
}

KeyEvent.KEYCODE_DPAD_DOWN -> {
if (!findViewById<View>(R.id.numberKeyboard).hasFocus()){
if (!findViewById<View>(R.id.numberKeyboard).hasFocus()) {
findViewById<View>(R.id.numberKeyboard).requestFocus()
}
true
}

else -> super.onKeyUp(keyCode, event)
}
}
Expand Down

0 comments on commit 7d67070

Please sign in to comment.