summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-07-29 13:06:22 +0530
committerGitHub <noreply@github.com>2020-07-29 09:36:22 +0200
commitecf96aa0668a758b2408284facda41ac70fe10aa (patch)
tree4d8bffdcbe9bab1448efdb839193ac8991448eeb /app/src/main/java
parenta3b6bf954f4654a72c159a0783f17ef90f189d47 (diff)
Fix TOTP import button check semantics (#982)
* Improve TOTP checking semantics Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Fix return label Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * update CHANGELOG Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Move updateViewState() call outside with(binding) scope Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
index 45bde491..12d24758 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
@@ -177,13 +177,11 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
extraContent.setText(entry.extraContentWithoutAuthData)
}
}
- updateViewState()
}
}
listOf(filename, extraContent).forEach {
it.doOnTextChanged { _, _, _, _ -> updateViewState() }
}
- updateViewState()
}
suggestedPass?.let {
password.setText(it)
@@ -195,6 +193,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
password.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
}
}
+ updateViewState()
}
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
@@ -235,7 +234,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
val entry = PasswordEntry("PLACEHOLDER\n${extraContent.text}")
encryptUsername.apply {
if (visibility != View.VISIBLE)
- return@with
+ return@apply
val hasUsernameInFileName = filename.text.toString().isNotBlank()
val hasUsernameInExtras = entry.hasUsername()
isEnabled = hasUsernameInFileName xor hasUsernameInExtras
@@ -424,8 +423,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
AutofillPreferences.directoryStructure(applicationContext)
val entry = PasswordEntry(content)
returnIntent.putExtra(RETURN_EXTRA_PASSWORD, entry.password)
- val username = PasswordEntry(content).username
- ?: directoryStructure.getUsernameFor(file)
+ val username = entry.username ?: directoryStructure.getUsernameFor(file)
returnIntent.putExtra(RETURN_EXTRA_USERNAME, username)
}