I am trying to match the CardView width to the screen width but CardView width is not matching to screen width. I have checked my code again and again and I've even made all the attributes width equal to match parent.
Recyclerview xml --
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DisplayTodayExercises">
<android.support.v7.widget.RecyclerView
android:id="@+id/exercises_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
Card view xml --
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/activity_general_dimen"
android:orientation="horizontal">
<TextView
android:id="@+id/exer_name"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:layout_height="40dp"
android:textStyle="bold"
android:gravity="center_vertical"
tools:text="Exercise Name"/>
<TextView
android:id="@+id/se_eps"
android:layout_width="0dp"
android:layout_weight="1"
android:textStyle="bold"
android:layout_marginLeft="@dimen/sets_reps_dimen"
android:gravity="center_vertical"
android:layout_height="40dp"
tools:text="5 x 6"/>
<CheckBox
android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_marginLeft="@dimen/sets_reps_dimen"
android:layout_height="wrap_content"
android:gravity="center_vertical"/>
</LinearLayout>
</android.support.v7.widget.CardView>
Inflating code
LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate(R.layout.exercises_card_view_layout, null);
return new ExerciseContentViewHolder(view);