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);
}
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()));
}
}
}
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());
}
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());
}
}
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");
}
}
Aggregations