List of usage examples for android.text InputType TYPE_CLASS_PHONE
int TYPE_CLASS_PHONE
To view the source code for android.text InputType TYPE_CLASS_PHONE.
Click Source Link
From source file:com.safecell.ManageProfile_Activity.java
private int setInputTypeKeyBoard(int position) { int inputType = 0; switch (position) { case 0://from w w w . j a va 2s . c o m inputType = InputType.TYPE_MASK_CLASS | InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS; break; case 1: inputType = InputType.TYPE_MASK_CLASS | InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS; break; case 2: inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; break; case 3: inputType = InputType.TYPE_CLASS_PHONE; break; } return inputType; }
From source file:miguelmaciel.play.anonymouscall.ui.ContactsListFragment.java
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // Sends a request to the People app to display the create contact screen case R.id.menu_add_contact: final Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI); startActivity(intent);// ww w . ja v a 2s.c om break; // For platforms earlier than Android 3.0, triggers the search activity case R.id.menu_search: if (!Utils.hasHoneycomb()) { getActivity().onSearchRequested(); } break; // To enter a specific phone number to make a call case R.id.menu_call_number: AlertDialog.Builder alert; alert = new AlertDialog.Builder(getActivity()); alert.setTitle("Insert Phone Number"); // Set an EditText view to get user input final EditText input = new EditText(getActivity()); input.setInputType(InputType.TYPE_CLASS_PHONE); input.setHint("Click to Insert Number"); alert.setView(input); alert.setPositiveButton("Call", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { String value = input.getText().toString(); callPhoneNumber(value); } }); alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { // Canceled. } }); alert.show(); break; } return super.onOptionsItemSelected(item); }
From source file:com.facebook.react.views.textinput.ReactTextInputManager.java
@ReactProp(name = "keyboardType") public void setKeyboardType(ReactEditText view, @Nullable String keyboardType) { int flagsToSet = InputType.TYPE_CLASS_TEXT; if (KEYBOARD_TYPE_NUMERIC.equalsIgnoreCase(keyboardType)) { flagsToSet = INPUT_TYPE_KEYBOARD_NUMBERED; } else if (KEYBOARD_TYPE_EMAIL_ADDRESS.equalsIgnoreCase(keyboardType)) { flagsToSet = InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS | InputType.TYPE_CLASS_TEXT; } else if (KEYBOARD_TYPE_PHONE_PAD.equalsIgnoreCase(keyboardType)) { flagsToSet = InputType.TYPE_CLASS_PHONE; }/*from w w w . j ava 2 s.c o m*/ updateStagedInputTypeFlag(view, INPUT_TYPE_KEYBOARD_NUMBERED | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS | InputType.TYPE_CLASS_TEXT, flagsToSet); checkPasswordType(view); }
From source file:com.roiland.crm.sm.ui.view.ScOppoInfoFragment.java
/** * //from ww w . j a v a2s . c o m * <pre> * ? * </pre> * * @param isDetail ?? */ public void displayCustomerInfo(boolean isDetail) { if (customerInfo == null) { customerInfo = new ArrayList<BasicInfoListAdapter.Info>(); } if (project == null) { project = new Project(); } if (!isOldCust()) { project.setCustomer(getUpdatedCustomer()); } // if (!isDetail) { customerInfo.clear(); if (addFlag) { customerInfo.add(custNameInfo = new BasicInfoListAdapter.Info(getString(R.string.custName), BaseInfoRowViewItem.RIGHT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustName() : null), true, true)); } else { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custName), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustName() : null), true)); } customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custFrom), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustFrom() : null), true)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custType), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustType() : null), true)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.infoFrom), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getInfoFrom() : null), true)); if (addFlag) { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.collectFrom), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCollectFrom() : null), true)); } customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custMobile), BaseInfoRowViewItem.MOBILETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustMobile() : null), false, InputType.TYPE_CLASS_NUMBER)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custOtherPhone), BaseInfoRowViewItem.PSTNTEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustOtherPhone() : null), false, InputType.TYPE_CLASS_PHONE)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.comment), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustComment() : null), false)); } else { customerInfo.clear(); if (addFlag) { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custName), BaseInfoRowViewItem.RIGHT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustName() : null), true)); } else { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custName), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustName() : null), true)); } customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custFrom), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustFrom() : null), true)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custType), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustType() : null), true)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.infoFrom), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getInfoFrom() : null), true)); if (addFlag) { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.collectFrom), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCollectFrom() : null), true)); } customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custMobile), BaseInfoRowViewItem.MOBILETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustMobile() : null), false, InputType.TYPE_CLASS_NUMBER)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custOtherPhone), BaseInfoRowViewItem.PSTNTEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustOtherPhone() : null), false, InputType.TYPE_CLASS_PHONE)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.gender), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getGender() : null), false)); if (isSubmitNewCar() || isSubmitNewCar) { customerInfo.add(birthdayInfo = new BasicInfoListAdapter.Info(getString(R.string.birthday), BaseInfoRowViewItem.DATE_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getBirthday() : null), true)); customerInfo.add(idtypeInfo = new BasicInfoListAdapter.Info(getString(R.string.idType), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getIdType() : null), true)); customerInfo.add(idnumberInfo = new BasicInfoListAdapter.Info(getString(R.string.idNumber), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getIdNumber() : null), true)); } else { customerInfo.add(birthdayInfo = new BasicInfoListAdapter.Info(getString(R.string.birthday), BaseInfoRowViewItem.DATE_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getBirthday() : null), false)); customerInfo.add(idtypeInfo = new BasicInfoListAdapter.Info(getString(R.string.idType), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getIdType() : null), false)); customerInfo.add(idnumberInfo = new BasicInfoListAdapter.Info(getString(R.string.idNumber), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getIdNumber() : null), false)); } if (addFlag && !oldCustCollect) { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.province), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getProvince() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.city), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCity() : null), false, false)); } else { if (isSubmitNewCar() || isSubmitNewCar) { // customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.province), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getProvince() : null), true)); if (StringUtils.isEmpty(project.getCustomer().getProvince())) { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.city), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCity() : null), true, false)); } else { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.city), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCity() : null), true)); } } else { //? customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.province), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getProvince() : null), false)); if (StringUtils.isEmpty(project.getCustomer().getProvince())) { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.city), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCity() : null), false, false)); } else { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.city), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCity() : null), false)); } } } if (addFlag && !oldCustCollect || StringUtils.isEmpty(project.getCustomer().getCity())) { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.district), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getDistrict() : null), false, false)); } else { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.district), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getDistrict() : null), false)); } customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.qq), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getQq() : null), false, InputType.TYPE_CLASS_NUMBER)); if (isSubmitNewCar() || isSubmitNewCar) { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.address), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getAddress() : null), true)); } else { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.address), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getAddress() : null), false)); } customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.postcode), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getPostcode() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.email), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getEmail() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.convContactTime), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getConvContactTime() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.expectContactWay), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getExpectContactWay() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.fax), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getFax() : null), false)); if (isSubmitNewCar() || isSubmitNewCar) { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.existingCar), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getExistingCar() : null), true)); } else { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.existingCar), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getExistingCar() : null), false)); } customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.industry), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getIndustry() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.position), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getPosition() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.education), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getEducation() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.existingcarbrand), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getExistingCarBrand() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custInterest1), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustInterest1() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custInterest2), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustInterest2() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.custInterest3), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustInterest3() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.existLisenPlate), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getExistLisenPlate() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.enterpType), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getEnterpType() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.enterpPeopleCount), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getEnterpPeopleCount() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.registeredCapital), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getRegisteredCapital() : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.compeCarModel), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCompeCarModel() : null), false)); if (addFlag) { if (isOldCust) { project.getCustomer().setRebuyStoreCustTag(true); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.rebuyStoreCustTag), BaseInfoRowViewItem.BOOLEAN2_TYPE, null, (project != null && project.getCustomer() != null && project.getCustomer().getRebuyStoreCustTag() != null ? "true" : null), false, false)); } else { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.rebuyStoreCustTag), BaseInfoRowViewItem.BOOLEAN2_TYPE, null, (project != null && project.getCustomer() != null && project.getCustomer().getRebuyStoreCustTag() != null ? "false" : null), false, false)); } } else { customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.rebuyStoreCustTag), BaseInfoRowViewItem.BOOLEAN2_TYPE, null, (project != null && project.getCustomer() != null && project.getCustomer().getRebuyStoreCustTag() != null ? (project.getCustomer().getRebuyStoreCustTag() ? "true" : "false") : null), false, false)); } customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.rebuyOnlineCustTag), BaseInfoRowViewItem.BOOLEAN2_TYPE, null, (project != null && project.getCustomer() != null && project.getCustomer().getRebuyOnlineCustTag() != null ? (project.getCustomer().getRebuyOnlineCustTag() ? "true" : "false") : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.changeCustTag), BaseInfoRowViewItem.BOOLEAN2_TYPE, null, (project != null && project.getCustomer() != null && project.getCustomer().getChangeCustTag() != null ? (project.getCustomer().getChangeCustTag() ? "true" : "false") : null), false)); customerInfo.add(oldCustInfo = new BasicInfoListAdapter.Info(getString(R.string.regularCustTag), BaseInfoRowViewItem.BOOLEAN2_TYPE, null, (project != null && project.getCustomer() != null && project.getCustomer().getRegularCustTag() != null ? (project.getCustomer().getRegularCustTag() ? "true" : "false") : "false"), false)); //?? if ("true".equals(oldCustInfo.value)) { customerInfo.add(oldCustSelectInfo = new BasicInfoListAdapter.Info(getString(R.string.regularCust), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getRegularCust() : null), true)); } else { customerInfo.add(oldCustSelectInfo = new BasicInfoListAdapter.Info(getString(R.string.regularCust), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getRegularCust() : null), false, false)); } customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.loanCustTag), BaseInfoRowViewItem.BOOLEAN2_TYPE, null, (project != null && project.getCustomer() != null && project.getCustomer().getLoanCustTag() != null ? (project.getCustomer().getLoanCustTag() ? "true" : "false") : null), false)); customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.headerQuartCustTag), BaseInfoRowViewItem.BOOLEAN2_TYPE, null, (project != null && project.getCustomer() != null && project.getCustomer().getHeaderQuartCustTag() != null ? (project.getCustomer().getHeaderQuartCustTag() ? "true" : "false") : null), false)); customerInfo.add(bigCustInfo = new BasicInfoListAdapter.Info(getString(R.string.bigCustTag), BaseInfoRowViewItem.BOOLEAN2_TYPE, null, (project != null && project.getCustomer() != null && project.getCustomer().getBigCustTag() != null ? (project.getCustomer().getBigCustTag() ? "true" : "false") : "false"), false)); //? if ("true".equals(bigCustInfo.value)) { customerInfo.add(bigCustSelectInfo = new BasicInfoListAdapter.Info(getString(R.string.bigCusts), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getBigCusts() : null), true)); } else { customerInfo.add(bigCustSelectInfo = new BasicInfoListAdapter.Info(getString(R.string.bigCusts), BaseInfoRowViewItem.SELECTION_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getBigCusts() : null), false, false)); } customerInfo.add(new BasicInfoListAdapter.Info(getString(R.string.comment), BaseInfoRowViewItem.SIMPLETEXT_TYPE, null, (project != null && project.getCustomer() != null ? project.getCustomer().getCustComment() : null), false)); customerInfoCaches = new ArrayList<BasicInfoListAdapter.Info>(); customerInfoCaches.addAll(customerInfo); } customerInfoAdapter.setContentList(customerInfo); customerInfoAdapter.notifyDataSetChanged(); if (addFlag) { customerInfoAdapter.setEditable(true); } refreshCustList(); }
From source file:com.ccxt.whl.activity.SettingsFragmentCopy.java
/** * /*w w w . j a v a2 s . c o m*/ */ public void change_age(String age) { final EditText texta = new EditText(getActivity()); texta.setText(age); //EditText texta.setKeyListener(new NumberKeyListener() { public int getInputType() { return InputType.TYPE_CLASS_PHONE; } @Override protected char[] getAcceptedChars() { // TODO Auto-generated method stub char[] numbers = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; return numbers; } }); new AlertDialog.Builder(getActivity()).setTitle("") .setIcon(android.R.drawable.ic_dialog_info).setView(texta) .setPositiveButton("", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { String age = texta.getEditableText().toString(); RequestParams params = new RequestParams(); params.add("user", DemoApplication.getInstance().getUser()); params.add("age", age); params.add("param", "age"); HttpRestClient.get(Constant.UPDATE_USER_URL, params, responseHandler); dialog.dismiss(); //? } }).setNegativeButton("?", null).show(); //return true; }
From source file:com.goftagram.telegram.ui.PasscodeActivity.java
private void updateDropDownTextView() { if (dropDown != null) { if (currentPasswordType == 0) { dropDown.setText(LocaleController.getString("PasscodePIN", R.string.PasscodePIN)); } else if (currentPasswordType == 1) { dropDown.setText(LocaleController.getString("PasscodePassword", R.string.PasscodePassword)); }// w w w.j av a 2s . co m } if (type == 1 && currentPasswordType == 0 || type == 2 && UserConfig.passcodeType == 0) { InputFilter[] filterArray = new InputFilter[1]; filterArray[0] = new InputFilter.LengthFilter(4); passwordEditText.setFilters(filterArray); passwordEditText.setInputType(InputType.TYPE_CLASS_PHONE); passwordEditText.setKeyListener(DigitsKeyListener.getInstance("1234567890")); } else if (type == 1 && currentPasswordType == 1 || type == 2 && UserConfig.passcodeType == 1) { passwordEditText.setFilters(new InputFilter[0]); passwordEditText.setKeyListener(null); passwordEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); } passwordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance()); }
From source file:kr.wdream.ui.PasscodeActivity.java
private void updateDropDownTextView() { if (dropDown != null) { if (currentPasswordType == 0) { dropDown.setText(/*from www. j a v a 2 s .c o m*/ LocaleController.getString("PasscodePIN", kr.wdream.storyshop.R.string.PasscodePIN)); } else if (currentPasswordType == 1) { dropDown.setText(LocaleController.getString("PasscodePassword", kr.wdream.storyshop.R.string.PasscodePassword)); } } if (type == 1 && currentPasswordType == 0 || type == 2 && UserConfig.passcodeType == 0) { InputFilter[] filterArray = new InputFilter[1]; filterArray[0] = new InputFilter.LengthFilter(4); passwordEditText.setFilters(filterArray); passwordEditText.setInputType(InputType.TYPE_CLASS_PHONE); passwordEditText.setKeyListener(DigitsKeyListener.getInstance("1234567890")); } else if (type == 1 && currentPasswordType == 1 || type == 2 && UserConfig.passcodeType == 1) { passwordEditText.setFilters(new InputFilter[0]); passwordEditText.setKeyListener(null); passwordEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); } passwordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance()); }
From source file:com.b44t.ui.PasscodeActivity.java
private void updateDropDownTextView() { if (dropDown != null) { if (currentPasswordType == 0) { dropDown.setText(LocaleController.getString("PasscodePIN", R.string.PasscodePIN)); } else if (currentPasswordType == 1) { dropDown.setText(LocaleController.getString("PasscodePassword", R.string.PasscodePassword)); }/*from ww w.j a v a 2 s. c o m*/ } if (screen == SCREEN1_ENTER_CODE1 && currentPasswordType == 0 || screen == SCREEN2_ENTER_CODE2 && UserConfig.passcodeType == 0) { InputFilter[] filterArray = new InputFilter[1]; filterArray[0] = new InputFilter.LengthFilter(4); passwordEditText.setFilters(filterArray); passwordEditText.setInputType(InputType.TYPE_CLASS_PHONE); passwordEditText.setKeyListener(DigitsKeyListener.getInstance("1234567890")); } else if (screen == SCREEN1_ENTER_CODE1 && currentPasswordType == 1 || screen == SCREEN2_ENTER_CODE2 && UserConfig.passcodeType == 1) { passwordEditText.setFilters(new InputFilter[0]); passwordEditText.setKeyListener(null); passwordEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); } passwordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance()); }
From source file:ir.besteveryeverapp.ui.PasscodeActivity.java
private void updateDropDownTextView() { if (dropDown != null) { if (currentPasswordType == 0) { dropDown.setText(LocaleController.getString("PasscodePIN", ir.besteveryeverapp.telegram.R.string.PasscodePIN)); } else if (currentPasswordType == 1) { dropDown.setText(LocaleController.getString("PasscodePassword", ir.besteveryeverapp.telegram.R.string.PasscodePassword)); }/*ww w . j a va 2 s . c o m*/ } if (type == 1 && currentPasswordType == 0 || type == 2 && UserConfig.passcodeType == 0) { InputFilter[] filterArray = new InputFilter[1]; filterArray[0] = new InputFilter.LengthFilter(4); passwordEditText.setFilters(filterArray); passwordEditText.setInputType(InputType.TYPE_CLASS_PHONE); passwordEditText.setKeyListener(DigitsKeyListener.getInstance("1234567890")); } else if (type == 1 && currentPasswordType == 1 || type == 2 && UserConfig.passcodeType == 1) { passwordEditText.setFilters(new InputFilter[0]); passwordEditText.setKeyListener(null); passwordEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); } passwordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance()); }
From source file:org.linphone.ContactEditorFragment.java
@SuppressLint("InflateParams") private View displayNumberOrAddress(final LinearLayout controls, String numberOrAddress, boolean forceAddNumber) { boolean isSip = LinphoneUtils.isStrictSipAddress(numberOrAddress) || !LinphoneUtils.isNumberAddress(numberOrAddress); if (isSip) {/* ww w. j av a2 s . c om*/ if (firstSipAddressIndex == -1) { firstSipAddressIndex = controls.getChildCount(); } numberOrAddress = numberOrAddress.replace("sip:", ""); } if ((getResources().getBoolean(R.bool.hide_phone_numbers_in_editor) && !isSip) || (getResources().getBoolean(R.bool.hide_sip_addresses_in_editor) && isSip)) { if (forceAddNumber) isSip = !isSip; // If number can't be displayed because we hide a sort of number, change that category else return null; } NewOrUpdatedNumberOrAddress tempNounoa; if (forceAddNumber) { tempNounoa = new NewOrUpdatedNumberOrAddress(isSip); } else { if (isNewContact || newSipOrNumberToAdd != null) { tempNounoa = new NewOrUpdatedNumberOrAddress(isSip, numberOrAddress); } else { tempNounoa = new NewOrUpdatedNumberOrAddress(numberOrAddress, isSip); } } final NewOrUpdatedNumberOrAddress nounoa = tempNounoa; numbersAndAddresses.add(nounoa); final View view = inflater.inflate(R.layout.contact_edit_row, null); final EditText noa = (EditText) view.findViewById(R.id.numoraddr); noa.setInputType(isSip ? InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS : InputType.TYPE_CLASS_PHONE); noa.setText(numberOrAddress); noa.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { nounoa.setNewNumberOrAddress(noa.getText().toString()); } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void afterTextChanged(Editable s) { } }); if (forceAddNumber) { nounoa.setNewNumberOrAddress(noa.getText().toString()); } ImageView delete = (ImageView) view.findViewById(R.id.delete_field); delete.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { nounoa.delete(); numbersAndAddresses.remove(nounoa); view.setVisibility(View.GONE); } }); return view; }