0

My root layout is:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include
        layout="@layout/toolbar" />

    <FrameLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</LinearLayout>

content FrameLayout being replaced with this layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:ignore="UnusedAttribute">

    <FrameLayout
        android:id="@+id/messages"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_above="@+id/messageLayout">

        <android.support.v7.widget.AppCompatTextView
            android:id="@+id/emptyView"
            android:text="@string/no_messages"
            android:textSize="18sp"
            android:textColor="?attr/colorPrimary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_gravity="center"
            android:visibility="gone"
            tools:visibility="visible"/>

        <af.kabuljan.android.ui.widget.EmptyRecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingTop="4dp"
            android:background="@color/md_indigo_100"/>

        <ProgressBar
            android:id="@+id/progressView"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_gravity="center"
            android:visibility="gone"
            tools:visibility="visible"/>
    </FrameLayout>

    <RelativeLayout
        android:id="@+id/messageLayout"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_alignParentBottom="true"
        android:elevation="8dp">

        <ImageView
            android:id="@+id/btnAttach"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:src="@drawable/ic_attachment"
            android:tint="@color/primary_dark"
            android:padding="4dp"
            android:layout_alignParentLeft="true"/>

        <android.support.v7.widget.AppCompatEditText
            android:id="@+id/message"
            android:hint="@string/enterMessage"
            android:textSize="18sp"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_toRightOf="@+id/btnAttach"
            android:layout_toLeftOf="@+id/btnSend"
            android:background="#00000000"
            android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
            android:imeOptions="actionSend|flagNoEnterAction"
            android:padding="4dp"
            android:gravity="center_vertical"/>

        <android.support.v7.widget.AppCompatButton
            android:id="@+id/btnSend"
            android:text="@string/send"
            android:textColor="@android:color/white"
            android:background="@drawable/send_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_margin="4dp"
            app:elevation="4dp"/>
    </RelativeLayout>
</RelativeLayout>

Let's assume this is a messaging app and this window has a recyclerView with bubble messages which can be scrolled, but bottom input should be always at bottom. The problem is when i tap EditText - softkeyboard always overlaps this EditText. What should i do to make whole container (toolbar+recyclerView+bottom input) be resized to lay out softkeyboard to the bottom?

Tried adjustResize - no result. I've attached 2 screenshots. 1st - wrong, 2nd - correct.

enter image description hereenter image description here

localhost
  • 5,568
  • 1
  • 33
  • 53

1 Answers1

0

Yeah you were on the right track with the adjustResize, that's what you should do to specify the desired activity layout behaviour wwith the soft keyboard.

What setting did you try, and did it have any affect?

The docs are here: https://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

Buddy
  • 10,874
  • 5
  • 41
  • 58