aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-09-04 15:49:45 +0530
committerGitHub <noreply@github.com>2020-09-04 12:19:45 +0200
commit0d2c6654d34d08ff1b24a3b0adda9a3e85df2214 (patch)
treed32fc9f6b8078f0224d306f5d189da43e10320b2 /app/src/main
parent4214b7fbb4b42e187ce23b9a56df89b45df87ca6 (diff)
Assorted UX improvements (#1077)
* CredentialFinder: allow seeing password when retrying Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * GitOperation: bail out early when SSH key is missing Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * OnboardingActivity: finish all activities in onBackPressed Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Update CHANGELOG Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/OnboardingActivity.kt4
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/git/operation/CredentialFinder.kt6
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt3
3 files changed, 12 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/OnboardingActivity.kt b/app/src/main/java/com/zeapo/pwdstore/OnboardingActivity.kt
index d2f19b7a..ed05ed0d 100644
--- a/app/src/main/java/com/zeapo/pwdstore/OnboardingActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/OnboardingActivity.kt
@@ -81,6 +81,10 @@ class OnboardingActivity : AppCompatActivity() {
}
}
+ override fun onBackPressed() {
+ finishAffinity()
+ }
+
/**
* Clones a remote Git repository to the app's private directory
*/
diff --git a/app/src/main/java/com/zeapo/pwdstore/git/operation/CredentialFinder.kt b/app/src/main/java/com/zeapo/pwdstore/git/operation/CredentialFinder.kt
index 6ac5cba3..742361c0 100644
--- a/app/src/main/java/com/zeapo/pwdstore/git/operation/CredentialFinder.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/git/operation/CredentialFinder.kt
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.view.LayoutInflater
import androidx.annotation.StringRes
import androidx.core.content.edit
+import androidx.core.widget.doOnTextChanged
import androidx.fragment.app.FragmentActivity
import com.google.android.material.checkbox.MaterialCheckBox
import com.google.android.material.dialog.MaterialAlertDialogBuilder
@@ -61,8 +62,11 @@ class CredentialFinder(
editCredential.setHint(hintRes)
val rememberCredential = dialogView.findViewById<MaterialCheckBox>(R.id.git_auth_remember_credential)
rememberCredential.setText(rememberRes)
- if (isRetry)
+ if (isRetry) {
credentialLayout.error = callingActivity.resources.getString(errorRes)
+ // Reset error when user starts entering a password
+ editCredential.doOnTextChanged { _, _, _, _ -> credentialLayout.error = null }
+ }
MaterialAlertDialogBuilder(callingActivity).run {
setTitle(R.string.passphrase_dialog_title)
setMessage(messageRes)
diff --git a/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt b/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt
index 2a72005e..32a94d73 100644
--- a/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt
@@ -176,6 +176,9 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) {
}
} else {
onMissingSshKeyFile()
+ // This would correctly cancel the operation but won't surface a user-visible
+ // error, allowing users to make the SSH key selection.
+ return Err(SSHException(DisconnectReason.AUTH_CANCELLED_BY_USER))
}
AuthMode.OpenKeychain -> registerAuthProviders(SshAuthData.OpenKeychain(callingActivity))
AuthMode.Password -> {