The easiest way that worked for me was using relative layout inside my cardView and then using the "android:layout_centerHorizontal="true".
This works perfectly when the width and height of the of the relative layout are match parent (Parent being the cardView).