First Add support v7 library in your project then in xml file put this.
  <android.support.v7.widget.RecyclerView
        android:id="@+id/my_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </android.support.v7.widget.RecyclerView>
Then in your fragment put these lines.
scheduler_day_view_horizontal_recyclerview = (RecyclerView) v.findViewById(R.id.my_recycler_view);
    layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
    scheduler_day_view_horizontal_recyclerview.setLayoutManager(layoutManager);
    scheduler_day_view_horizontal_recyclerview.setItemAnimator(new DefaultItemAnimator());
    scheduler_day_view_horizontal_recyclerview.setHasFixedSize(true);
Then set adapter to the RecyclerView.
For more detail about cardview and Recycler view Please visit here