title: Android | Change theme of TextInputLayout using styles.xml
body: <p>I want to apply custom style to <code>TextInputLayout's</code> <code>hint</code> and <code>error</code> in one theme and apply it globally i.e. define it in styles.xml and somehow apply it to all <code>TextInputLayouts</code> used throughout the app without having the need to add it <strong>inline</strong> like this:</p>
  
  <pre><code>&lt;android.support.design.widget.TextInputLayout
      android:id="@+id/usernameWrapper"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:hint="@string/email_username"
      android:textColorHint="@color/grey_text"
      app:theme="@style/my_custom_style"&gt;
  
  &lt;style name="my_custom_style" parent="Widget.Design.TextInputLayout"&gt;
      &lt;item name="android:textColorHint"&gt;@color/success_accent&lt;/item&gt;
      &lt;item name="android:textSize"&gt;20sp&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>Something like we can do the <code>Button</code> widget like this:</p>
  
  <p><strong>styles.xml</strong></p>
  
  <pre><code>&lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
      &lt;item name="buttonStyle"&gt;@style/my.Widget.Button&lt;/item&gt;
      &lt;item name="android:buttonStyle"&gt;@style/my.Widget.Button&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="my.Widget.Button" parent="@android:style/Widget.TextView"&gt;
      &lt;item name="android:gravity"&gt;center&lt;/item&gt;
      &lt;item name="android:textSize"&gt;@dimen/some_dimen&lt;/item&gt;
      &lt;item name="android:textAllCaps"&gt;false&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>NOTE: I am currently considering <strong><em>subclassing the <code>TextInputLayout</code> as a last resort</em></strong>, so, please keep this in mind while you answer.</p>
  
  <p>Thanks :)</p>