diff options
Diffstat (limited to 'android/src')
| -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)) |
