aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/dev/msfjarvis/aps/ui/crypto
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-06-09 13:51:29 +0530
committerGitHub <noreply@github.com>2022-06-09 13:51:29 +0530
commit426fc924fba28ec898681ad7f7010456554f061e (patch)
tree195eac25c605a89f4e239578d685928a64675ee0 /app/src/main/java/dev/msfjarvis/aps/ui/crypto
parentf968b21bf665975e17ad9b03bcff652000e96ec4 (diff)
downloadHardenedPass-426fc924fba28ec898681ad7f7010456554f061e.tar.gz
HardenedPass-426fc924fba28ec898681ad7f7010456554f061e.zip
Upgrade ktfmt (#1942)
* build-logic: upgrade ktfmt * all: reformat
Diffstat (limited to 'app/src/main/java/dev/msfjarvis/aps/ui/crypto')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt14
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivityV2.kt10
2 files changed, 14 insertions, 10 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt
index 113c3bb6..b1f11dfa 100644
--- a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt
@@ -274,7 +274,8 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
// Allow the user to quickly switch between storing the username as the filename or
// in the encrypted extras. This only makes sense if the directory structure is
// FileBased.
- if (suggestedName == null &&
+ if (
+ suggestedName == null &&
AutofillPreferences.directoryStructure(this@PasswordCreationActivity) ==
DirectoryStructure.FileBased
) {
@@ -418,9 +419,8 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
GpgIdentifier.fromString(line)
?: run {
// The line being empty means this is most likely an empty `.gpg-id`
- // file
- // we created. Skip the validation so we can make the user add a real
- // ID.
+ // file we created. Skip the validation so we can make the user add a
+ // real ID.
if (line.isEmpty()) return@run
if (line.removePrefix("0x").matches("[a-fA-F0-9]{8}".toRegex())) {
snackbar(message = resources.getString(R.string.short_key_ids_unsupported))
@@ -488,7 +488,8 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
// Additionally, if we were editing and the incoming and outgoing
// filenames differ, it means we renamed. Ensure that the target
// doesn't already exist to prevent an accidental overwrite.
- if ((!editing || (editing && suggestedName != file.nameWithoutExtension)) &&
+ if (
+ (!editing || (editing && suggestedName != file.nameWithoutExtension)) &&
file.exists()
) {
snackbar(message = getString(R.string.password_creation_duplicate_error))
@@ -535,7 +536,8 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
returnIntent.putExtra(RETURN_EXTRA_USERNAME, username)
}
- if (directoryInputLayout.isVisible &&
+ if (
+ directoryInputLayout.isVisible &&
directoryInputLayout.isEnabled &&
oldFileName != null
) {
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivityV2.kt b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivityV2.kt
index b435b6e7..5792c892 100644
--- a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivityV2.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivityV2.kt
@@ -204,7 +204,8 @@ class PasswordCreationActivityV2 : BasePgpActivity() {
// Allow the user to quickly switch between storing the username as the filename or
// in the encrypted extras. This only makes sense if the directory structure is
// FileBased.
- if (suggestedName == null &&
+ if (
+ suggestedName == null &&
AutofillPreferences.directoryStructure(this@PasswordCreationActivityV2) ==
DirectoryStructure.FileBased
) {
@@ -368,8 +369,8 @@ class PasswordCreationActivityV2 : BasePgpActivity() {
// Additionally, if we were editing and the incoming and outgoing
// filenames differ, it means we renamed. Ensure that the target
// doesn't already exist to prevent an accidental overwrite.
- if ((!editing || (editing && suggestedName != file.nameWithoutExtension)) &&
- file.exists()
+ if (
+ (!editing || (editing && suggestedName != file.nameWithoutExtension)) && file.exists()
) {
snackbar(message = getString(R.string.password_creation_duplicate_error))
return@runCatching
@@ -407,7 +408,8 @@ class PasswordCreationActivityV2 : BasePgpActivity() {
returnIntent.putExtra(RETURN_EXTRA_USERNAME, username)
}
- if (directoryInputLayout.isVisible &&
+ if (
+ directoryInputLayout.isVisible &&
directoryInputLayout.isEnabled &&
oldFileName != null
) {