summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorEmīls Piņķis <emils@mullvad.net>2019-09-03 13:37:14 +0100
committerEmīls Piņķis <emils@mullvad.net>2019-09-06 20:12:23 +0100
commitd768f08cb8c70681f2f4198ddd44f8702be4a258 (patch)
tree85c787c47db40c567738b12708e22499f12a4cc9 /android
parentd939ef55c0e21e97b3d9f39dcd54e96a879b0aed (diff)
downloadmullvadvpn-d768f08cb8c70681f2f4198ddd44f8702be4a258.tar.xz
mullvadvpn-d768f08cb8c70681f2f4198ddd44f8702be4a258.zip
Show no connection state when blocked in wireguard fragment
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/WireguardKeyFragment.kt15
-rw-r--r--android/src/main/res/values/strings.xml3
2 files changed, 16 insertions, 2 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/WireguardKeyFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/WireguardKeyFragment.kt
index 1b5e1a3cfe..e9564d38b4 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/WireguardKeyFragment.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/WireguardKeyFragment.kt
@@ -89,8 +89,6 @@ class WireguardKeyFragment : Fragment() {
private fun updateViews() {
clearErrorMessage()
- actionButton.setClickable(true)
-
when (val keyState = keyStatusListener.keyStatus) {
null -> {
publicKey.visibility = View.INVISIBLE
@@ -167,6 +165,11 @@ class WireguardKeyFragment : Fragment() {
}
private fun drawNoConnectionState() {
+ actionButton.setClickable(true)
+ visitWebsiteView.setClickable(true)
+ actionButton.setAlpha(1f)
+ visitWebsiteView.setAlpha(1f)
+
when (tunnelState) {
is TunnelState.Connecting, is TunnelState.Disconnecting -> {
statusMessage.setText(R.string.wireguard_key_connectivity)
@@ -174,6 +177,14 @@ class WireguardKeyFragment : Fragment() {
actionButton.visibility = View.GONE
actionSpinner.visibility = View.VISIBLE
}
+ is TunnelState.Blocked -> {
+ statusMessage.setText(R.string.wireguard_key_blocked_state_message)
+ statusMessage.visibility = View.VISIBLE
+ actionButton.setClickable(false)
+ actionButton.setAlpha(0.5f)
+ visitWebsiteView.setClickable(false)
+ visitWebsiteView.setAlpha(0.5f)
+ }
}
}
diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml
index 37d31e758f..44076d85ae 100644
--- a/android/src/main/res/values/strings.xml
+++ b/android/src/main/res/values/strings.xml
@@ -113,6 +113,9 @@
<string name="wireguard_key_connectivity">
Connectivity required to manage your key.
</string>
+ <string name="wireguard_key_blocked_state_message">
+ Can\'t manage keys in blocked state
+ </string>
<string name="wireguard_key_valid">
Key is valid
</string>