Add secondary text to cards.

Add some content to PhotoItems so that the ImageCardViews use two lines
of text.

Bug: 18008019
Change-Id: I9bd72f585f76f84df70644b43539210664fbaa0e
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java
index abf82e3..6ce5111 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java
@@ -78,12 +78,12 @@
         for (int i = 0; i < NUM_ROWS; ++i) {
             ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(cardPresenter);
             listRowAdapter.add(new PhotoItem("Hello world", R.drawable.gallery_photo_1));
-            listRowAdapter.add(new PhotoItem("This is a test", R.drawable.gallery_photo_2));
-            listRowAdapter.add(new PhotoItem("Android TV", R.drawable.gallery_photo_3));
+            listRowAdapter.add(new PhotoItem("This is a test", "Only a test", R.drawable.gallery_photo_2));
+            listRowAdapter.add(new PhotoItem("Android TV", "by Google", R.drawable.gallery_photo_3));
             listRowAdapter.add(new PhotoItem("Leanback", R.drawable.gallery_photo_4));
             listRowAdapter.add(new PhotoItem("Hello world", R.drawable.gallery_photo_5));
-            listRowAdapter.add(new PhotoItem("This is a test", R.drawable.gallery_photo_6));
-            listRowAdapter.add(new PhotoItem("Android TV", R.drawable.gallery_photo_7));
+            listRowAdapter.add(new PhotoItem("This is a test", "Only a test", R.drawable.gallery_photo_6));
+            listRowAdapter.add(new PhotoItem("Android TV", "by Google", R.drawable.gallery_photo_7));
             listRowAdapter.add(new PhotoItem("Leanback", R.drawable.gallery_photo_8));
             HeaderItem header = new HeaderItem(i, "Row " + i, null);
             mRowsAdapter.add(new ListRow(header, listRowAdapter));
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/CardPresenter.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/CardPresenter.java
index 17688c2..f5e486b 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/CardPresenter.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/CardPresenter.java
@@ -17,6 +17,7 @@
 import android.graphics.drawable.Drawable;
 import android.support.v17.leanback.widget.ImageCardView;
 import android.support.v17.leanback.widget.Presenter;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.ViewGroup;
 import android.view.View.MeasureSpec;
@@ -87,6 +88,9 @@
                 .getDrawable(photoItem.getImageResourceId());
         ((ImageCardView) viewHolder.view).setMainImage(drawable);
         ((ImageCardView) viewHolder.view).setTitleText(photoItem.getTitle());
+        if (!TextUtils.isEmpty(photoItem.getContent())) {
+            ((ImageCardView) viewHolder.view).setContentText(photoItem.getContent());
+        }
     }
 
     @Override
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/PhotoItem.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/PhotoItem.java
index be3c8a6..adde7d3 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/PhotoItem.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/PhotoItem.java
@@ -19,10 +19,16 @@
 public class PhotoItem implements Parcelable {
 
     private String mTitle;
+    private String mContent;
     private int mImageResourceId;
 
     public PhotoItem(String title, int imageResourceId) {
+        this(title, null, imageResourceId);
+    }
+
+    public PhotoItem(String title, String content, int imageResourceId) {
         mTitle = title;
+        mContent = content;
         mImageResourceId = imageResourceId;
     }
 
@@ -34,6 +40,10 @@
         return mTitle;
     }
 
+    public String getContent() {
+        return mContent;
+    }
+
     @Override
     public String toString() {
         return mTitle;