summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-11-11 11:56:21 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-12-10 12:55:06 +0000
commitbeee503653d9ea2733f7cdacaa34249dfc8ea28c (patch)
tree4a6503814b381fc19f0edf5e2137a5d8b521130c /android/src
parentf290a561080948f642b036fad2ee6410a652e1ee (diff)
downloadmullvadvpn-beee503653d9ea2733f7cdacaa34249dfc8ea28c.tar.xz
mullvadvpn-beee503653d9ea2733f7cdacaa34249dfc8ea28c.zip
Animate enabling and disabling custom DNS servers
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsAdapter.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsAdapter.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsAdapter.kt
index e2d434f7ab..54f379dfeb 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsAdapter.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsAdapter.kt
@@ -35,7 +35,11 @@ class CustomDnsAdapter(val customDns: CustomDns) : Adapter<CustomDnsItemHolder>(
private var enabled by observable(false) { _, oldValue, newValue ->
if (oldValue != newValue) {
- notifyDataSetChanged()
+ if (newValue == true) {
+ notifyItemRangeInserted(0, cachedCustomDnsServers.size + 1)
+ } else {
+ notifyItemRangeRemoved(0, cachedCustomDnsServers.size + 1)
+ }
}
}