List of usage examples for android.text InputType TYPE_TEXT_VARIATION_EMAIL_ADDRESS
int TYPE_TEXT_VARIATION_EMAIL_ADDRESS
To view the source code for android.text InputType TYPE_TEXT_VARIATION_EMAIL_ADDRESS.
Click Source Link
From source file:gov.in.bloomington.georeporter.fragments.PersonalInfoFragment.java
@Override public void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); final String fieldname = PersonalInfoAdapter.FIELDS[position]; final TextView label = (TextView) v.findViewById(android.R.id.text1); final TextView input = (TextView) v.findViewById(android.R.id.text2); final EditText newValue = new EditText(getActivity()); newValue.setText(input.getText());/*from w w w. ja va2 s . c o m*/ int type = InputType.TYPE_TEXT_FLAG_CAP_WORDS; if (fieldname == "email") { type = InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; } if (fieldname == "phone") { type = InputType.TYPE_CLASS_PHONE; } newValue.setInputType(type); new AlertDialog.Builder(getActivity()).setTitle(label.getText()).setView(newValue) .setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { try { mPersonalInfo.put(fieldname, newValue.getText()); } catch (JSONException e) { // Just ignore any errors } } }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // Do Nothing } }).show(); }
From source file:com.liato.bankdroid.banking.banks.EspressoHouse.java
public EspressoHouse(Context context) { super(context); TAG = "EspressoHouse"; NAME = "Espresso House"; NAME_SHORT = "espressohouse"; BANKTYPE_ID = IBankTypes.ESPRESSOHOUSE; INPUT_TYPE_USERNAME = InputType.TYPE_CLASS_TEXT | +InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; INPUT_TITLETEXT_USERNAME = R.string.email; }
From source file:com.liato.bankdroid.banking.banks.Hors.java
public Hors(Context context) { super(context); super.TAG = TAG; super.NAME = NAME; super.NAME_SHORT = NAME_SHORT; super.BANKTYPE_ID = BANKTYPE_ID; super.URL = URL; super.DISPLAY_DECIMALS = DISPLAY_DECIMALS; super.INPUT_TYPE_USERNAME = InputType.TYPE_CLASS_TEXT | +InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; super.INPUT_HINT_USERNAME = context.getString(R.string.card_id); super.INPUT_HIDDEN_PASSWORD = true; }
From source file:com.hua.goddess.activites.RegisterActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_register); pd = new ProgressDialog(RegisterActivity.this); // DeviceUuidFactory uuid = new DeviceUuidFactory(this); // uid = uuid.getDeviceUuid().toString(); emailEditText = (EditText) findViewById(R.id.email); emailEditText.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);// ?? userNameEditText = (EditText) findViewById(R.id.username); passwordEditText = (EditText) findViewById(R.id.password); confirmPwdEditText = (EditText) findViewById(R.id.confirm_password); rg = (RadioGroup) findViewById(R.id.sex); b1 = (RadioButton) findViewById(R.id.male); b2 = (RadioButton) findViewById(R.id.female); wh = new WsRequestHelper(new WsRequestHelper.InterfaceCallBack() { @Override//w w w .j a v a2 s . c om public void RequestCallBack(Object result) { // TODO Auto-generated method stub pd.dismiss(); // Toast.makeText(RegisterActivity.this, result.toString(), // Toast.LENGTH_SHORT).show(); if (result.toString().equals("?")) { Intent intent = new Intent(RegisterActivity.this, LoginActivity.class); Bundle bundle = new Bundle(); bundle.putString("username", userNameEditText.getText().toString().trim()); intent.putExtras(bundle); setResult(100, intent); finish(); } } }); rg.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub if (checkedId == b1.getId()) { sex = "1"; Toast.makeText(RegisterActivity.this, "", Toast.LENGTH_LONG).show(); } if (checkedId == b2.getId()) { sex = "2"; Toast.makeText(RegisterActivity.this, "", Toast.LENGTH_LONG).show(); } } }); }
From source file:com.liato.bankdroid.banking.banks.Bioklubben.java
public Bioklubben(Context context) { super(context); super.TAG = TAG; super.NAME = NAME; super.NAME_SHORT = NAME_SHORT; super.BANKTYPE_ID = BANKTYPE_ID; super.URL = URL; super.DISPLAY_DECIMALS = DISPLAY_DECIMALS; super.INPUT_TYPE_USERNAME = InputType.TYPE_CLASS_TEXT | +InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; super.INPUT_HINT_USERNAME = context.getString(R.string.email); currency = context.getString(R.string.points); }
From source file:com.ccxt.whl.activity.RegisterActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); DeviceUuidFactory uuid = new DeviceUuidFactory(this); uid = uuid.getDeviceUuid().toString(); emailEditText = (EditText) findViewById(R.id.email); emailEditText.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);//?? userNameEditText = (EditText) findViewById(R.id.username); passwordEditText = (EditText) findViewById(R.id.password); confirmPwdEditText = (EditText) findViewById(R.id.confirm_password); rg = (RadioGroup) findViewById(R.id.sex); b1 = (RadioButton) findViewById(R.id.male); b2 = (RadioButton) findViewById(R.id.female); rg.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override//from w ww.ja va 2 s .c o m public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub if (checkedId == b1.getId()) { sex = "1"; Toast.makeText(RegisterActivity.this, "", Toast.LENGTH_LONG).show(); } if (checkedId == b2.getId()) { sex = "2"; Toast.makeText(RegisterActivity.this, "", Toast.LENGTH_LONG).show(); } } }); }
From source file:au.com.domain.AccountsAutoCompleteTextView.java
private void init(Context context) { addView(mAccountsAutocomplete = new AutoCompleteTextView(context)); mAccountsAutocomplete.setImeOptions(EditorInfo.IME_ACTION_NEXT); mAccountsAutocomplete.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS); if (TextUtils.isEmpty(getHint())) { setHint("Email"); }//from w w w .java2 s . c om // TODO Make this a custom attr (currently does nothing) mThreshold = mAccountsAutocomplete.getThreshold(); setAccountOptions(); mAccountsAutocomplete.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean b) { if (b && !isPermissionGranted()) { mAccountsAutocomplete.showDropDown(); } } }); mAccountsAutocomplete.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { String currentText = charSequence.toString(); if (!currentText.equalsIgnoreCase(getContext().getString(R.string.allow_accounts_suggestion))) { mCurrentText = charSequence.toString(); } } @Override public void afterTextChanged(Editable editable) { if (isErrorEnabled()) { setError(null); setErrorEnabled(false); } } }); }
From source file:foo.fruitfox.evend.LoginActivity.java
private void setLayout(String type, LinearLayout activityLayout) { login = (Button) findViewById(R.id.login); register = (Button) findViewById(R.id.register); username = (EditText) findViewById(R.id.username); usernameLabel = (TextView) findViewById(R.id.usernameLabel); switch (type) { case "phone": username.setInputType(InputType.TYPE_CLASS_PHONE); username.setText(getPhoneNumber()); usernameLabel.setText("Phone Number"); login.setVisibility(View.GONE); register.setVisibility(View.VISIBLE); break;/*from w ww . ja v a 2s .c o m*/ case "email": username.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS); // TODO: Remove this Hardcoding username.setText("john@example.com"); usernameLabel.setText("E-Mail"); login.setVisibility(View.GONE); register.setVisibility(View.VISIBLE); break; } setContentView(activityLayout); }
From source file:com.scigames.slidegame.Registration5EmailActivity.java
/** Called with the activity is first created. */ @Override/*w w w . j a va2s .c om*/ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(TAG, "super.OnCreate"); Intent i = getIntent(); Log.d(TAG, "getIntent"); firstNameIn = i.getStringExtra("fName"); lastNameIn = i.getStringExtra("lName"); studentIdIn = i.getStringExtra("studentId"); visitIdIn = i.getStringExtra("visitId"); Log.d(TAG, "...getStringExtra"); // Inflate our UI from its XML layout description. setContentView(R.layout.registration5_email); Log.d(TAG, "...setContentView"); email = (EditText) findViewById(R.id.email); /* to hide the keyboard on launch, then open when tap in firstname field */ email.setInputType(InputType.TYPE_NULL); email.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { email.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS); email.onTouchEvent(event); // call native handler return true; // consume touch even } }); Log.d(TAG, "...instantiateEditTexts"); //display name in greeting sentence Resources res = getResources(); TextView greets = (TextView) findViewById(R.id.greeting); greets.setText(String.format(res.getString(R.string.greeting), firstNameIn, lastNameIn)); Log.d(TAG, greets.toString()); Log.d(TAG, "...Greetings"); // Hook up button presses to the appropriate event handler. ((Button) findViewById(R.id.back)).setOnClickListener(mBackListener); ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener); Log.d(TAG, "...instantiateButtons"); //set listener task.setOnResultsListener(this); }
From source file:com.ccxt.whl.activity.LoginActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); usernameEditText = (EditText) findViewById(R.id.username); usernameEditText.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);//?? passwordEditText = (EditText) findViewById(R.id.password); // ????// ww w . j a v a 2s.c o m // if (DemoApplication.getInstance().getUserName() != null && DemoApplication.getInstance().getPassword() != null) { if (DemoApplication.getInstance().getUser() != null && DemoApplication.getInstance().getPassword() != null) { startActivity(new Intent(this, MainActivity.class)); finish(); } // ???? usernameEditText.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { passwordEditText.setText(null); } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void afterTextChanged(Editable s) { } }); mAuthorization = Frontia.getAuthorization();// DeviceUuidFactory uuid = new DeviceUuidFactory(this); uid = uuid.getDeviceUuid().toString(); }