summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-04-25 13:51:47 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-04-27 16:21:51 +0000
commit734f60428a7f7c3a6239f712b1904a74c9d27949 (patch)
treeedb84d270b5f61c85fcb8658c2769fdf2ba69f96 /android/src
parente192c75ad887e3d2edb78626bc1f3d82f4046819 (diff)
downloadmullvadvpn-734f60428a7f7c3a6239f712b1904a74c9d27949.tar.xz
mullvadvpn-734f60428a7f7c3a6239f712b1904a74c9d27949.zip
Allow enabling or disabling the `InformationView`
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/InformationView.kt12
1 files changed, 11 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/InformationView.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/InformationView.kt
index b9d3fee793..3d4dc2b691 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/InformationView.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/InformationView.kt
@@ -41,6 +41,12 @@ open class InformationView : LinearLayout {
private val informationDisplay: TextView = findViewById(R.id.information_display)
private val spinner: View = findViewById(R.id.spinner)
+ var shouldEnable = false
+ set(value) {
+ field = value
+ updateEnabled()
+ }
+
var information: String? = null
set(value) {
field = value
@@ -119,6 +125,10 @@ open class InformationView : LinearLayout {
informationDisplay.visibility = VISIBLE
}
- setEnabled(information != null)
+ updateEnabled()
+ }
+
+ private fun updateEnabled() {
+ setEnabled(shouldEnable && information != null)
}
}