title: How to align text in TextInputLayout in android?
body: <p>In a <code>RelativeLayout</code> I have a <code>TextInputLayout</code> where I have <code>EditText</code> inside it to type phone number and a <code>Textview</code> inside a <code>LinearLayout</code> where I am showing the country code.
  When we start typing `TextInputLayout slide to top, but I want it to slide to as in image 3.</p>
  <p>I am facing issue in this can somebody help me?
  This is my code:</p>
  <pre><code>&lt;RelativeLayout
                                  android:layout_width=&quot;match_parent&quot;
                                  android:layout_height=&quot;wrap_content&quot;
                                  &gt;
          
                                  &lt;LinearLayout
                                      android:layout_width=&quot;wrap_content&quot;
                                      android:layout_height=&quot;wrap_content&quot;
                                      android:layout_alignStart=&quot;@+id/error_mobile_no&quot;
                                      android:layout_alignTop=&quot;@+id/error_mobile_no&quot;
                                      android:layout_alignBottom=&quot;@+id/error_mobile_no&quot;
                                      android:layout_marginTop=&quot;0dp&quot;
                                      android:layout_marginBottom=&quot;0dp&quot;
                                      android:gravity=&quot;center&quot;
                                      android:orientation=&quot;horizontal&quot;&gt;
          
                                      &lt;TextView
                                          android:id=&quot;@+id/country_code_textview&quot;
                                          android:layout_width=&quot;wrap_content&quot;
                                          android:layout_height=&quot;wrap_content&quot;
                                          android:fontFamily=&quot;@font/lorin_regular&quot;
                                          android:text=&quot;+971&quot;
                                          android:layout_marginBottom=&quot;2dp&quot;
                                          android:textColor=&quot;@color/black&quot;
                                          android:textSize=&quot;14sp&quot; /&gt;
                                  &lt;/LinearLayout&gt;
          
                                  &lt;com.google.android.material.textfield.TextInputLayout
                                      android:id=&quot;@+id/error_mobile_no&quot;
                                      android:layout_width=&quot;match_parent&quot;
                                      android:layout_height=&quot;wrap_content&quot;
                                      android:layout_marginEnd=&quot;20dp&quot;
                                      android:layout_marginStart=&quot;20dp&quot;
                                      app:errorEnabled=&quot;true&quot;&gt;
          
                                      &lt;EditText
                                          android:id=&quot;@+id/etPhoneNumberDetailedActivity&quot;
                                          android:layout_width=&quot;match_parent&quot;
                                          android:layout_height=&quot;wrap_content&quot;
                                          android:layout_gravity=&quot;start&quot;
                                          android:autofillHints=&quot;&quot;
                                          android:paddingStart=&quot;35dp&quot;
                                          android:backgroundTint=&quot;#6283a3&quot;
                                          android:fontFamily=&quot;@font/lorin_regular&quot;
                                          android:hint=&quot;@string/mobile_number&quot;
                                          android:inputType=&quot;phone&quot;
                                          android:textColor=&quot;@color/black&quot;
                                          android:textColorHint=&quot;#6283a3&quot; android:textSize=&quot;14sp&quot; /&gt;
                                  &lt;/com.google.android.material.textfield.TextInputLayout&gt;
                              &lt;/RelativeLayout&gt;
  </code></pre>
  <p>This is an image of the field before entering text.<a href="https://i.stack.imgur.com/VXU5a.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VXU5a.jpg" alt="enter image description here" /></a></p>
  <p>This is the image after entering text.<a href="https://i.stack.imgur.com/vhybj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vhybj.jpg" alt="enter image description here" /></a></p>
  <p>But I am trying to get it to look like this.
  <a href="https://i.stack.imgur.com/hSmBE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hSmBE.png" alt="enter image description here" /></a></p>