Tutorial by Examples

It is the basic usage of the TextInputLayout. Make sure to add the dependency in the build.gradle file as described in the remarks section. Example: <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wra...
You can use the TextInputLayout to display error messages according to the material design guidelines using the setError and setErrorEnabledmethods. In order to show the error below the EditText use: TextInputLayout til = (TextInputLayout) findViewById(R.id.username); til.setErrorEnabled(true); ...
The TextInputLayout has a character counter for an EditText defined within it. The counter will be rendered below the EditText. Just use the setCounterEnabled() and setCounterMaxLength methods: TextInputLayout til = (TextInputLayout) findViewById(R.id.username); til.setCounterEnabled(true); til...
With an input password type, you can also enable an icon that can show or hide the entire text using the passwordToggleEnabled attribute. You can also customize same default using these attributes: passwordToggleDrawable: to change the default eye icon passwordToggleTint: to apply a tint to the...
The TextInputEditText is an EditText with an extra fix to display a hint in the IME when in 'extract' mode. The Extract mode is the mode that the keyboard editor switches to when you click on an EditText when the space is too small (for example landscape on a smartphone). In this case, using an Ed...
You can customize the appearance of the TextInputLayout and its embedded EditTextby defining custom styles in your styles.xml. The defined styles can either be added as styles or themes to your TextInputLayout. Example for customizing the hint appearance: styles.xml: <!--Floating label text st...

Page 1 of 1