I have a layout like this in a page of a View Pager:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<LinearLayout
android:id="@+id/bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_alignParentTop="true"
android:orientation="horizontal"
android:gravity="center"
android:background="@drawable/background_gray">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:paddingLeft="3dp" />
</LinearLayout>
<RelativeLayout
android:id="@+id/container_chat_box"
android:background="@drawable/conversation_background_gray"
android:layout_alignParentBottom="true"
android:layout_marginBottom="50dp">
<EditText
android:id="@+id/chat_box"
style="@style/ConversationChatBox" />
</RelativeLayout>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/bar"
android:background="@android:color/white"
android:stackFromBottom="true"
android:transcriptMode="normal"
android:layout_above="@id/chat_box"
android:paddingBottom="15dp"
android:clipToPadding="false"
android:divider="@null"
android:dividerHeight="0dp"
android:listSelector="@android:color/transparent" />
</RelativeLayout>
This is an idea of how It looks like:
----------
[ bar ]
[list view]
[list view]
[list view]
[list view]
[edit text]
When I click on the edit text, I'd like the bar to stay where it is (at the top of the screen), but the list view to be pushed up, so it looks like:
------------
[ bar ]
[list view]
[list view]
[edit text]
[keyboard ]
What I get (the bar is pushed up and disappears):
------------
[list view]
[list view]
[list view]
[edit text]
[keyboard ]
I have this on my AndroidManifest:
android:windowSoftInputMode="adjustPan"
I tried different combinations of values for setting android:windowSoftInputMode
, but I either get the keyboard to appear covering the edit text or the whole screen pushed up.
Is there a way to keep the bar in place while the listview is pushed up? Thank you in advance.