diff options
Diffstat (limited to 'android/src/main')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/EditCustomDnsServerHolder.kt | 15 |
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 { |
