Updated Support7Demos to follow RecyclerView API changes

Move off of deprecated RecyclerView API to illustrate preferred
practices.

Change-Id: I6d2b6450bbb29c55090802b2ccafab6661036dcb
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/widget/RecyclerViewActivity.java b/samples/Support7Demos/src/com/example/android/supportv7/widget/RecyclerViewActivity.java
index 5e0fa31..74333c5 100644
--- a/samples/Support7Demos/src/com/example/android/supportv7/widget/RecyclerViewActivity.java
+++ b/samples/Support7Demos/src/com/example/android/supportv7/widget/RecyclerViewActivity.java
@@ -20,7 +20,6 @@
 import android.R;
 import android.app.Activity;
 import android.content.Context;
-import android.graphics.Rect;
 import android.os.Bundle;
 import android.support.v4.view.MenuItemCompat;
 import android.support.v7.widget.RecyclerView;
@@ -93,7 +92,7 @@
                 oldTop = oldTopView.getTop();
             }
 
-            recycler.scrapAllViewsAttached();
+            detachAndScrapAttachedViews(recycler);
 
             int top = oldTop;
             int bottom;
@@ -104,13 +103,12 @@
             for (int i = 0; mFirstPosition + i < count && top < parentBottom; i++, top = bottom) {
                 View v = recycler.getViewForPosition(adapter, mFirstPosition + i);
                 addView(v, i);
-                v.measure(MeasureSpec.makeMeasureSpec(right - left, MeasureSpec.EXACTLY),
-                        MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
+                measureChild(v, 0, 0);
                 bottom = top + v.getMeasuredHeight();
                 v.layout(left, top, right, bottom);
             }
 
-            recycler.detachDirtyScrapViews();
+            removeAndRecycleScrap(recycler);
         }
 
         @Override
@@ -145,8 +143,7 @@
                         mFirstPosition--;
                         View v = recycler.getViewForPosition(adapter, mFirstPosition);
                         addView(v, 0);
-                        v.measure(MeasureSpec.makeMeasureSpec(right - left, MeasureSpec.EXACTLY),
-                                MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
+                        measureChild(v, 0, 0);
                         final int bottom = topView.getTop(); // TODO decorated top?
                         final int top = bottom - v.getMeasuredHeight();
                         v.layout(left, top, right, bottom);
@@ -167,8 +164,7 @@
                                 mFirstPosition + getChildCount());
                         final int top = getChildAt(getChildCount() - 1).getBottom();
                         addView(v);
-                        v.measure(MeasureSpec.makeMeasureSpec(right - left, MeasureSpec.EXACTLY),
-                                MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
+                        measureChild(v, 0, 0);
                         final int bottom = top + v.getMeasuredHeight();
                         v.layout(left, top, right, bottom);
                     } else {
@@ -176,7 +172,7 @@
                     }
                 }
             }
-            detachAndScrapViewsOutOfBounds(recycler);
+            recycleViewsOutOfBounds(recycler);
             return scrolled;
         }
 
@@ -200,8 +196,7 @@
                     View v = recycler.getViewForPosition(adapter, mFirstPosition);
                     final int bottom = getChildAt(0).getTop(); // TODO decorated top?
                     addView(v, 0);
-                    v.measure(MeasureSpec.makeMeasureSpec(right - left, MeasureSpec.EXACTLY),
-                            MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
+                    measureChild(v, 0, 0);
                     final int top = bottom - v.getMeasuredHeight();
                     v.layout(left, top, right, bottom);
                     if (v.isFocusable()) {
@@ -216,8 +211,7 @@
                     View v = recycler.getViewForPosition(adapter, mFirstPosition + getChildCount());
                     final int top = getChildAt(getChildCount() - 1).getBottom();
                     addView(v);
-                    v.measure(MeasureSpec.makeMeasureSpec(right - left, MeasureSpec.EXACTLY),
-                            MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
+                    measureChild(v, 0, 0);
                     final int bottom = top + v.getMeasuredHeight();
                     v.layout(left, top, right, bottom);
                     if (v.isFocusable()) {
@@ -230,7 +224,7 @@
             return toFocus;
         }
 
-        public void detachAndScrapViewsOutOfBounds(RecyclerView.Recycler recycler) {
+        public void recycleViewsOutOfBounds(RecyclerView.Recycler recycler) {
             final int childCount = getChildCount();
             final int parentWidth = getWidth();
             final int parentHeight = getHeight();
@@ -249,10 +243,10 @@
                 }
             }
             for (int i = childCount - 1; i > last; i--) {
-                recycler.detachAndScrapView(getChildAt(i));
+                removeAndRecycleViewAt(i, recycler);
             }
             for (int i = first - 1; i >= 0; i--) {
-                recycler.detachAndScrapView(getChildAt(i));
+                removeAndRecycleViewAt(i, recycler);
             }
             if (getChildCount() == 0) {
                 mFirstPosition = 0;