summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-10-08 20:32:32 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-10-19 11:51:48 +0000
commit6eb3b49e3d1ea77c69213ce52a3d6bfe55aacdf3 (patch)
tree531233206dbd5e8d7812bc6f143738d246741b84 /android
parentfe4abe2dd2b3339726368827ea345ce86370c236 (diff)
downloadmullvadvpn-6eb3b49e3d1ea77c69213ce52a3d6bfe55aacdf3.tar.xz
mullvadvpn-6eb3b49e3d1ea77c69213ce52a3d6bfe55aacdf3.zip
Mark `InformationView` as focusable if clickable
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/InformationView.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/InformationView.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/InformationView.kt
index ba8b887064..d80506a5dd 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/InformationView.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/InformationView.kt
@@ -28,7 +28,7 @@ open class InformationView : LinearLayout {
}
}
- private val container =
+ private val container: View =
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE).let { service ->
val inflater = service as LayoutInflater
@@ -56,7 +56,9 @@ open class InformationView : LinearLayout {
var shouldEnable by observable(false) { _, _, _ -> updateEnabled() }
- var onClick: (() -> Unit)? = null
+ var onClick by observable<(() -> Unit)?>(null) { _, _, callback ->
+ container.setFocusable(callback != null)
+ }
constructor(context: Context) : super(context) {}