summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-11-11 18:14:22 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-12-10 12:55:06 +0000
commit18fc8cdccdb78794debb5baa1f3fca56ce0d36ed (patch)
tree5dffbd6bbda274816f2af5a8a03859e78532f0a3
parent996d272674a3be99b5b9a289fa88ee26624d010f (diff)
downloadmullvadvpn-18fc8cdccdb78794debb5baa1f3fca56ce0d36ed.tar.xz
mullvadvpn-18fc8cdccdb78794debb5baa1f3fca56ce0d36ed.zip
Focus on DNS server text when starting to edit
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/EditCustomDnsServerHolder.kt15
1 files changed, 12 insertions, 3 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 f2022dd10d..5fa6bb7e2e 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
@@ -1,17 +1,26 @@
package net.mullvad.mullvadvpn.ui.customdns
import android.view.View
-import android.widget.TextView
+import android.widget.EditText
import java.net.InetAddress
import kotlin.properties.Delegates.observable
import net.mullvad.mullvadvpn.R
import net.mullvad.talpid.util.addressString
class EditCustomDnsServerHolder(view: View, adapter: CustomDnsAdapter) : CustomDnsItemHolder(view) {
- private val input: TextView = view.findViewById(R.id.input)
+ private val input: EditText = view.findViewById(R.id.input)
var serverAddress by observable<InetAddress?>(null) { _, _, address ->
- input.text = address?.addressString() ?: ""
+ if (address != null) {
+ val addressString = address.addressString()
+
+ input.setText(addressString)
+ input.setSelection(addressString.length)
+ } else {
+ input.setText("")
+ }
+
+ input.requestFocus()
}
init {