You have too many nested layouts, try to have as few as possible nests. Here, I removed couple of them and the above mentioned empty space went away:
layout xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/main_background"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<RelativeLayout
android:id="@+id/card_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp" >
<TextView
android:id="@+id/title_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="4dp"
android:text="@string/current_location"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:id="@+id/location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/title_location"
android:orientation="horizontal"
android:paddingBottom="2dp"
android:paddingTop="2dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/lat_long"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" />
<TextView
android:id="@+id/body_location_latlong_result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:paddingLeft="4dp"
android:singleLine="true"
android:text="@string/loading"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="italic" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/location"
android:orientation="horizontal"
android:paddingBottom="2dp"
android:paddingTop="2dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/address"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" />
<TextView
android:id="@+id/body_location_address_result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:paddingLeft="4dp"
android:singleLine="true"
android:text="@string/loading"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="italic" />
</LinearLayout>
</RelativeLayout>
<Button
android:id="@+id/button1"
style="@style/CardActionButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@id/card_content"
android:gravity="left|center_vertical|center_horizontal"
android:text="@string/button" />
</RelativeLayout>
Note that I have added a new drawable, main_background; that's to get rid of additional RelativeLayout/FrameLayout
, and have both background image and color in one single drawable.
main_background.xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<solid android:color="@color/main_background_grey" />
</shape>
</item>
<item>
<bitmap
android:src="@drawable/card_background_full" />
</item>
</layer-list>
Hope this helps.