Answer the question
In order to leave comments, you need to log in
How can I make the RecyclerView not overlap the ActionBar when the on-screen keyboard appears?
Good afternoon.
There is no way to overcome the following problem: when the on-screen keyboard appears, RecyclerView goes up and closes the Toolbar and Statusbar.
Initial data:
There is an Activity a la WhatsApp/Hangounts/etc
View with the following structure:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_container"
android:layout_below="@+id/toolbar"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<android.support.v7.widget.RecyclerView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:stackFromBottom="true"
android:transcriptMode="normal"
android:smoothScrollbar="false"
android:listSelector="@android:color/transparent"
android:dividerHeight="1dp"
android:divider="@null" />
</android.support.v4.widget.SwipeRefreshLayout>
<TextView
android:id="@+id/chat_page"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="4dip"
android:text="@string/no_chat_messages"
/>
</RelativeLayout>
<LinearLayout
android:layout_marginTop="5dp"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="@color/accentLight" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="2dip">
<EditText
android:id="@+id/chat_input"
android:layout_weight="1"
android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
android:imeOptions="actionSend|flagNoEnterAction"
android:cursorVisible="true"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="4"
android:maxLength="200"
android:scrollbars="vertical"
android:fadingEdge="vertical"
/>
<ImageButton
android:src="@drawable/send_button"
android:id="@+id/chat_send"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question