Search in sources :

Example 1 with TextInputLayout

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();
        }
    };
}
Also used : ViewAction(android.support.test.espresso.ViewAction) UiController(android.support.test.espresso.UiController) TextInputLayout(android.support.design.widget.TextInputLayout) View(android.view.View)

Example 2 with TextInputLayout

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();
        }
    };
}
Also used : ViewAction(android.support.test.espresso.ViewAction) UiController(android.support.test.espresso.UiController) TextInputLayout(android.support.design.widget.TextInputLayout) View(android.view.View)

Example 3 with TextInputLayout

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();
        }
    };
}
Also used : ViewAction(android.support.test.espresso.ViewAction) UiController(android.support.test.espresso.UiController) TextInputLayout(android.support.design.widget.TextInputLayout) View(android.view.View)

Example 4 with TextInputLayout

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();
        }
    };
}
Also used : ViewAction(android.support.test.espresso.ViewAction) UiController(android.support.test.espresso.UiController) TextInputLayout(android.support.design.widget.TextInputLayout) View(android.view.View)

Example 5 with TextInputLayout

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);
}
Also used : EmailFieldValidator(com.firebase.ui.auth.ui.email.fieldvalidators.EmailFieldValidator) TextInputLayout(android.support.design.widget.TextInputLayout)

Aggregations

TextInputLayout (android.support.design.widget.TextInputLayout)19 View (android.view.View)12 UiController (android.support.test.espresso.UiController)7 ViewAction (android.support.test.espresso.ViewAction)7 EditText (android.widget.EditText)5 Button (android.widget.Button)4 TextView (android.widget.TextView)4 Nullable (android.support.annotation.Nullable)3 Editable (android.text.Editable)3 TextWatcher (android.text.TextWatcher)2 EmailFieldValidator (com.firebase.ui.auth.ui.email.fieldvalidators.EmailFieldValidator)2 Test (org.junit.Test)2 SuppressLint (android.annotation.SuppressLint)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 AppCompatEditText (android.support.v7.widget.AppCompatEditText)1 AdapterView (android.widget.AdapterView)1 CheckBox (android.widget.CheckBox)1 CompoundButton (android.widget.CompoundButton)1 Spinner (android.widget.Spinner)1 WelcomeBackPasswordPrompt (com.firebase.ui.auth.ui.accountlink.WelcomeBackPasswordPrompt)1