From ea24056554f307f4f8f84b0ab6a808730d6acfa4 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 7 Feb 2021 12:49:00 +0530 Subject: Redo authentication modes UI with Chips (#1297) --- .../dev/msfjarvis/aps/ui/git/config/GitServerConfigActivity.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/src/main/java') 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 a964e150..0c250d87 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 @@ -63,8 +63,8 @@ class GitServerConfigActivity : BaseGitActivity() { AuthMode.OpenKeychain -> check(binding.authModeOpenKeychain.id) AuthMode.None -> check(View.NO_ID) } - addOnButtonCheckedListener { _, _, _ -> - when (checkedButtonId) { + setOnCheckedChangeListener { _, checkedId -> + when (checkedId) { binding.authModeSshKey.id -> newAuthMode = AuthMode.SshKey binding.authModeOpenKeychain.id -> newAuthMode = AuthMode.OpenKeychain binding.authModePassword.id -> newAuthMode = AuthMode.Password @@ -184,13 +184,13 @@ class GitServerConfigActivity : BaseGitActivity() { authModeSshKey.isVisible = false authModeOpenKeychain.isVisible = false authModePassword.isVisible = true - if (authModeGroup.checkedButtonId != authModePassword.id) + if (authModeGroup.checkedChipId != authModePassword.id) authModeGroup.check(View.NO_ID) } else { authModeSshKey.isVisible = true authModeOpenKeychain.isVisible = true authModePassword.isVisible = true - if (authModeGroup.checkedButtonId == View.NO_ID) + if (authModeGroup.checkedChipId == View.NO_ID) authModeGroup.check(authModeSshKey.id) } } -- cgit v1.2.3