summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-04-04 13:31:56 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-04-27 16:21:52 +0000
commitf372ebc85e455740751daa6b409b0c1221eb4c6c (patch)
tree34f85dcceb8580c924b2235a6568272946b896dd
parent79485af101a34262292975a37f5f8428cbc213b9 (diff)
downloadmullvadvpn-f372ebc85e455740751daa6b409b0c1221eb4c6c.tar.xz
mullvadvpn-f372ebc85e455740751daa6b409b0c1221eb4c6c.zip
Update key spinners separately
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/WireguardKeyFragment.kt15
1 files changed, 14 insertions, 1 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 bd74c2c8c5..8ea1f94b7b 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/WireguardKeyFragment.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/WireguardKeyFragment.kt
@@ -42,7 +42,7 @@ class WireguardKeyFragment : ServiceDependentFragment(OnNoService.GoToLaunchScre
set(value) {
if (field != value) {
field = value
- updateKeyInformation()
+ updateKeySpinners()
updateStatusMessage()
updateGenerateKeyButtonState()
updateVerifyKeyButtonState()
@@ -172,6 +172,19 @@ class WireguardKeyFragment : ServiceDependentFragment(OnNoService.GoToLaunchScre
jobTracker.cancelAllJobs()
}
+ private fun updateKeySpinners() {
+ when (actionState) {
+ is ActionState.Generating -> {
+ publicKey.whenMissing = WhenMissing.ShowSpinner
+ keyAge.whenMissing = WhenMissing.ShowSpinner
+ }
+ is ActionState.Verifying, is ActionState.Idle -> {
+ publicKey.whenMissing = WhenMissing.Nothing
+ keyAge.whenMissing = WhenMissing.Nothing
+ }
+ }
+ }
+
private fun updateKeyInformation() {
when (val keyState = keyStatus) {
is KeygenEvent.NewKey -> {