I have a gradient that covers the whole background of my layout. However when I close the software keyboard it takes about 1 second for the gradient to resize to full height. This produces the white background you see in the picture below.
I thought of doing something like
android:windowSoftInputMode="adjustPan"
however this would be bad practice because a big part of the list view would be hidden under the keyboard. The gradient:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:useLevel="false" >
<gradient
android:startColor="#0d2d70"
android:endColor="#007dbc"
android:useLevel="false"
android:type="linear"
android:angle="45" />
</shape>
The layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/gradient"
android:padding="20dp" >
<!-- input field is here -->
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/input_licence"
android:divider="#FFFFFF"
android:dividerHeight="1dp"
android:padding="5dp"
android:scrollbarStyle="outsideOverlay" >
</ListView>
</RelativeLayout>
Any ideas how to prevent the white space?