本文整理汇总了Java中android.support.design.widget.TextInputLayout.getEditText方法的典型用法代码示例。如果您正苦于以下问题:Java TextInputLayout.getEditText方法的具体用法?Java TextInputLayout.getEditText怎么用?Java TextInputLayout.getEditText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.design.widget.TextInputLayout
的用法示例。
在下文中一共展示了TextInputLayout.getEditText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: changePacketSelection
import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
private void changePacketSelection(@NonNull Packet packet) {
final LayoutInflater inflater = getLayoutInflater();
final ViewGroup formContainer = this.formContainer;
TransitionManager.beginDelayedTransition(formContainer, new AutoTransition().setDuration(150));
formContainer.removeAllViews();
final PacketParameter[] parameters = packet.parameters;
final int paramLen = parameters.length;
for (int i = 0; i < paramLen; i++) {
final PacketParameter param = parameters[i];
final TextInputLayout inputLayout = (TextInputLayout) inflater.inflate(R.layout.input_field, formContainer, false);
inputLayout.setTag(param);
inputLayout.setHint(param.id());
final EditText inputField = inputLayout.getEditText();
if (inputField != null) {
inputField.setText(param.value());
}
formContainer.addView(inputLayout);
}
}
示例2: initViews
import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
private void initViews()
{
mEmailWrapper = (TextInputLayout) findViewById(R.id.user_email_wrapper_register);
mPasswordWrapper = (TextInputLayout) findViewById(R.id.user_password_wrapper);
mFirstNameWrapper = (TextInputLayout) findViewById(R.id.user_first_name_wrapper);
mLastNameWrapper = (TextInputLayout) findViewById(R.id.user_last_name_wrapper);
mConfirmWrapper = (TextInputLayout) findViewById(R.id.password_confirm_wrapper);
mVehichleTypeSpinner = (Spinner) findViewById(R.id.SpinnerVehicleType);
mRouteSpinner = (Spinner) findViewById(R.id.SpinnerRoute);
mEmaiEdit = mEmailWrapper.getEditText();
mPasswordEdit = mPasswordWrapper.getEditText();
mConfirmEdit = mConfirmWrapper.getEditText();
mFirstNameEdit = mFirstNameWrapper.getEditText();
mLastNameEdit = mLastNameWrapper.getEditText();
mRegisterBtn = (Button) findViewById(R.id.btn_signup);
mLinkLogin = (TextView) findViewById(R.id.link_login);
mRegisterBtn.setOnClickListener(this);
mLinkLogin.setOnClickListener(this);
}
示例3: getAnswers
import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
public List<String> getAnswers() {
List<String> answers = new ArrayList<>();
if (questionEditText == null || TextUtils.isEmpty(questionEditText.getText())) {
return answers;
}
for (int i = 0; i < inputLayout.getChildCount(); ++i) {
if (inputLayout.getChildAt(i) instanceof TextInputLayout) {
TextInputLayout til = (TextInputLayout) inputLayout.getChildAt(i);
EditText editText = til.getEditText();
if(editText!=null){
answers.add(editText.getEditableText().toString());
}
}
}
return answers;
}
示例4: AbstractValidator
import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
AbstractValidator(TextInputLayout layout, String errorMessage) {
this.layout = layout;
this.editText = layout.getEditText();
this.errorMessage = errorMessage;
this.hasError = false;
addTextChangeListener();
}
示例5: onCreateDialog
import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// creazione 'manuale' del dialog
int margin = getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin);
LinearLayout rootView = new LinearLayout(getActivity());
rootView.setOrientation(LinearLayout.VERTICAL);
rootView.setPadding(margin, margin, margin, margin);
mTxtInput = new TextInputLayout(getActivity());
mTxtInput.addView(new EditText(getActivity()));
mTxtInput.setHint(getString(R.string.api_key_title));
if (mTxtInput.getEditText() != null) {
mTxtInput.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
mTxtInput.getEditText().setHighlightColor(Color.YELLOW);
}
rootView.addView(mTxtInput);
// Setto l'edit text con il testo dell'api key se presente
String apiKey = SharedPrefsHelper.getInstance().getApiKey(getActivity());
if(apiKey != null)
mTxtInput.getEditText().setText(apiKey);
AlertDialog dialog = new AlertDialog.Builder(getActivity())
.setTitle(getString(R.string.title_insert_api_key))
.setView(rootView)
//.setCancelable(false)
.setPositiveButton(getString(R.string.salva), null)
.setNegativeButton(SharedPrefsHelper.getInstance()
.isApiKeyRegistered(getActivity()) ? getString(R.string.annulla) : getString(R.string.esci_app), this)
.create();
dialog.setOnShowListener(this);
return dialog;
}
示例6: ConfirmPasswordValidator
import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
public ConfirmPasswordValidator(TextInputLayout passwordLayout, TextInputLayout confirmPasswordLayout, String errorMessage) {
super(confirmPasswordLayout, errorMessage);
this.passwordEditText = passwordLayout.getEditText();
}
示例7: toString
import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
public static String toString(@NonNull TextInputLayout textInputLayout) {
return textInputLayout.getEditText() != null ? toString(textInputLayout.getEditText()) : "";
}