use of android.widget.AutoCompleteTextView in project philm by chrisbanes.
the class LoginFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_login, container, false);
mUsername = (EditText) view.findViewById(R.id.edit_login);
mUsername.setOnEditorActionListener(this);
mPassword = (EditText) view.findViewById(R.id.edit_password);
mPassword.setOnEditorActionListener(this);
mLoginButton = (Button) view.findViewById(R.id.btn_submit);
mLoginButton.setOnClickListener(this);
mTypeRadioGroup = (RadioGroup) view.findViewById(R.id.rg_type);
mTypeRadioGroup.setOnCheckedChangeListener(this);
mEmailAutoComplete = (AutoCompleteTextView) view.findViewById(R.id.actv_email);
mEmailAutoComplete.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
mEmailAutoComplete.showDropDown();
}
});
mLoginRadioButton = (RadioButton) view.findViewById(R.id.rb_login);
mCreateRadioButton = (RadioButton) view.findViewById(R.id.rb_create);
mLoginRadioButton.setChecked(true);
return view;
}
use of android.widget.AutoCompleteTextView in project GT by Tencent.
the class GTInputParamSetActivity method initAutoCompleteTV.
private void initAutoCompleteTV(ArrayList<String> vals, final AutoCompleteTextView auto) {
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.gt_drop_default_listitem, vals);
auto.setDropDownBackgroundResource(R.drawable.btn_gray);
auto.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
auto.showDropDown();
}
});
auto.setText(vals.get(0));
auto.setSelection(vals.get(0).length());
auto.setAdapter(adapter);
auto.setThreshold(1);
auto.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (auto.getText().toString().equals("")) {
btn_c.setVisibility(View.GONE);
} else {
btn_c.setVisibility(View.VISIBLE);
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void afterTextChanged(Editable s) {
}
});
auto.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
auto.showDropDown();
}
});
}
use of android.widget.AutoCompleteTextView in project GT by Tencent.
the class GTInputParamSetActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gt_inputparamset);
TextView tv_cancel = (TextView) findViewById(R.id.tv_cancel_setinput);
tv_cancel.setOnClickListener(cancel);
TextView tv_finish = (TextView) findViewById(R.id.tv_finish_setinput);
tv_finish.setOnClickListener(finish);
Intent intent = getIntent();
ip_name = intent.getStringExtra("ip_name");
ip_client = intent.getStringExtra("ip_client");
values = intent.getStringArrayListExtra("ip_values");
// 将list转为linkedlist,队列类型去init autoTV
ArrayList<String> linked_vals = new ArrayList<String>();
for (int j = 0; j < values.size(); j++) {
linked_vals.add(values.get(j));
}
TextView tv_ip_name = (TextView) findViewById(R.id.name_inputparam);
tv_ip_name.setText(ip_name);
autoTV = (AutoCompleteTextView) findViewById(R.id.autoTV_ipvalues);
initAutoCompleteTV(linked_vals, autoTV);
btn_c = (Button) findViewById(R.id.autoTV_cancel);
btn_c.setOnClickListener(c);
}
use of android.widget.AutoCompleteTextView in project actor-platform by actorapp.
the class SearchViewHacker method setText.
public static void setText(SearchView searchView, int color) {
AutoCompleteTextView autoComplete = (AutoCompleteTextView) findView(searchView, "mQueryTextView");
autoComplete.setTextColor(color);
// autoComplete.setHighlightColor(color);
}
use of android.widget.AutoCompleteTextView in project Pokemap by omkarmoghe.
the class LoginActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mNianticManager = NianticManager.getInstance();
mGoogleManager = GoogleManager.getInstance();
mPref = new PokemapSharedPreferences(this);
setContentView(R.layout.activity_login);
mNianticAuthListener = new NianticManager.AuthListener() {
@Override
public void authSuccessful() {
finishLogin();
}
@Override
public void authFailed(String message, String provider) {
switch(provider) {
case LoginInfo.PROVIDER_PTC:
showPTCLoginFailed();
break;
case LoginInfo.PROVIDER_GOOGLE:
showGoogleLoginFailed();
break;
}
Log.d(TAG, "authFailed() called with: message = [" + message + "]");
}
};
mNianticLoginListener = new NianticManager.LoginListener() {
@Override
public void authSuccessful(String authToken) {
Log.d(TAG, "authSuccessful() called with: authToken = [" + authToken + "]");
PtcLoginInfo info = new PtcLoginInfo(authToken, mUsernameView.getText().toString(), mPasswordView.getText().toString());
mPref.setLoginInfo(info);
mNianticManager.setLoginInfo(LoginActivity.this, info, mNianticAuthListener);
}
@Override
public void authFailed(String message) {
Log.e(TAG, "Failed to authenticate. authFailed() called with: message = [" + message + "]");
showPTCLoginFailed();
}
};
mGoogleLoginListener = new GoogleManager.LoginListener() {
@Override
public void authSuccessful(String authToken, String refreshToken) {
GoogleLoginInfo info = new GoogleLoginInfo(authToken, refreshToken);
Log.d(TAG, "authSuccessful() called with: authToken = [" + authToken + "]");
mPref.setLoginInfo(info);
mNianticManager.setLoginInfo(LoginActivity.this, info, mNianticAuthListener);
}
@Override
public void authFailed(String message) {
Log.d(TAG, "Failed to authenticate. authFailed() called with: message = [" + message + "]");
showGoogleLoginFailed();
}
@Override
public void authRequested(GoogleService.AuthRequest body) {
//Do nothing
}
};
findViewById(R.id.txtDisclaimer).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
new AlertDialog.Builder(LoginActivity.this).setTitle(getString(R.string.login_warning_title)).setMessage(Html.fromHtml(getString(R.string.login_warning))).setPositiveButton(android.R.string.ok, null).show();
}
});
// Set up the triggerAutoLogin form.
mUsernameView = (AutoCompleteTextView) findViewById(R.id.username);
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.login || id == EditorInfo.IME_NULL) {
validatePTCLoginForm();
return true;
}
return false;
}
});
LoginInfo loginInfo = mPref.getLoginInfo();
if (loginInfo != null && loginInfo instanceof PtcLoginInfo) {
mUsernameView.setText(((PtcLoginInfo) loginInfo).getUsername());
mPasswordView.setText(((PtcLoginInfo) loginInfo).getPassword());
}
Button signInButton = (Button) findViewById(R.id.email_sign_in_button);
signInButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
validatePTCLoginForm();
}
});
mLoginFormView = findViewById(R.id.login_form);
mProgressView = findViewById(R.id.login_progress);
SignInButton signInButtonGoogle = (SignInButton) findViewById(R.id.sign_in_button);
signInButtonGoogle.setSize(SignInButton.SIZE_WIDE);
signInButtonGoogle.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
GoogleAuthActivity.startForResult(LoginActivity.this, REQUEST_USER_AUTH);
}
});
triggerAutoLogin();
}
Aggregations