Skip to content

Commit

Permalink
Rename TextListener to PasswordTextListener
Browse files Browse the repository at this point in the history
  • Loading branch information
nain-F49FF806 committed Dec 7, 2024
1 parent 0def953 commit 37b1dd3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class ChangePasswordDialog(activity: Activity, lockStore: LockStore, onSuccess:
private fun buildTextListener(
passwordField: EditText, repeatField: EditText,
positiveBtn: Button
): TextListener {
return TextListener {
): PasswordTextListener {
return PasswordTextListener {
val passwordValue = passwordField.text.toString()
val repeatValue = repeatField.text.toString()
if (passwordValue.length < MIN_PASSWORD_LENGTH) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package alt.nainapps.aer.config.password
import android.text.Editable
import android.text.TextWatcher

fun interface TextListener : TextWatcher {
fun interface PasswordTextListener : TextWatcher {
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class SetPasswordDialog(activity: Activity, lockStore: LockStore, onSuccess: Run
private fun buildValidator(
passwordField: EditText, repeatField: EditText,
positiveBtn: Button
): TextListener {
return TextListener {
): PasswordTextListener {
return PasswordTextListener {
val passwordValue = passwordField.text.toString()
val repeatValue = repeatField.text.toString()
if (passwordValue.length < MIN_PASSWORD_LENGTH) {
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/alt/nainapps/aer/lock/UnlockActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
*/
package alt.nainapps.aer.lock

import alt.nainapps.aer.R
import alt.nainapps.aer.config.ConfigurationActivity
import alt.nainapps.aer.config.password.PasswordTextListener
import alt.nainapps.aer.lock.LockStore.Companion.getInstance
import alt.nainapps.aer.shell.LauncherActivity
import android.app.Activity
import android.content.DialogInterface
import android.content.Intent
Expand All @@ -15,11 +20,6 @@ import android.widget.Button
import android.widget.EditText
import android.widget.ImageView
import androidx.annotation.RequiresApi
import alt.nainapps.aer.R
import alt.nainapps.aer.config.ConfigurationActivity
import alt.nainapps.aer.config.password.TextListener
import alt.nainapps.aer.lock.LockStore.Companion.getInstance
import alt.nainapps.aer.shell.LauncherActivity

class UnlockActivity : Activity() {
private var lockStore: LockStore? = null
Expand Down Expand Up @@ -50,7 +50,7 @@ class UnlockActivity : Activity() {
val unlockBtn = findViewById<Button>(R.id.unlockButton)
val cancelBtn = findViewById<Button>(R.id.cancelButton)

passwordField.addTextChangedListener(TextListener { text: String? ->
passwordField.addTextChangedListener(PasswordTextListener { text: String? ->
unlockBtn.isEnabled = passwordField.text.length >= MIN_PASSWORD_LENGTH
})

Expand Down

0 comments on commit 37b1dd3

Please sign in to comment.