I have been stuck into this for quite some time. I am trying to develop a chat module. I have been stuck into this part where when the SoftInputKeyboard
overlays the content of the RecyclerView
. I have tried almost every combination of adjustResize
and adjustPan
with stateHidden
and stateVisible
with no success at all.
On Using adjustPan
the ActionBar
gets hidden along with 2-3 recyclerview
items.
I have attached screenshots. Any help with be appreciated.
XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/light_grey"
android:fitsSystemWindows="true"
android:focusable="true"
android:focusableInTouchMode="true">
<LinearLayout
android:id="@+id/listFooter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<EditText
android:id="@+id/messageInput"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/white"
android:hint="Write a message"
android:inputType="textMultiLine"
android:padding="16dp"
android:textSize="14sp" />
<ImageView
android:id="@+id/sendButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:contentDescription="@null"
android:padding="12dp"
android:src="@drawable/ic_send" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview_chat_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/listFooter"
android:layout_marginTop="8dp" />
</RelativeLayout>
- A ) AdjustResize
- B ) With AdjustPan