Search in sources :

Example 26 with AutoCompleteTextView

use of android.widget.AutoCompleteTextView in project android2 by aqi00.

the class EditAutoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_edit_auto);
    // 从布局文件中获取名叫ac_text的自动完成编辑框
    AutoCompleteTextView ac_text = findViewById(R.id.ac_text);
    // 声明一个自动完成时下拉展示的数组适配器
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.item_dropdown, hintArray);
    // 设置自动完成编辑框的数组适配器
    ac_text.setAdapter(adapter);
}
Also used : ArrayAdapter(android.widget.ArrayAdapter) AutoCompleteTextView(android.widget.AutoCompleteTextView)

Example 27 with AutoCompleteTextView

use of android.widget.AutoCompleteTextView in project ctSESAM-android by pinae.

the class DomainDetailsActivity method setDomainFieldFromClipboard.

private void setDomainFieldFromClipboard() {
    ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
    if (clipboard.hasPrimaryClip()) {
        ClipData clipDataCurrent = clipboard.getPrimaryClip();
        CharSequence pasteData = clipDataCurrent.getItemAt(0).getText();
        if (pasteData != null) {
            AutoCompleteTextView autoCompleteTextViewDomain = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextViewDomain);
            autoCompleteTextViewDomain.setText(DomainExtractor.extract(pasteData.toString()));
        }
    }
}
Also used : ClipboardManager(android.content.ClipboardManager) ClipData(android.content.ClipData) AutoCompleteTextView(android.widget.AutoCompleteTextView)

Example 28 with AutoCompleteTextView

use of android.widget.AutoCompleteTextView in project ctSESAM-android by pinae.

the class MainActivity method loadSettings.

private void loadSettings() {
    AutoCompleteTextView autoCompleteTextViewDomain = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextViewDomain);
    String domain = autoCompleteTextViewDomain.getText().toString();
    EditText editTextUsername = (EditText) findViewById(R.id.editTextUsername);
    PasswordSetting passwordSetting = settingsManager.getSetting(domain);
    this.showSettings = domain.length() > 0;
    editTextUsername.setText(passwordSetting.getUsername());
}
Also used : EditText(android.widget.EditText) AutoCompleteTextView(android.widget.AutoCompleteTextView)

Example 29 with AutoCompleteTextView

use of android.widget.AutoCompleteTextView in project ctSESAM-android by pinae.

the class CreateKgkAndPasswordTask method onPostExecute.

@Override
protected void onPostExecute(byte[] ivKey) {
    kgkManager.createAndStoreNewKgkBlock(new Crypter(ivKey));
    MainActivity activity = mainActivityWeakRef.get();
    if (activity != null && !activity.isFinishing()) {
        AutoCompleteTextView autoCompleteTextViewDomain = (AutoCompleteTextView) activity.findViewById(R.id.autoCompleteTextViewDomain);
        String domainStr = autoCompleteTextViewDomain.getText().toString();
        byte[] domain = UTF8.encode(autoCompleteTextViewDomain.getText());
        PasswordSetting setting = settingsManager.getSetting(domainStr);
        EditText editTextUsername = (EditText) activity.findViewById(R.id.editTextUsername);
        byte[] username = UTF8.encode(editTextUsername.getText());
        GeneratePasswordTask generatePasswordTask = new GeneratePasswordTask(new GeneratePasswordTask.OnPasswordGeneratedListener() {

            @Override
            public void onFinished(PasswordGenerator generator) {
            // TODO: Do Stuff Here
            }
        });
        generatePasswordTask.execute(domain, username, kgkManager.getKgk(), setting.getSalt(), ByteBuffer.allocate(4).order(ByteOrder.BIG_ENDIAN).putInt(iterations).array());
    }
}
Also used : EditText(android.widget.EditText) AutoCompleteTextView(android.widget.AutoCompleteTextView)

Example 30 with AutoCompleteTextView

use of android.widget.AutoCompleteTextView in project Api-Startup-Android by salyangoz.

the class RegisterActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_register);
    // Set up the register form.
    mNameView = (EditText) findViewById(R.id.name);
    mEmailView = (AutoCompleteTextView) findViewById(R.id.email);
    mPasswordView = (EditText) findViewById(R.id.password);
    mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
            if (id == R.id.register || id == EditorInfo.IME_NULL) {
                attemptRegister();
                return true;
            }
            return false;
        }
    });
    Button mEmailSignInButton = (Button) findViewById(R.id.email_sign_in_button);
    mEmailSignInButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            finish();
        }
    });
    Button mRegisterButton = (Button) findViewById(R.id.register_button);
    mRegisterButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            attemptRegister();
        }
    });
    mRegisterFormView = findViewById(R.id.register_form);
    mProgressView = findViewById(R.id.register_progress);
    if (BuildConfig.DEBUG) {
        mNameView.setText("Erkin Deveci");
        mEmailView.setText("erkind@salyangoz.com.tr");
        mPasswordView.setText("123456");
    }
}
Also used : KeyEvent(android.view.KeyEvent) Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) AutoCompleteTextView(android.widget.AutoCompleteTextView) TextView(android.widget.TextView) View(android.view.View) AutoCompleteTextView(android.widget.AutoCompleteTextView) TextView(android.widget.TextView)

Aggregations

AutoCompleteTextView (android.widget.AutoCompleteTextView)106 View (android.view.View)62 TextView (android.widget.TextView)44 ArrayAdapter (android.widget.ArrayAdapter)38 Button (android.widget.Button)27 EditText (android.widget.EditText)21 OnClickListener (android.view.View.OnClickListener)20 KeyEvent (android.view.KeyEvent)19 AdapterView (android.widget.AdapterView)17 Intent (android.content.Intent)16 ImageView (android.widget.ImageView)14 Editable (android.text.Editable)10 TextWatcher (android.text.TextWatcher)10 ArrayList (java.util.ArrayList)9 Dialog (android.app.Dialog)8 ListView (android.widget.ListView)8 Spinner (android.widget.Spinner)8 DialogInterface (android.content.DialogInterface)7 InputMethodManager (android.view.inputmethod.InputMethodManager)7 SuppressLint (android.annotation.SuppressLint)6