The listview contains teams, and the teams contains players. I have this listview that is filled by a recycleadapter, and i can't locate where it get's the last padding in the bottom from? For every item i add to the list, it adds more padding to the bottom.
How do i remove the padding in the bottom of the teams?
This is the xml layout wich hold the teams.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp">
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Team # X"
android:textSize="18dp"
android:gravity="center"
android:padding="10dp"
android:id="@+id/make_team_teamName"
android:textColor="#000000"/>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/make_team_playerList"
android:paddingBottom="8dp"
android:clipToPadding="false"
android:background="@color/colorPrimaryDark">
</ListView>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
This xml holds the players
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/make_team_player_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:backgroundTint="@color/colorPrimary"
app:cardCornerRadius="4dp"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Player name"
android:id="@+id/make_team_playerName"
android:textColor="@color/colorAccent"
android:gravity="center"
style="@style/txt_normal"/>
</android.support.v7.widget.CardView>
</LinearLayout>
This view is what the user see
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:layout_weight="2"
android:gravity="center">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/make_team_add_player"
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/add_player"
android:layout_marginRight="20dp"
/>
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/make_team_add_team"
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/add_team"
android:layout_marginLeft="20dp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="0dp"
android:layout_weight="8"
android:id="@+id/make_teams_teamlistView">
<com.dtu.appname.Adapter.AutofitRecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/make_teams_teamsRecyclerview"
android:columnWidth="180dp"
android:clipToPadding="false">
</com.dtu.appname_v1.Adapter.AutofitRecyclerView>
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentEnd="false"
android:layout_alignParentBottom="true"
android:background="@color/colorPrimary"
android:text="Save"
android:textColor="@color/colorAccent"
android:id="@+id/make_teams_done_b"
/>
</LinearLayout>