diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-04-04 02:18:34 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-04-27 16:21:52 +0000 |
| commit | f119a4ce3b566ae4a46a91cfaafd55b82709b6ae (patch) | |
| tree | a6243f79fa6ff76a3e56f77f2d64bf61497d8da0 /android | |
| parent | 3630bad3973004583e5efbe51ec0d9c41d2c1187 (diff) | |
| download | mullvadvpn-f119a4ce3b566ae4a46a91cfaafd55b82709b6ae.tar.xz mullvadvpn-f119a4ce3b566ae4a46a91cfaafd55b82709b6ae.zip | |
Update verifying key spinner separately
Diffstat (limited to 'android')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/ui/WireguardKeyFragment.kt | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/WireguardKeyFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/WireguardKeyFragment.kt index fdcfe14e6b..91e368dbbb 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/WireguardKeyFragment.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/WireguardKeyFragment.kt @@ -43,9 +43,10 @@ class WireguardKeyFragment : ServiceDependentFragment(OnNoService.GoToLaunchScre if (field != value) { field = value updateKeyInformation() - updateStatus() + updateStatusMessage() updateGenerateKeyButtonState() updateVerifyKeyButtonState() + updateVerifyingKeySpinner() } } @@ -54,7 +55,7 @@ class WireguardKeyFragment : ServiceDependentFragment(OnNoService.GoToLaunchScre if (field != value) { field = value updateKeyInformation() - updateStatus() + updateStatusMessage() updateVerifyKeyButtonState() } } @@ -63,7 +64,7 @@ class WireguardKeyFragment : ServiceDependentFragment(OnNoService.GoToLaunchScre set(value) { if (field != value) { field = value - updateStatus() + updateStatusMessage() updateGenerateKeyButtonState() updateVerifyKeyButtonState() manageKeysButton.setEnabled(value) @@ -188,12 +189,7 @@ class WireguardKeyFragment : ServiceDependentFragment(OnNoService.GoToLaunchScre } } - private fun updateStatus() { - verifyingKeySpinner.visibility = when (actionState) { - is ActionState.Verifying -> View.VISIBLE - else -> View.GONE - } - + private fun updateStatusMessage() { when (val state = actionState) { is ActionState.Generating -> statusMessage.visibility = View.GONE is ActionState.Verifying -> statusMessage.visibility = View.GONE @@ -252,6 +248,13 @@ class WireguardKeyFragment : ServiceDependentFragment(OnNoService.GoToLaunchScre verifyKeyButton.setEnabled(isIdle && hasConnectivity && hasKey) } + private fun updateVerifyingKeySpinner() { + verifyingKeySpinner.visibility = when (actionState) { + is ActionState.Verifying -> View.VISIBLE + else -> View.GONE + } + } + private fun setStatusMessage(message: Int, color: Int) { statusMessage.setText(message) statusMessage.setTextColor(resources.getColor(color)) |
