I make some kind of chat application, the layout contains Toolbar, RecyclerView and panel for sending messages (as on the pictures). I try to implement the following behavior: when the keyboard opens the panel with EditText AND RecyclerView are pushed up but the Toolbar remains visible. Here it is implemented in VK application:
Here is my layout and the result i get
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".activity.DialogActivity">
<include layout="@layout/toolbar_dialog" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/send_message_layout"
android:clipToPadding="false"
android:divider="@null"
android:paddingTop="8dp"
android:background="#EAEFF2"
android:paddingBottom="8dp" />
<LinearLayout
android:id="@+id/send_message_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:elevation="8dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:layout_alignParentBottom="true">
<ImageView
android:id="@+id/iv_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:alpha=".5"
android:background="?selectableItemBackground"
android:contentDescription="@string/app_name"
android:padding="2dp"
android:src="@mipmap/ic_launcher" />
<EditText
android:id="@+id/et_message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="textMultiLine"
android:maxLines="3"
android:hint="Ваше сообщение"
android:background="@android:color/transparent"
/>
<Button
android:id="@+id/btn_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Send" />
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
In manifest:
android:windowSoftInputMode="adjustResize"
The result:
As you can see my RecyclerView is overlaid by EditText and keyboard. I have tried adjustPan
but it hides my toolbar. Can you bring me the solution to achieve such behavior as VK did.