Add "select tab" to the tab layout / view pager demo.

Change-Id: I30c6b86a220692ef61a8e8eac5acd2952464f15c
diff --git a/samples/SupportDesignDemos/res/layout/design_tabs_viewpager.xml b/samples/SupportDesignDemos/res/layout/design_tabs_viewpager.xml
index b249155..f25a3ce 100644
--- a/samples/SupportDesignDemos/res/layout/design_tabs_viewpager.xml
+++ b/samples/SupportDesignDemos/res/layout/design_tabs_viewpager.xml
@@ -62,6 +62,12 @@
                 android:layout_height="wrap_content"
                 android:text="@string/remove_tab"/>
 
+        <Button
+                android:id="@+id/btn_select_first_tab"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/select_first_tab"/>
+
     </LinearLayout>
 
     <RadioGroup
diff --git a/samples/SupportDesignDemos/res/values/strings.xml b/samples/SupportDesignDemos/res/values/strings.xml
index e65f140..c3a981a 100644
--- a/samples/SupportDesignDemos/res/values/strings.xml
+++ b/samples/SupportDesignDemos/res/values/strings.xml
@@ -49,6 +49,7 @@
 
     <string name="add_tab">Add tab</string>
     <string name="remove_tab">Remove tab</string>
+    <string name="select_first_tab">Select tab #0</string>
 
     <string name="form_username">Username</string>
     <string name="form_email">Email address</string>
diff --git a/samples/SupportDesignDemos/src/com/example/android/support/design/widget/TabLayoutUsage.java b/samples/SupportDesignDemos/src/com/example/android/support/design/widget/TabLayoutUsage.java
index ef776e0..8efccb5 100644
--- a/samples/SupportDesignDemos/src/com/example/android/support/design/widget/TabLayoutUsage.java
+++ b/samples/SupportDesignDemos/src/com/example/android/support/design/widget/TabLayoutUsage.java
@@ -85,6 +85,15 @@
                 }
             }
         });
+
+        findViewById(R.id.btn_select_first_tab).setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                if (mTabLayout.getTabCount() > 0) {
+                    mViewPager.setCurrentItem(0);
+                }
+            }
+        });
     }
 
     private void addRandomTab() {