title: Problem with EditText centered content, Softkeyboard covering it if there is some gravity
body: <p>I've this problem with EditText inside a LinearLayout that if I give <code>android:gravity="center"</code> or <code>android:gravity="center_horizontal"</code> to the EditText, the softkeyboard covers the EditText while typing. When I 1st touch the edittext it works fine, but as I start typing the EditText goes behind the keyboard.</p>
  
  <p>This problem never appears if I don't provide any gravity. But I want the contents to be centered.</p>
  
  <p>Here is the code</p>
  
  <pre><code>        &lt;EditText
          android:id="@+id/phoneET"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginLeft="12dp"
          android:layout_marginTop="@dimen/margin_bet_phn_edittxt"
          android:layout_marginRight="12dp"
          android:textAlignment="center"
          android:gravity="center"
          android:imeOptions="actionNext"
          android:inputType="number"
          android:maxLength="10" /&gt;
  </code></pre>
  
  <p>I have tried different windowSoftInputMode options(<code>android:windowSoftInputMode="adjustPan")</code> in the manifest, but not getting the required result.</p>
  
  <p>Also tried it by removing the <code>android:textAlignment="center"</code> or only keeping it and removing gravity. But unsuccessful, please help.</p>
  
  <p>The whole layout:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@drawable/bg_mobile"
  android:gravity="center|top"
  android:orientation="vertical"&gt;
  
  &lt;include layout="@layout/content_header" /&gt;
  
  
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="@dimen/margin_top_phn_view"
      android:orientation="vertical"
      android:gravity="center"&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginLeft="12dp"
          android:layout_marginRight="12dp"
          android:gravity="center"
          android:lineSpacingExtra="6sp"
          android:text="Enter phone number"
          android:textColor="#ffffff"
          android:textSize="@dimen/enter_phn_text_size" /&gt;
  
      &lt;EditText
          android:id="@+id/phoneET"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginLeft="12dp"
          android:layout_marginTop="@dimen/margin_bet_phn_edittxt"
          android:layout_marginRight="12dp"
          android:textAlignment="center"
          android:gravity="center_horizontal"
          android:imeOptions="actionNext"
          android:inputType="number"
          android:maxLength="10" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>