本文整理匯總了Java中android.support.design.widget.TextInputEditText類的典型用法代碼示例。如果您正苦於以下問題:Java TextInputEditText類的具體用法?Java TextInputEditText怎麽用?Java TextInputEditText使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TextInputEditText類屬於android.support.design.widget包,在下文中一共展示了TextInputEditText類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreateView
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_payment_information, container, false);
AppCompatSpinner cardType = (AppCompatSpinner) view.findViewById(R.id.card_type);
TextInputEditText cardNumber = (TextInputEditText) view.findViewById(R.id.card_number);
TextInputEditText expirationDate = (TextInputEditText) view.findViewById(R.id.expiration_date);
TextInputEditText securityCode = (TextInputEditText) view.findViewById(R.id.security_code);
TextView cardTypeError = (TextView) view.findViewById(R.id.card_type_error);
view.findViewById(R.id.submit).setOnClickListener(this);
validator =
new PaymentInformationFormValidator(cardType, cardNumber, expirationDate, securityCode, cardTypeError);
return view;
}
示例2: addWords
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
public void addWords() {
LayoutInflater inflater = activity.getLayoutInflater();
View mView = inflater.inflate(R.layout.dialog_edit_extra_words, (ViewGroup) activity.findViewById(R.id.dialog_layout_edit_words));
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.add);
final TextInputEditText word_1 = mView.findViewById(R.id.edittext_edit_word_1);
final TextInputEditText word_2 = mView.findViewById(R.id.edittext_edit_word_2);
builder.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String edit_1 = word_1.getText().toString();
String edit_2 = word_2.getText().toString();
if (!edit_1.isEmpty() && !edit_2.isEmpty()) {
ExtraWord.add(new String[]{edit_1, edit_2});
hasEdited = true;
notifyDataSetChanged();
} else {
Toast.makeText(activity, R.string.edit_extra_words_error, Toast.LENGTH_SHORT).show();
}
}
});
builder.setNegativeButton(android.R.string.no, null);
builder.setView(mView);
builder.show();
}
示例3: findViews
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
private void findViews() {
toolbar = (Toolbar) findViewById(R.id.air_toolbar);
inputTitle = (TextInputEditText) findViewById(R.id.air_inputTitle);
inputDescription = (TextInputEditText) findViewById(R.id.air_inputDescription);
textDeviceInfo = (TextView) findViewById(R.id.air_textDeviceInfo);
buttonDeviceInfo = (ImageButton) findViewById(R.id.air_buttonDeviceInfo);
layoutDeviceInfo = (ExpandableRelativeLayout) findViewById(R.id.air_layoutDeviceInfo);
inputUsername = (TextInputEditText) findViewById(R.id.air_inputUsername);
inputPassword = (TextInputEditText) findViewById(R.id.air_inputPassword);
inputEmail = (TextInputEditText) findViewById(R.id.air_inputEmail);
optionUseAccount = (RadioButton) findViewById(R.id.air_optionUseAccount);
optionAnonymous = (RadioButton) findViewById(R.id.air_optionAnonymous);
layoutLogin = (ExpandableRelativeLayout) findViewById(R.id.air_layoutLogin);
layoutAnonymous = (ExpandableRelativeLayout) findViewById(R.id.air_layoutGuest);
buttonSend = (FloatingActionButton) findViewById(R.id.air_buttonSend);
}
開發者ID:feifadaima,項目名稱:https-github.com-hyb1996-NoRootScriptDroid,代碼行數:20,代碼來源:AbstractIssueReporterActivity.java
示例4: onCreateView
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
//noinspection ConstantConditions
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
View view = inflater.inflate(R.layout.dialog_edit_item, container, false);
mTilValue = (TextInputLayout) view.findViewById(R.id.tilValue);
mEtValue = (TextInputEditText) view.findViewById(R.id.etValue);
view.findViewById(R.id.bPositive).setOnClickListener(this);
view.findViewById(R.id.bNegative).setOnClickListener(this);
return view;
}
示例5: CommonDialog
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
public CommonDialog(Context context) {
view = LayoutInflater.from(context).inflate(R.layout.dialog_common, null, false);
tvMessage = (TextView) view.findViewById(R.id.tv_message);
btOk = (Button) view.findViewById(R.id.bt_ok);
btCancel = (Button) view.findViewById(R.id.bt_cancel);
tvTitle = (TextView) view.findViewById(R.id.tv_title);
tvMessageRoot = (LinearLayout) view.findViewById(R.id.tv_message_root);
inputArea = (TextInputEditText) view.findViewById(R.id.input_area);
inputRoot = (TextInputLayout) view.findViewById(R.id.input_root);
inputRoot.setVisibility(View.GONE);
tvMessageRoot.setVisibility(View.GONE);
tvTitle.setVisibility(View.GONE);
tvMessage.setVisibility(View.GONE);
btOk.setVisibility(View.GONE);
btCancel.setVisibility(View.GONE);
builder = new AlertDialog.Builder(context)
.setView(view);
}
示例6: initViews
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
/**
* This method is to initialize views
*/
private void initViews() {
nestedScrollView = (NestedScrollView) findViewById(R.id.nestedScrollView);
textInputLayoutName = (TextInputLayout) findViewById(R.id.textInputLayoutName);
textInputLayoutEmail = (TextInputLayout) findViewById(R.id.textInputLayoutEmail);
textInputLayoutPassword = (TextInputLayout) findViewById(R.id.textInputLayoutPassword);
textInputLayoutConfirmPassword = (TextInputLayout) findViewById(R.id.textInputLayoutConfirmPassword);
textInputEditTextName = (TextInputEditText) findViewById(R.id.textInputEditTextName);
textInputEditTextEmail = (TextInputEditText) findViewById(R.id.textInputEditTextEmail);
textInputEditTextPassword = (TextInputEditText) findViewById(R.id.textInputEditTextPassword);
textInputEditTextConfirmPassword = (TextInputEditText) findViewById(R.id.textInputEditTextConfirmPassword);
appCompatButtonRegister = (AppCompatButton) findViewById(R.id.appCompatButtonRegister);
appCompatTextViewLoginLink = (AppCompatTextView) findViewById(R.id.appCompatTextViewLoginLink);
}
示例7: onCreate
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
// Set up the login form.
mServerView = (TextInputEditText) findViewById(R.id.server);
mUsernameView = (TextInputEditText) findViewById(R.id.user);
mPasswordView = (TextInputEditText) findViewById(R.id.password);
mSignInButton = (Button) findViewById(R.id.user_sign_in_button);
mLoginFormView = findViewById(R.id.login_form);
mProgressView = findViewById(R.id.login_progress);
addListenerOnButton();
mUsernameView.requestFocus();
}
示例8: onCreate
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lock);
final TextInputEditText pass=(TextInputEditText) findViewById(R.id.etPassword);
Button submit=(Button) findViewById(R.id.submit_button);
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String password=pass.getText().toString();
DataBase data=DataBase.getInstance(LockActivity.this);
data.insertPass(password);
pass.setText("");
Intent i=new Intent(LockActivity.this,Util.class);
startActivity(i);
}
});
}
示例9: onCreateView
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_address, container, false);
TextInputEditText address = (TextInputEditText) view.findViewById(R.id.address);
TextInputEditText city = (TextInputEditText) view.findViewById(R.id.city);
AppCompatSpinner state = (AppCompatSpinner) view.findViewById(R.id.state);
TextView stateError = (TextView) view.findViewById(R.id.state_error);
TextInputEditText zipCode = (TextInputEditText) view.findViewById(R.id.zip_code);
AppCompatSpinner country = (AppCompatSpinner) view.findViewById(R.id.country);
TextView countryError = (TextView) view.findViewById(R.id.country_error);
view.findViewById(R.id.submit).setOnClickListener(this);
validator = new AddressFormValidator(address, city, state, zipCode, country, stateError, countryError);
return view;
}
示例10: createInput
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
private static TextInputLayout createInput(Context context, Field field, Object action) {
try {
field.setAccessible(true);
String name = field.getName();
Object value = field.get(action);
String valueStr = value != null ? value.toString() : null;
TextInputLayout layout = new TextInputLayout(context);
layout.setHint(name);
TextInputEditText editText = new TextInputEditText(context);
editText.setText(valueStr);
layout.setTag(field);
layout.addView(editText, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
return layout;
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
示例11: onCreate
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
location = (TextInputEditText) findViewById(R.id.etLocation);
location.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
showPlacePickerDialog();
}
return false;
}
});
}
示例12: onCreateView
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_marker_manage, container, false);
/* The view fields */
mNameEditText = (TextInputEditText) rootView.findViewById(R.id.marker_name_id);
mLatEditText = (TextInputEditText) rootView.findViewById(R.id.marker_lat_id);
mLonEditText = (TextInputEditText) rootView.findViewById(R.id.marker_lon_id);
mProjectionLabel = (TextView) rootView.findViewById(R.id.marker_proj_label_id);
mProjectionX = (TextInputEditText) rootView.findViewById(R.id.marker_proj_x_id);
mProjectionY = (TextInputEditText) rootView.findViewById(R.id.marker_proj_y_id);
mComment = (EditText) rootView.findViewById(R.id.marker_comment_id);
mMap = mMapProvider.getCurrentMap();
mMarker = mMarkerProvider.getCurrentMarker();
updateView();
return rootView;
}
示例13: onCreate
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
activityComponent().inject(this);
mPresenter.attachView(this);
inputEmail = (TextInputEditText) findViewById(R.id.login_email);
inputPassword = (EditText) findViewById(R.id.login_password);
Button loginButton = (Button) findViewById(R.id.button_login);
loginButton.setOnClickListener(view -> loginClicked());
TextView forgotPassword = (TextView) findViewById(R.id.forgot_password);
forgotPassword.setOnClickListener(view -> gotoForgot());
TextView registerButton = (TextView) findViewById(R.id.login_link_register);
registerButton.setOnClickListener(view -> gotoRegister());
ImageView loginAccounts = (ImageView) findViewById(R.id.login_account_button);
loginAccounts.setOnClickListener(view -> onClickAccountSwitch());
ViewUtil.hideKeyboard(this);
}
示例14: onCreate
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
activityComponent().inject(this);
registerPresenter.attachView(this);
inputName = (TextInputEditText) findViewById(R.id.register_input_name);
inputPassword = (TextInputEditText) findViewById(R.id.register_password);
inputEmail = (TextInputEditText) findViewById(R.id.register_input_email);
Button register = (Button) findViewById(R.id.button_register);
register.setOnClickListener(view -> registerClicked());
TextView loginLink = (TextView) findViewById(R.id.link_login);
loginLink.setOnClickListener(view -> gotoLogin());
ViewUtil.hideKeyboard(this);
}
示例15: onAcademicLoaded
import android.support.design.widget.TextInputEditText; //導入依賴的package包/類
@Override
public void onAcademicLoaded(Academic loadedAcademic) {
hideLoading();
academic = loadedAcademic;
ImageView imageView = (ImageView) findViewById(R.id.profile_pic_view);
Glide.with(this).load(academic.getImage()).error(R.drawable.profile).into(imageView);
TextView nameView = (TextView) findViewById(R.id.name_edit);
nameView.setText(academic.getName());
emailView = (TextInputEditText) findViewById(R.id.email_edit);
emailView.setText(academic.getPublicEmail());
phoneView = (TextInputEditText) findViewById(R.id.phone_edit);
phoneView.setText(academic.getPhone());
bioView = (TextInputEditText) findViewById(R.id.bio_edit);
bioView.setText(academic.getBio());
roomView = (TextInputEditText) findViewById(R.id.room_edit);
roomView.setText(academic.getRoom());
}