aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-11-01 20:04:57 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2021-11-03 15:51:43 +0530
commit4a50f3fb6d70b731d6518b5526a004c4e160c4cb (patch)
tree88608b4a13e4773549472e60fdf314ffa57c2a1a /app/src/main/java
parentf8088f0f4459b68929d7f142cac222d50828cb93 (diff)
app: switch back to buttons for SSH config screen
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/git/config/GitServerConfigActivity.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/git/config/GitServerConfigActivity.kt b/app/src/main/java/dev/msfjarvis/aps/ui/git/config/GitServerConfigActivity.kt
index d1e84374..4b82ee81 100644
--- a/app/src/main/java/dev/msfjarvis/aps/ui/git/config/GitServerConfigActivity.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/ui/git/config/GitServerConfigActivity.kt
@@ -65,7 +65,11 @@ class GitServerConfigActivity : BaseGitActivity() {
AuthMode.OpenKeychain -> check(binding.authModeOpenKeychain.id)
AuthMode.None -> check(View.NO_ID)
}
- setOnCheckedChangeListener { _, checkedId ->
+ addOnButtonCheckedListener { _, checkedId, isChecked ->
+ if (!isChecked) {
+ newAuthMode = AuthMode.None
+ return@addOnButtonCheckedListener
+ }
when (checkedId) {
binding.authModeSshKey.id -> newAuthMode = AuthMode.SshKey
binding.authModeOpenKeychain.id -> newAuthMode = AuthMode.OpenKeychain
@@ -213,12 +217,12 @@ class GitServerConfigActivity : BaseGitActivity() {
authModeSshKey.isVisible = false
authModeOpenKeychain.isVisible = false
authModePassword.isVisible = true
- if (authModeGroup.checkedChipId != authModePassword.id) authModeGroup.check(View.NO_ID)
+ if (authModeGroup.checkedButtonId != authModePassword.id) authModeGroup.check(View.NO_ID)
} else {
authModeSshKey.isVisible = true
authModeOpenKeychain.isVisible = true
authModePassword.isVisible = true
- if (authModeGroup.checkedChipId == View.NO_ID) authModeGroup.check(authModeSshKey.id)
+ if (authModeGroup.checkedButtonId == View.NO_ID) authModeGroup.check(authModeSshKey.id)
}
}