Creating a TextInputLayout Theme

So let’s get going with our theme. The first thing we need to do, is define a couple of text Styles that will be used as part of the theme. These styles correspond to the different texts used, such as the Hint and Error texts.

Then, we create our TextInputLayout theme, referencing the above:

And for the last step, we build our layout.xml using the android:theme attribute with the style we defined above:

You are now ready to style your Text Fields!

Extra Credit: This article, will show you how to use state-selectors to provide different colours for different states e.g. focused and idle colours.