title: Center hint and EditText vertically in TextInputLayout
body: <p>I am using a <a href="https://developer.android.com/reference/android/support/design/widget/TextInputLayout.html" rel="noreferrer">TextInputLayout</a> to show a hint but I am not able to center it vertically. I always get this:</p>
  
  <p><a href="https://i.stack.imgur.com/Xzcnz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Xzcnz.png" alt="enter image description here"></a></p>
  
  <p>And I would like to center the hint vertically when there is no text in the <a href="https://developer.android.com/reference/android/widget/EditText.html" rel="noreferrer">EditText</a> / <a href="https://developer.android.com/reference/android/support/design/widget/TextInputEditText.html" rel="noreferrer">TextInputEditText</a>. I have tried the basic ideas (gravity, layout_gravity, etc.). So far the only way to do it would be to add some "magic" padding, but I would like to do it in a cleaner way. I was thinking on measure the top hint label height and add it as a bottom margin when it is not visible, and remove the same margin when it is visible, but I don't understand very well the <a href="https://developer.android.com/reference/android/support/design/widget/TextInputLayout.html" rel="noreferrer">TextInputLayout</a> source code yet. Does anybody know how to do it?</p>
  
  <p>Edit:</p>
  
  <p>I tried this suggested answer:</p>
  
  <pre><code>&lt;android.support.design.widget.TextInputLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="20dp"
      android:background="@color/grey_strong"&gt;
  
      &lt;android.support.design.widget.TextInputEditText
          android:layout_width="match_parent"
          android:layout_height="90dp"
          android:background="@color/red_light"
          android:gravity="center_vertical"
          android:hint="Test"/&gt;
  
  &lt;/android.support.design.widget.TextInputLayout&gt;
  </code></pre>
  
  <p>And I get this:</p>
  
  <p><a href="https://i.stack.imgur.com/kbYX2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kbYX2.png" alt="enter image description here"></a></p>
  
  <p>The "big" hint is still not vertically centered. It is a bit below the center because the "small" hint (in grey background, at the top, visible only when the field is focused) takes some space at the top and pushes the <a href="https://developer.android.com/reference/android/widget/EditText.html" rel="noreferrer">EditText</a>.</p>