use of android.support.design.widget.TextInputLayout in project material-components-android by material-components.
the class TextInputLayoutActions method setCounterMaxLength.
public static ViewAction setCounterMaxLength(final int maxLength) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isAssignableFrom(TextInputLayout.class);
}
@Override
public String getDescription() {
return "Sets the counter max length";
}
@Override
public void perform(UiController uiController, View view) {
uiController.loopMainThreadUntilIdle();
TextInputLayout layout = (TextInputLayout) view;
layout.setCounterMaxLength(maxLength);
uiController.loopMainThreadUntilIdle();
}
};
}
use of android.support.design.widget.TextInputLayout in project material-components-android by material-components.
the class TextInputLayoutActions method setPasswordVisibilityToggleEnabled.
public static ViewAction setPasswordVisibilityToggleEnabled(final boolean enabled) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isAssignableFrom(TextInputLayout.class);
}
@Override
public String getDescription() {
return "Sets the error";
}
@Override
public void perform(UiController uiController, View view) {
uiController.loopMainThreadUntilIdle();
TextInputLayout layout = (TextInputLayout) view;
layout.setPasswordVisibilityToggleEnabled(enabled);
uiController.loopMainThreadUntilIdle();
}
};
}
use of android.support.design.widget.TextInputLayout in project material-components-android by material-components.
the class TextInputLayoutActions method setTypeface.
public static ViewAction setTypeface(final Typeface typeface) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isAssignableFrom(TextInputLayout.class);
}
@Override
public String getDescription() {
return "Sets the typeface";
}
@Override
public void perform(UiController uiController, View view) {
uiController.loopMainThreadUntilIdle();
TextInputLayout layout = (TextInputLayout) view;
layout.setTypeface(typeface);
uiController.loopMainThreadUntilIdle();
}
};
}
use of android.support.design.widget.TextInputLayout in project material-components-android by material-components.
the class TextInputLayoutActions method setError.
public static ViewAction setError(final CharSequence error) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isAssignableFrom(TextInputLayout.class);
}
@Override
public String getDescription() {
return "Sets the error";
}
@Override
public void perform(UiController uiController, View view) {
uiController.loopMainThreadUntilIdle();
TextInputLayout layout = (TextInputLayout) view;
layout.setError(error);
uiController.loopMainThreadUntilIdle();
}
};
}
use of android.support.design.widget.TextInputLayout in project FirebaseUI-Android by firebase.
the class RecoverPasswordActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.forgot_password_layout);
mEmailFieldValidator = new EmailFieldValidator((TextInputLayout) findViewById(R.id.email_layout));
mEmailEditText = (EditText) findViewById(R.id.email);
String email = getIntent().getStringExtra(ExtraConstants.EXTRA_EMAIL);
if (email != null) {
mEmailEditText.setText(email);
}
findViewById(R.id.button_done).setOnClickListener(this);
}
Aggregations