1

Looks like a simple problem, but I cannot find any solution.

My layout hierarchy is also simple:

<RelativeLayout
    ...>
    <LinearLayout
        android:id="@id/header"
        android:layout_alignParentTop="true"
        ...>
    />
    <RecyclerView
        ...>
    />
    <RelativeLayout
        android:id="@id/footer"
        android:layout_alignParentBottom="true"
        ...>
    />
</RelativeLayout>

What happens: I have an EditText, which is a child of the footer layout. When it gains focus, the softkeyboard appears and the whole layout is pulled up.

What I want to achieve: ..., the softkeyboard appears and the header will remain at the top, the footer will be pulled above the softkeyboard (just like now), and the only resized view will be the RecyclerView.

I tried dozens of combinations with windowSoftInputMode, combining my layout with ScrollView... but nothing helps.

It must be easy, isnt it?

Edit: the layout is content view of DialogFragment

kristyna
  • 1,360
  • 2
  • 24
  • 41

1 Answers1

0

Could you add your whole code, so I can test that and that will help us to find out and exact issue. Although I tried something which is working fine. Check my answer below

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<RelativeLayout
    android:id="@+id/view_header"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_alignParentTop="true"
    android:background="#00ff00" />

<RecyclerView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/view_header"
    android:layout_above="@+id/view_footer"
    android:background="#006655"/>

<RelativeLayout
    android:id="@+id/view_footer"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_alignParentBottom="true"
    android:background="#009911" >

    <EditText
        android:layout_width="match_parent"
        android:layout_height="match_parent" />


</RelativeLayout>

Rahul
  • 10,457
  • 4
  • 35
  • 55