title: Softkeyboard hides button below multi-line EditText?
body: <p>I have a <code>RelativeLayout</code> with an <code>EditText</code> that has a <code>Button</code> below it. Ideally as the user clicks the <code>EditText</code> and fills in multiple lines of text, the <code>RelativeLayout</code> would also expand as the lines increase. However, the behavior I have now is that after the first line of the <code>EditText</code> is filled, the keyboard begins to cover the <code>Button</code> below it and after 3-4 lines of text in the <code>EditText</code>, the <code>Button</code> is gone below the keyboard. Is there any way to have it so that as I type in text, the entire layout increases in size so that the button stays above the keyboard? Here is my code:</p>
  
  <p>AndroidManifest.xml:</p>
  
  <pre><code>    &lt;activity
          android:name="&lt;Name of project&gt;.activity.Comments"
          android:configChanges="orientation|keyboardHidden"
          android:label="Comments"
          android:screenOrientation="portrait"
          android:theme="@style/AppTheme.NoActionBar"
          android:windowSoftInputMode="stateHidden|adjustResize" /&gt;
  </code></pre>
  
  <p>Comments.xml:</p>
  
  <pre><code>&lt;RelativeLayout
          android:id="@+id/send_message"
          android:layout_width="match_parent"
          android:layout_height="90dp"
          android:layout_margin="4dp"
          android:layout_alignParentBottom="true"&gt;
  
          &lt;EditText
              android:fontFamily="sans-serif"
              android:id="@+id/write_comment"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:padding="12dp"
              android:gravity="left"
              android:textSize="16sp"
              android:textColor="@color/black"
              android:cursorVisible="false"
              android:textColorHint="@color/material_color_grey_300"
              android:hint="@string/commentBack"
              android:background="@drawable/edittext_bg"
              android:inputType="textMultiLine"
              android:isScrollContainer="true"
              android:maxLength="200"
              android:scrollHorizontally="false" /&gt;
  
          &lt;Button
              android:fontFamily="sans-serif-medium"
              android:id="@+id/send_comment"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="16sp"
              android:textColor="@color/colorPrimary"
              android:layout_marginTop="8dp"
              android:text="@string/send"
              android:background="@null"
              android:layout_below="@id/write_comment"
              android:layout_alignParentRight="true"
              android:layout_alignParentBottom="true"
              android:textAllCaps="false" /&gt;
      &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I've tried to add <code>android:isScrollContainer="true"</code> thinking that it would create a scroll container to the <code>EditText</code> so that it would help expand the layout but that didn't seem to work. Any help would be appreciated. Thanks!</p>
  
  <p>Edit: Added in entire layout based on answer below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent" android:fitsSystemWindows="true"
      android:id="@+id/comments_layout"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_height="wrap_content"
          android:layout_width="match_parent"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/comments_appbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
              app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;RelativeLayout
              android:layout_alignParentTop="true"
              android:layout_marginTop="?attr/actionBarSize"
              android:layout_width="match_parent"
              android:id="@+id/comments_listview"
              android:layout_height="match_parent"&gt;
  
              &lt;ListView
                  android:scrollbars="vertical"
                  app:layout_behavior="@string/appbar_scrolling_view_behavior"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:id="@+id/rv_view_comments"&gt;
              &lt;/ListView&gt;
  
              &lt;TextView
                  android:layout_below="@id/rv_view_comments"
                  android:gravity="center_horizontal"
                  android:padding="16dp"
                  android:textSize="16sp"
                  android:id="@+id/empty_list_item"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:visibility="gone"
                  android:text="@string/noComments" &gt;
              &lt;/TextView&gt;
  
              &lt;include layout="@layout/include_progress_overlay"/&gt;
  
          &lt;/RelativeLayout&gt;
  
          &lt;RelativeLayout
      android:id="@+id/send_message"
      android:layout_width="match_parent"
      android:layout_height="90dp"
      android:layout_margin="4dp"
      android:layout_alignParentBottom="true"&gt;
  
      &lt;EditText
          android:fontFamily="sans-serif"
          android:id="@+id/write_comment"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:padding="12dp"
          android:gravity="left"
          android:textSize="16sp"
          android:textColor="@color/black"
          android:cursorVisible="false"
          android:textColorHint="@color/material_color_grey_300"
          android:hint="@string/commentBack"
          android:background="@drawable/edittext_bg"
          android:inputType="textMultiLine"
          android:isScrollContainer="true"
          android:maxLength="200"
          android:scrollHorizontally="false" /&gt;
  
      &lt;Button
          android:fontFamily="sans-serif-medium"
          android:id="@+id/send_comment"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textSize="16sp"
          android:textColor="@color/colorPrimary"
          android:layout_marginTop="8dp"
          android:text="@string/send"
          android:background="@null"
          android:layout_below="@id/write_comment"
          android:layout_alignParentRight="true"
          android:layout_alignParentBottom="true"
          android:textAllCaps="false" /&gt;
  &lt;/RelativeLayout&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>Edit: As per Jaydroider's request, I have included a photo to show my problem. If I could make a GIF or something, if I add more text to my <code>EditText</code> field, the <code>Send</code> button will disappear under the keyboard and unless I remove text from the <code>EditText</code>, the `Send cannot be pushed:</p>
  
  <p><a href="https://i.stack.imgur.com/KO3KO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KO3KO.jpg" alt="Image showing problem"></a></p>
  
  <p>Edit: I have also shown how I scroll to the bottom of my <code>ListView</code> when I click on the <code>EditText</code> here if this helps.</p>
  
  <pre><code>public void setupComment(final EditText comment) {
          //Once we send the post, we want to scroll to bottom of listview
          comment.setOnEditorActionListener(new TextView.OnEditorActionListener() {
  
              @Override
              public boolean onEditorAction(TextView v, int actionId,
                                            KeyEvent event) {
                  if (event != null &amp;&amp; (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
                      comment.setImeOptions(EditorInfo.IME_ACTION_DONE);
                      resetKeyboardSettings();
                  }
                  return false;
              }
          });
  
          //Hide the cursor until view is clicked on
          View.OnTouchListener onTouchListener = new View.OnTouchListener(){
              @Override
              public boolean onTouch(View v, MotionEvent event) {
                  System.out.println("Touched");
                  if (v.getId() == comment.getId()) {
                      comment.setCursorVisible(true);
                  }
                  commentsView.postDelayed(new Runnable() {
                      @Override
                      public void run() {
  
                          commentsView.smoothScrollToPosition(commentsView.getAdapter().getCount());
                      }
                  }, 750);
                  return false;
              }
          };
          comment.setOnTouchListener(onTouchListener);
      }
  </code></pre>