I have the following XML:-
For the list view:-
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="1">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/state_listView"
android:layout_weight="0.8"
android:layout_alignParentLeft="true"
android:layout_marginTop="40dp"
android:fastScrollEnabled="true"
android:layout_toStartOf="@+id/side_index" />
<LinearLayout
android:id="@+id/side_index"
android:layout_width="50dp"
android:layout_marginTop="40dp"
android:layout_height="match_parent"
android:background="#c3c3c3"
android:gravity="center_horizontal"
android:orientation="vertical"
android:layout_weight="0.2"
android:layout_alignParentRight="true">
</LinearLayout>
</RelativeLayout>
Foe each item in the list view:-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:background="@drawable/gradient">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1">
<ImageView
android:layout_width="55dp"
android:layout_height="49dp"
android:id="@+id/legislator_image"
android:layout_weight="0.19"
android:layout_alignParentLeft="true"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="80dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:text="Medium Text"
android:id="@+id/firstname"
android:layout_marginTop="3dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="@+id/details"
android:layout_marginTop="3dp" />
</LinearLayout>
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginTop="20dp"
android:layout_marginRight="3dp"
android:layout_alignParentRight="true"
android:id="@+id/getDetails"/>
</RelativeLayout>
</LinearLayout>
For the side index bar :-
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/side_list_item"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center"
android:textSize="13sp" />
I have not set the margin anywhere but there is a margin on the listview and near the sidebar. I want the listview and the sidebar to take up the whole screen without any margin. I have attached an image for your reference.