2

I'm using the following fragment:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/green"
android:fitsSystemWindows="true">
<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageView"
    android:layout_below="@+id/messageHistory"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:src="@color/green"/>

<EditText android:id="@+id/message"
             android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="top"
              android:layout_weight="1"
       android:layout_alignParentBottom="true"
       android:layout_alignParentLeft="true"
       android:layout_alignParentStart="true"
    android:layout_toLeftOf="@+id/sendMessageButton"
    android:textColor="#ffffff"/>

<ListView   android:id="@+id/messageHistory"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:layout_weight="1"
            android:editable="false"
            android:gravity="top"
            android:scrollbars="vertical"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:layout_above="@+id/message"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:smoothScrollbar="true"
    android:scrollingCache="true"
    android:dividerHeight="0dp"
    android:divider="@null"
    android:scrollbarSize="10px"
    android:background="@color/back"
    android:stackFromBottom="true"
 />
<ImageButton
    android:id="@+id/sendMessageButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="4"
    android:src="@android:drawable/ic_menu_send"
    android:adjustViewBounds="false"
    android:alpha="100"
    android:background="@color/green"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:textAlignment="center"
    android:scaleType="fitCenter"
    android:layout_below="@+id/messageHistory"
    />

If I enable translucent status and navbar windowSoftInputMode="adjustResize" doesn't work and the keyboard covers the EditText, if I disable it everything works fine. Is there any easy workaround for this?

Thanks in advance

user3517658
  • 349
  • 3
  • 14

1 Answers1

0

I had also been strugle with this problem and here I found solution. It works if you add extra padding to your toolbar or layout (24dp) https://stackoverflow.com/a/42381132/3178374

Paulina
  • 930
  • 8
  • 13