diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-01-28 20:03:38 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-02-10 15:40:36 +0000 |
| commit | 6b386392af6b83de3857a94c5d51482593d051ca (patch) | |
| tree | 715e1acdae296354aee97919fe10c331d77fc102 /android/src | |
| parent | b361f24f32843dfadf39a3590f8aa66dff1db84c (diff) | |
| download | mullvadvpn-6b386392af6b83de3857a94c5d51482593d051ca.tar.xz mullvadvpn-6b386392af6b83de3857a94c5d51482593d051ca.zip | |
Add state listener to `CellSwitch`
Diffstat (limited to 'android/src')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/ui/CellSwitch.kt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/CellSwitch.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/CellSwitch.kt index 622ff38799..0be0a90247 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/CellSwitch.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/CellSwitch.kt @@ -25,9 +25,12 @@ class CellSwitch : LinearLayout { if (field != value) { field = value animateToState() + listener?.invoke(value) } } + var listener: ((State) -> Unit)? = null + private val onColor = resources.getColor(R.color.green) private val offColor = resources.getColor(R.color.red) |
