title: Android not able to completely remove CardView's margins/paddings and rounded corners
body: <p>I am using a Pre-LolliPop Android phone for development, and now I have a RecyclerView which involves a layout included CardView with images and texts. I try to  trim all the margins the widget brings to it in default like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:card_view="http://schemas.android.com/apk/res-auto"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="@android:color/black"
      android:orientation="vertical"
      android:layout_gravity="center_horizontal"
      android:gravity="center_horizontal"
      android:padding="0dp"
      android:layout_margin="0dp" &gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="@dimen/adapter_itemlist_category_cardview_width"
          android:layout_height="@dimen/adapter_itemlist_category_cardview_height"
          android:id="@+id/adapter_itemlist_category_cardview"
          android:padding="0dp"
          android:background="@android:color/transparent"
          card_view:cardElevation="0dp"
          card_view:cardMaxElevation="0dp" 
          card_view:cardUseCompatPadding="true"
          &gt;
  
          &lt;!-- some inner content--&gt;
      &lt;/android.support.v7.widget.CardView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Setting <code>android:background="@android:color/black"</code> in the <code>LinearLayout</code> is for visually viewing if there are still any spaces/margin exist.</p>
  
  <p>However, even when I have set both card_view:cardElevation="0dp" and card_view:cardMaxElevation="0dp", there are still like a few dp light grey margin between the CardViews items within the RecyclerView, apparently due to the round corners (and I don't want it to be rounded corner anyway):
  <a href="https://i.stack.imgur.com/vkfES.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vkfES.png" alt="Corners, and there are little light grey spacings between the items"></a></p>
  
  <p>And then I try to set the round corner radius to 0 dp, but the I found that if setting <code>card_view:cardCornerRadius="0dp"</code>, it will turn of to the following errors during executions:</p>
  
  <pre><code>07-30 00:49:49.219: E/AndroidRuntime(16237): FATAL EXCEPTION: main
  07-30 00:49:49.219: E/AndroidRuntime(16237): java.lang.IllegalArgumentException: radius must be &gt; 0
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.graphics.RadialGradient.&lt;init&gt;(RadialGradient.java:34)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.support.v7.widget.RoundRectDrawableWithShadow.buildShadowCorners(RoundRectDrawableWithShadow.java:285)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.support.v7.widget.RoundRectDrawableWithShadow.buildComponents(RoundRectDrawableWithShadow.java:307)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.support.v7.widget.RoundRectDrawableWithShadow.draw(RoundRectDrawableWithShadow.java:209)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13744)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.widget.FrameLayout.draw(FrameLayout.java:467)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12710)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13483)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13762)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12710)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13483)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.support.v7.widget.RecyclerView.drawChild(RecyclerView.java:3558)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13762)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.support.v7.widget.RecyclerView.draw(RecyclerView.java:3037)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12710)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13483)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13762)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12710)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13483)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12708)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13483)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13762)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.widget.FrameLayout.draw(FrameLayout.java:467)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.widget.ScrollView.draw(ScrollView.java:1806)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12710)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.draw(View.java:13483)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12708)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3151)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12646)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3151)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12646)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3151)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12646)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3151)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12646)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3151)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12646)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3151)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12646)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3151)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12646)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.View.getDisplayList(View.java:12754)
  07-30 00:49:49.219: E/AndroidRuntime(16237):    at android.view.ViewGroup.dispatchGetDisplayList(ViewGrou
  </code></pre>
  
  <p>Whichs turns out this property cannot be set to zero-value. </p>
  
  <p>Therefore, is there a way to completely remove the rounded corners for CardView in pre-Lollipop devices? And if even the margins/paddings made by that? If not, how to remove them completely?</p>