SupportLeanbackShowcase: get rid of card view background overdraw

Change-Id: I3a46d34df265eda2cf38bfca80d3786aa5a8a23b
diff --git a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/CharacterCardView.java b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/CharacterCardView.java
index 0486a42..962adb0 100644
--- a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/CharacterCardView.java
+++ b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/CharacterCardView.java
@@ -30,7 +30,7 @@
 public class CharacterCardView extends BaseCardView {
 
     public CharacterCardView(Context context) {
-        super(context);
+        super(context, null, R.style.CharacterCardStyle);
         LayoutInflater.from(getContext()).inflate(R.layout.character_card, this);
         setOnFocusChangeListener(new View.OnFocusChangeListener() {
             @Override
@@ -47,7 +47,6 @@
             }
         });
         setFocusable(true);
-        setBackground(null);
     }
 
     public void updateUi(Card card) {
diff --git a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/TextCardView.java b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/TextCardView.java
index ed1dd4a..830b474 100644
--- a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/TextCardView.java
+++ b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/TextCardView.java
@@ -29,7 +29,7 @@
 public class TextCardView extends BaseCardView {
 
     public TextCardView(Context context) {
-        super(context);
+        super(context, null, R.style.TextCardStyle);
         LayoutInflater.from(getContext()).inflate(R.layout.text_icon_card, this);
         setFocusable(true);
     }
diff --git a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/presenters/SideInfoCardPresenter.java b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/presenters/SideInfoCardPresenter.java
index 914adb0..b9f44fc 100644
--- a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/presenters/SideInfoCardPresenter.java
+++ b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/cards/presenters/SideInfoCardPresenter.java
@@ -39,9 +39,9 @@
 
     @Override
     protected BaseCardView onCreateView() {
-        final BaseCardView cardView = new BaseCardView(getContext());
+        final BaseCardView cardView = new BaseCardView(getContext(), null,
+                R.style.SideInfoCardStyle);
         cardView.setFocusable(true);
-        cardView.setCardType(BaseCardView.CARD_TYPE_MAIN_ONLY);
         cardView.addView(LayoutInflater.from(getContext()).inflate(R.layout.side_info_card, null));
         return cardView;
     }
diff --git a/samples/SupportLeanbackShowcase/app/src/main/res/layout/side_info_card.xml b/samples/SupportLeanbackShowcase/app/src/main/res/layout/side_info_card.xml
index c9ec7ca..725af09 100644
--- a/samples/SupportLeanbackShowcase/app/src/main/res/layout/side_info_card.xml
+++ b/samples/SupportLeanbackShowcase/app/src/main/res/layout/side_info_card.xml
@@ -14,55 +14,51 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-             xmlns:lb="http://schemas.android.com/apk/res-auto"
-             android:layout_width="wrap_content"
-             android:layout_height="wrap_content"
-             android:background="@color/default_card_footer_background_color">
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:lb="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/container"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal">
+
+    <ImageView
+        android:id="@+id/main_image"
+        android:layout_width="144dp"
+        android:layout_height="144dp"
+        lb:layout_viewType="main"
+        />
 
     <LinearLayout
-        android:id="@+id/container"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal">
+        android:id="@+id/info"
+        android:layout_width="144dp"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:paddingLeft="11dp"
+        android:paddingRight="11dp"
+        android:paddingTop="7dp"
+        android:background="@color/default_card_footer_background_color">
 
-        <ImageView
-            android:id="@+id/main_image"
-            android:layout_width="144dp"
-            android:layout_height="144dp"
-            lb:layout_viewType="main"
-            />
+        <TextView
+            android:id="@+id/primary_text"
+            style="@style/Widget.Leanback.ImageCardView.TitleStyle"
+            android:fontFamily="sans-serif-condensed"
+            android:maxLines="2"
+            android:textSize="16sp"/>
 
-        <LinearLayout
-            android:id="@+id/info"
-            android:layout_width="144dp"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            android:paddingLeft="11dp"
-            android:paddingRight="11dp"
-            android:paddingTop="7dp">
+        <TextView
+            android:id="@+id/secondary_text"
+            style="@style/Widget.Leanback.ImageCardView.ContentStyle"
+            android:layout_marginTop="4dp"
+            android:fontFamily="sans-serif-condensed"
+            android:maxLines="1"
+            android:textColor="#EEEEEE"/>
 
-            <TextView
-                android:id="@+id/primary_text"
-                style="@style/Widget.Leanback.ImageCardView.TitleStyle"
-                android:fontFamily="sans-serif-condensed"
-                android:maxLines="2"
-                android:textSize="16sp"/>
-
-            <TextView
-                android:id="@+id/secondary_text"
-                style="@style/Widget.Leanback.ImageCardView.ContentStyle"
-                android:layout_marginTop="4dp"
-                android:fontFamily="sans-serif-condensed"
-                android:maxLines="1"
-                android:textColor="#EEEEEE"/>
-
-            <TextView
-                android:id="@+id/extra_text"
-                style="@style/Widget.Leanback.ImageCardView.ContentStyle"
-                android:layout_marginTop="6dp"
-                android:fontFamily="sans-serif-condensed"
-                android:maxLines="5"/>
-        </LinearLayout>
+        <TextView
+            android:id="@+id/extra_text"
+            style="@style/Widget.Leanback.ImageCardView.ContentStyle"
+            android:layout_marginTop="6dp"
+            android:fontFamily="sans-serif-condensed"
+            android:maxLines="5"/>
     </LinearLayout>
-</FrameLayout>
\ No newline at end of file
+</LinearLayout>
\ No newline at end of file
diff --git a/samples/SupportLeanbackShowcase/app/src/main/res/values/styles.xml b/samples/SupportLeanbackShowcase/app/src/main/res/values/styles.xml
index 752439d..c9b0476 100644
--- a/samples/SupportLeanbackShowcase/app/src/main/res/values/styles.xml
+++ b/samples/SupportLeanbackShowcase/app/src/main/res/values/styles.xml
@@ -54,6 +54,7 @@
     <style name="MovieCardSimpleStyle" parent="Widget.Leanback.ImageCardViewStyle">
         <item name="lbImageCardViewType">Title</item>
         <item name="lbImageCardViewImageStyle">@style/MovieCardImageStyle</item>
+        <item name="cardBackground">@null</item>
     </style>
 
     <style name="MovieCardCompleteStyle" parent="MovieCardSimpleStyle">
@@ -75,6 +76,23 @@
 
     <style name="SquareBigCard" parent="Widget.Leanback.ImageCardViewStyle">
         <item name="lbImageCardViewImageStyle">@style/SquareBigCardImageStyle</item>
+        <item name="cardBackground">@null</item>
+    </style>
+
+    <!-- SideInfo. used in cards example -->
+    <style name="SideInfoCardStyle" parent="Widget.Leanback.BaseCardViewStyle">
+        <item name="cardType">mainOnly</item>
+        <item name="cardBackground">@null</item>
+    </style>
+
+    <!-- TextCardView. used in cards example -->
+    <style name="TextCardStyle" parent="Widget.Leanback.BaseCardViewStyle">
+        <item name="cardBackground">@null</item>
+    </style>
+
+    <!-- CharacterCardView. used in details example -->
+    <style name="CharacterCardStyle" parent="Widget.Leanback.BaseCardViewStyle">
+        <item name="cardBackground">@null</item>
     </style>
 
     <!-- Grid card style. Used by Grid example. -->
@@ -85,6 +103,7 @@
 
     <style name="GridCardStyle" parent="Widget.Leanback.ImageCardViewStyle">
         <item name="lbImageCardViewImageStyle">@style/GridCardImageStyle</item>
+        <item name="cardBackground">@null</item>
     </style>
 
     <!-- A default card style. Used in cards example. -->
@@ -94,6 +113,7 @@
     </style>
 
     <style name="DefaultCardStyle" parent="Widget.Leanback.ImageCardViewStyle">
+        <item name="cardBackground">@null</item>
         <item name="lbImageCardViewImageStyle">@style/DefaultCardImageStyle</item>
     </style>
 
@@ -155,7 +175,6 @@
     </style>
 
     <style name="IconCardStyle" parent="DefaultCardStyle">
-        <item name="cardBackground">@null</item>
         <item name="android:layout_width">96dp</item>
         <item name="android:layout_height">wrap_content</item>
         <item name="lbImageCardViewTitleStyle">@style/IconCardTitleStyle</item>