summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/LoginFragment.kt4
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/HeaderBar.kt12
3 files changed, 15 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b60076e795..b7e15ad4f9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -55,6 +55,7 @@ Line wrap the file at 100 chars. Th
#### Android
- Refresh device data when opening the account view to ensure the local data is up-to-date and that
the device hasn't been revoked.
+- Disable settings button during login.
### Fixed
- Connect to TCP endpoints over IPv6 if IPv6 is enabled for WireGuard.
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/LoginFragment.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/LoginFragment.kt
index c04f41ca1c..989202f9a0 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/LoginFragment.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/LoginFragment.kt
@@ -212,6 +212,7 @@ class LoginFragment : BaseFragment(), NavigationBarPainter {
private fun showLoading(overrideSpinnerWithErrorIcon: Boolean = false) {
accountLogin.state = LoginState.InProgress
+ headerBar.setSettingsButtonEnabled(false)
title.setText(R.string.logging_in_title)
subtitle.setText(R.string.logging_in_description)
@@ -244,6 +245,7 @@ class LoginFragment : BaseFragment(), NavigationBarPainter {
loggedInStatus.visibility = View.VISIBLE
accountLogin.state = LoginState.Success
+ headerBar.setSettingsButtonEnabled(false)
scrollToShow(loggedInStatus)
}
@@ -257,6 +259,7 @@ class LoginFragment : BaseFragment(), NavigationBarPainter {
loggedInStatus.visibility = View.GONE
accountLogin.state = LoginState.InProgress
+ headerBar.setSettingsButtonEnabled(true)
scrollToShow(loggingInStatus)
}
@@ -270,6 +273,7 @@ class LoginFragment : BaseFragment(), NavigationBarPainter {
loggedInStatus.visibility = View.GONE
accountLogin.state = LoginState.Failure
+ headerBar.setSettingsButtonEnabled(true)
scrollToShow(accountLogin)
}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/HeaderBar.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/HeaderBar.kt
index 052739c826..e1688ace21 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/HeaderBar.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/HeaderBar.kt
@@ -21,6 +21,7 @@ class HeaderBar @JvmOverloads constructor(
defStyleRes: Int = 0
) : LinearLayout(context, attributes, defStyleAttr, defStyleRes), StatusBarPainter {
private val container = LayoutInflater.from(context).inflate(R.layout.header_bar, this)
+ private val settingsButton = findViewById<View>(R.id.settings)
private val disabledColor = ContextCompat.getColor(context, android.R.color.transparent)
private val securedColor = ContextCompat.getColor(context, R.color.green)
@@ -43,10 +44,17 @@ class HeaderBar @JvmOverloads constructor(
gravity = Gravity.CENTER_VERTICAL
orientation = HORIZONTAL
- findViewById<View>(R.id.settings).setOnClickListener {
- (context as? MainActivity)?.openSettings()
+ settingsButton.apply {
+ isEnabled = true
+ setOnClickListener {
+ (context as? MainActivity)?.openSettings()
+ }
}
tunnelState = null
}
+
+ fun setSettingsButtonEnabled(isEnabled: Boolean) {
+ settingsButton.isEnabled = isEnabled
+ }
}