diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-02-09 22:03:44 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-02-09 22:03:44 +0100 |
commit | 859bce4442c4ca55e99f816c384e80b4bcb5bb14 (patch) | |
tree | ba4a57683a5524f6049fca296cc982bda76b783e /src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java | |
parent | edf8c8d37caeb1986d55bade7d4eafd5ea2a3e43 (diff) |
add servers from https://conversations.im/compliance/ to autocomplete jids
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java b/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java index 6a2beaf8c..849bd0593 100644 --- a/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java +++ b/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java @@ -6,23 +6,25 @@ import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.View; +import android.widget.AutoCompleteTextView; import android.widget.Button; -import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import java.security.SecureRandom; +import java.util.List; import de.pixart.messenger.Config; import de.pixart.messenger.R; import de.pixart.messenger.entities.Account; +import de.pixart.messenger.ui.adapter.KnownHostsAdapter; import de.pixart.messenger.xmpp.jid.InvalidJidException; import de.pixart.messenger.xmpp.jid.Jid; public class MagicCreateActivity extends XmppActivity implements TextWatcher { private TextView mFullJidDisplay; - private EditText mUsername; + private AutoCompleteTextView mUsername; private SecureRandom mRandom; private static final String CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456780+-/#$!?"; @@ -53,9 +55,11 @@ public class MagicCreateActivity extends XmppActivity implements TextWatcher { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } super.onCreate(savedInstanceState); + List<String> knownHosts = null; setContentView(R.layout.magic_create); mFullJidDisplay = findViewById(R.id.full_jid); mUsername = findViewById(R.id.username); + mUsername.setAdapter(new KnownHostsAdapter(this, R.layout.simple_list_item, knownHosts)); mRandom = new SecureRandom(); Button next = findViewById(R.id.create_account); next.setOnClickListener(v -> { |