summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-03-11 17:53:11 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-03-11 18:05:05 +0000
commitbcbd6e4b1d0811e51289ba58498eb26e55e715c5 (patch)
tree8091167117d46fedde5463178fb44336b7498c56 /android/src
parentbad0ac3c9af1d5bbcc9ec1625251603fd4643711 (diff)
downloadmullvadvpn-bcbd6e4b1d0811e51289ba58498eb26e55e715c5.tar.xz
mullvadvpn-bcbd6e4b1d0811e51289ba58498eb26e55e715c5.zip
Use new extension when editing custom DNS address
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/EditCustomDnsServerHolder.kt11
1 files changed, 2 insertions, 9 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/EditCustomDnsServerHolder.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/EditCustomDnsServerHolder.kt
index 797cd8a683..5e62f47209 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/EditCustomDnsServerHolder.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/EditCustomDnsServerHolder.kt
@@ -2,14 +2,13 @@ package net.mullvad.mullvadvpn.ui.customdns
import android.text.Editable
import android.text.TextWatcher
-import android.view.KeyEvent
import android.view.View
import android.view.View.OnFocusChangeListener
-import android.view.inputmethod.EditorInfo
import android.widget.EditText
import java.net.InetAddress
import kotlin.properties.Delegates.observable
import net.mullvad.mullvadvpn.R
+import net.mullvad.mullvadvpn.util.setOnEnterOrDoneAction
import net.mullvad.talpid.util.addressString
class EditCustomDnsServerHolder(
@@ -33,13 +32,7 @@ class EditCustomDnsServerHolder(
}
}
- setOnEditorActionListener { _, action, event ->
- if (action == EditorInfo.IME_ACTION_DONE || event?.keyCode == KeyEvent.KEYCODE_ENTER) {
- saveDnsServer()
- }
-
- false
- }
+ setOnEnterOrDoneAction(::saveDnsServer)
}
private val watcher: TextWatcher = object : TextWatcher {