Merge "MMS API: ApiDemos demo app" into lmp-dev
diff --git a/build/sdk-android-arm64-v8a.atree b/build/sdk-android-arm64-v8a.atree
index 0103b89..99ad56a 100644
--- a/build/sdk-android-arm64-v8a.atree
+++ b/build/sdk-android-arm64-v8a.atree
@@ -14,9 +14,7 @@
 # limitations under the License.
 #
 
-# Copy the ARMv7 specific kernel image to .../kernel-qemu
-# TODO(RM) need a qemu-kernel/arm64? "arm" should be ${TARGET_ARCH}
-prebuilts/qemu-kernel/arm/kernel-qemu-armv7 system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu
+prebuilts/qemu-kernel/${TARGET_ARCH}/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu
 
 # version files for the SDK updater, from development.git
 ${HOST_OUT}/development/sys-img-${TARGET_CPU_ABI}/images_arm64-v8a_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties
diff --git a/ide/eclipse/.classpath b/ide/eclipse/.classpath
index 2c5a688..0cc0a3c 100644
--- a/ide/eclipse/.classpath
+++ b/ide/eclipse/.classpath
@@ -107,15 +107,15 @@
 	<classpathentry kind="src" path="out/target/common/obj/APPS/TeleService_intermediates/src/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/com.android.emailcommon_intermediates/src/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/com.android.services.telephony.common_intermediates/src/src"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/core/java"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/keystore/java"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/location/java"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/media/java"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/packages/services/PacProcessor"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/packages/services/Proxy"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/telecomm/java"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/telephony/java"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/wifi/java"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/keystore/java"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/location/java"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/media/java"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/packages/services/PacProcessor"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/packages/services/Proxy"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/telecomm/java"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/telephony/java"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/wifi/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/ims-common_intermediates/src/src/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/NfcLogTags_intermediates/src/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/services.core_intermediates/src/java"/>
diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml
index 7573f79..0fe694d 100644
--- a/samples/ApiDemos/AndroidManifest.xml
+++ b/samples/ApiDemos/AndroidManifest.xml
@@ -3023,6 +3023,14 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".media.projection.MediaProjectionDemo"
+                android:label="Media/MediaProjection">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <!-- ************************************* -->
         <!--      APPWIDGET PACKAGE SAMPLES           -->
         <!-- ************************************* -->
diff --git a/samples/ApiDemos/res/layout/media_projection.xml b/samples/ApiDemos/res/layout/media_projection.xml
new file mode 100644
index 0000000..412db4c
--- /dev/null
+++ b/samples/ApiDemos/res/layout/media_projection.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+    <SurfaceView
+        android:id="@+id/surface"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        android:layout_centerHorizontal="true"
+        android:layout_alignParentTop="true"/>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:layout_alignParentBottom="true">
+        <ToggleButton
+            android:text="@string/screen_sharing_toggle"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:onClick="onToggleScreenShare"/>
+        <Spinner
+            android:id="@+id/spinner"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1" />
+    </LinearLayout>
+
+</RelativeLayout>
diff --git a/samples/ApiDemos/res/values/strings.xml b/samples/ApiDemos/res/values/strings.xml
index 1fd8d91..8fd47a7 100644
--- a/samples/ApiDemos/res/values/strings.xml
+++ b/samples/ApiDemos/res/values/strings.xml
@@ -787,6 +787,10 @@
     <string name="require_encryption">Require encryption</string>
     <string name="activate_encryption">Activate encryption</string>
 
+    <string name="trust_agent_category">Trust Agent Features</string>
+    <string name="set_trust_agent_component_name">Enabled Component Name</string>
+    <string name="set_trust_agent_feature_list">Enabled Features (comma-separated)</string>
+
     <!-- Strings used by DeviceAdminSample controller code -->
     <string name="password_sufficient">Current password meets policy requirements</string>
     <string name="password_insufficient">Current password does not meet policy requirements</string>
@@ -918,6 +922,7 @@
     <string name="stream_video">Play Streaming Video</string>
     <string name="local_audio">Play Audio from Local File</string>
     <string name="res_audio">Play Audio from Resources</string>
+    <string name="screen_sharing_toggle">Toggle screen sharing</string>
 
     <!-- =========================== -->
     <!-- os examples strings    -->
diff --git a/samples/ApiDemos/res/xml/device_admin_general.xml b/samples/ApiDemos/res/xml/device_admin_general.xml
index cfd0048..1d0084e 100644
--- a/samples/ApiDemos/res/xml/device_admin_general.xml
+++ b/samples/ApiDemos/res/xml/device_admin_general.xml
@@ -57,4 +57,19 @@
 
     </PreferenceCategory>
 
+    <PreferenceCategory
+        android:title="@string/trust_agent_category" >
+
+        <EditTextPreference
+            android:key="key_trust_agent_component"
+            android:title="@string/set_trust_agent_component_name"
+            android:dialogTitle="@string/set_trust_agent_component_name" />
+
+        <EditTextPreference
+            android:key="key_trust_agent_features"
+            android:title="@string/set_trust_agent_feature_list"
+            android:dialogTitle="@string/set_trust_agent_feature_list" />
+
+    </PreferenceCategory>
+
 </PreferenceScreen>
diff --git a/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java b/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java
index f95b1bb..c3e1ed2 100644
--- a/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java
+++ b/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java
@@ -26,6 +26,7 @@
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.preference.CheckBoxPreference;
 import android.preference.EditTextPreference;
@@ -41,6 +42,8 @@
 import android.util.Log;
 import android.widget.Toast;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -71,6 +74,8 @@
     private static final String KEY_DISABLE_NOTIFICATIONS = "key_disable_notifications";
     private static final String KEY_DISABLE_UNREDACTED = "key_disable_unredacted";
     private static final String KEY_DISABLE_TRUST_AGENTS = "key_disable_trust_agents";
+    private static final String KEY_TRUST_AGENT_COMPONENT = "key_trust_agent_component";
+    private static final String KEY_TRUST_AGENT_FEATURES = "key_trust_agent_features";
     private static final String KEY_DISABLE_KEYGUARD_WIDGETS = "key_disable_keyguard_widgets";
     private static final String KEY_DISABLE_KEYGUARD_SECURE_CAMERA
             = "key_disable_keyguard_secure_camera";
@@ -274,6 +279,8 @@
         private CheckBoxPreference mDisableKeyguardNotificationCheckbox;
         private CheckBoxPreference mDisableKeyguardTrustAgentCheckbox;
         private CheckBoxPreference mDisableKeyguardUnredactedCheckbox;
+        private EditTextPreference mTrustAgentComponent;
+        private EditTextPreference mTrustAgentFeatures;
 
         @Override
         public void onCreate(Bundle savedInstanceState) {
@@ -304,6 +311,14 @@
             mDisableKeyguardTrustAgentCheckbox =
                     (CheckBoxPreference) findPreference(KEY_DISABLE_TRUST_AGENTS);
             mDisableKeyguardTrustAgentCheckbox.setOnPreferenceChangeListener(this);
+
+            mTrustAgentComponent =
+                    (EditTextPreference) findPreference(KEY_TRUST_AGENT_COMPONENT);
+            mTrustAgentComponent.setOnPreferenceChangeListener(this);
+
+            mTrustAgentFeatures =
+                    (EditTextPreference) findPreference(KEY_TRUST_AGENT_FEATURES);
+            mTrustAgentFeatures.setOnPreferenceChangeListener(this);
         }
 
         // At onResume time, reload UI with current values as required
@@ -340,8 +355,8 @@
             if (super.onPreferenceChange(preference, newValue)) {
                 return true;
             }
-            boolean value = (Boolean) newValue;
             if (preference == mEnableCheckbox) {
+                boolean value = (Boolean) newValue;
                 if (value != mAdminActive) {
                     if (value) {
                         // Launch the activity to have the user enable our admin.
@@ -359,6 +374,7 @@
                     }
                 }
             } else if (preference == mDisableCameraCheckbox) {
+                boolean value = (Boolean) newValue;
                 mDPM.setCameraDisabled(mDeviceAdminSample, value);
                 // Delay update because the change is only applied after exiting this method.
                 postReloadSummaries();
@@ -366,20 +382,39 @@
                     || preference == mDisableKeyguardSecureCameraCheckbox
                     || preference == mDisableKeyguardNotificationCheckbox
                     || preference == mDisableKeyguardUnredactedCheckbox
-                    || preference == mDisableKeyguardTrustAgentCheckbox) {
-                // Delay update because the change is only applied after exiting this method.
-                getView().post(new Runnable() {
-                    @Override
-                    public void run() {
-                        mDPM.setKeyguardDisabledFeatures(mDeviceAdminSample,
-                                createKeyguardDisabledFlag());
-                    }
-                });
+                    || preference == mDisableKeyguardTrustAgentCheckbox
+                    || preference == mTrustAgentComponent
+                    || preference == mTrustAgentFeatures) {
+                postUpdateDpmDisableFeatures();
                 postReloadSummaries();
             }
             return true;
         }
 
+        private void postUpdateDpmDisableFeatures() {
+            getView().post(new Runnable() {
+                @Override
+                public void run() {
+                    mDPM.setKeyguardDisabledFeatures(mDeviceAdminSample,
+                            createKeyguardDisabledFlag());
+                    String component = mTrustAgentComponent.getText();
+                    if (component != null) {
+                        ComponentName agent = ComponentName.unflattenFromString(component);
+                        if (agent != null) {
+                            String featureString = mTrustAgentFeatures.getText();
+                            if (featureString != null) {
+                                List<String> features = Arrays.asList(featureString.split(","));
+                                mDPM.setTrustAgentFeaturesEnabled(mDeviceAdminSample, agent,
+                                        features);
+                            }
+                        } else {
+                            Log.w(TAG, "Invalid component: " + component);
+                        }
+                    }
+                }
+            });
+        }
+
         @Override
         protected void reloadSummaries() {
             super.reloadSummaries();
@@ -416,6 +451,17 @@
                         R.string.keyguard_trust_agents_disabled
                         : R.string.keyguard_trust_agents_enabled);
             mDisableKeyguardTrustAgentCheckbox.setSummary(keyguardEnableTrustAgentSummary);
+
+            final SharedPreferences prefs = getPreferenceManager().getSharedPreferences();
+            final boolean trustDisabled =
+                    (disabled & DevicePolicyManager.KEYGUARD_DISABLE_TRUST_AGENTS) != 0;
+            String component = prefs.getString(mTrustAgentComponent.getKey(), null);
+            mTrustAgentComponent.setSummary(component);
+            mTrustAgentComponent.setEnabled(trustDisabled);
+
+            String features = prefs.getString(mTrustAgentFeatures.getKey(), null);
+            mTrustAgentFeatures.setSummary(features);
+            mTrustAgentFeatures.setEnabled(trustDisabled);
         }
 
         /** Updates the device capabilities area (dis/enabling) as the admin is (de)activated */
@@ -426,6 +472,8 @@
             mDisableKeyguardNotificationCheckbox.setEnabled(enabled);
             mDisableKeyguardUnredactedCheckbox.setEnabled(enabled);
             mDisableKeyguardTrustAgentCheckbox.setEnabled(enabled);
+            mTrustAgentComponent.setEnabled(enabled);
+            mTrustAgentFeatures.setEnabled(enabled);
         }
     }
 
diff --git a/samples/ApiDemos/src/com/example/android/apis/media/projection/MediaProjectionDemo.java b/samples/ApiDemos/src/com/example/android/apis/media/projection/MediaProjectionDemo.java
new file mode 100644
index 0000000..e4ba329
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/media/projection/MediaProjectionDemo.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.media.projection;
+
+import com.example.android.apis.R;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.hardware.display.DisplayManager;
+import android.hardware.display.VirtualDisplay;
+import android.media.projection.MediaProjection;
+import android.media.projection.MediaProjectionManager;
+import android.os.Bundle;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.view.Surface;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Spinner;
+import android.widget.Toast;
+import android.widget.ToggleButton;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MediaProjectionDemo extends Activity {
+    private static final String TAG = "MediaProjectionDemo";
+    private static final int PERMISSION_CODE = 1;
+    private static final List<Resolution> RESOLUTIONS = new ArrayList<Resolution>() {{
+        add(new Resolution(640,360));
+        add(new Resolution(960,540));
+        add(new Resolution(1366,768));
+        add(new Resolution(1600,900));
+    }};
+
+    private int mScreenDensity;
+    private MediaProjectionManager mProjectionManager;
+
+    private int mDisplayWidth;
+    private int mDisplayHeight;
+    private boolean mScreenSharing;
+
+    private MediaProjection mMediaProjection;
+    private VirtualDisplay mVirtualDisplay;
+    private Surface mSurface;
+    private SurfaceView mSurfaceView;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.media_projection);
+
+        DisplayMetrics metrics = new DisplayMetrics();
+        getWindowManager().getDefaultDisplay().getMetrics(metrics);
+        mScreenDensity = metrics.densityDpi;
+
+        mSurfaceView = (SurfaceView) findViewById(R.id.surface);
+        mSurface = mSurfaceView.getHolder().getSurface();
+        mProjectionManager =
+            (MediaProjectionManager) getSystemService(Context.MEDIA_PROJECTION_SERVICE);
+
+        ArrayAdapter<Resolution> arrayAdapter = new ArrayAdapter<Resolution>(
+                this, android.R.layout.simple_list_item_1, RESOLUTIONS);
+        Spinner s = (Spinner) findViewById(R.id.spinner);
+        s.setAdapter(arrayAdapter);
+        s.setOnItemSelectedListener(new ResolutionSelector());
+        s.setSelection(0);
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        if (mMediaProjection != null) {
+            mMediaProjection.stop();
+            mMediaProjection = null;
+        }
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        if (requestCode != PERMISSION_CODE) {
+            Log.e(TAG, "Unknown request code: " + requestCode);
+            return;
+        }
+        if (resultCode != RESULT_OK) {
+            Toast.makeText(this,
+                    "User denied screen sharing permission", Toast.LENGTH_SHORT).show();
+            return;
+        }
+        mMediaProjection = mProjectionManager.getMediaProjection(resultCode, data);
+        mVirtualDisplay = createVirtualDisplay();
+    }
+
+    public void onToggleScreenShare(View view) {
+        if (((ToggleButton) view).isChecked()) {
+            shareScreen();
+        } else {
+            stopScreenSharing();
+        }
+    }
+
+    private void shareScreen() {
+        mScreenSharing = true;
+        if (mSurface == null) {
+            return;
+        }
+        if (mMediaProjection == null) {
+            startActivityForResult(mProjectionManager.getScreenCaptureIntent(), PERMISSION_CODE);
+            return;
+        }
+        mVirtualDisplay = createVirtualDisplay();
+    }
+
+    private void stopScreenSharing() {
+        mScreenSharing = false;
+        if (mVirtualDisplay == null) {
+            return;
+        }
+        mVirtualDisplay.release();
+    }
+
+    private VirtualDisplay createVirtualDisplay() {
+        return mMediaProjection.createVirtualDisplay("ScreenSharingDemo",
+                mDisplayWidth, mDisplayHeight, mScreenDensity,
+                DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
+                mSurface, null /*Callbacks*/, null /*Handler*/);
+    }
+
+    private void resizeVirtualDisplay() {
+        if (mVirtualDisplay == null) {
+            return;
+        }
+        mVirtualDisplay.resize(mDisplayWidth, mDisplayHeight, mScreenDensity);
+    }
+
+    private class ResolutionSelector implements Spinner.OnItemSelectedListener {
+        @Override
+        public void onItemSelected(AdapterView<?> parent, View v, int pos, long id) {
+            Resolution r = (Resolution) parent.getItemAtPosition(pos);
+            ViewGroup.LayoutParams lp = mSurfaceView.getLayoutParams();
+            if (getResources().getConfiguration().orientation
+                    == Configuration.ORIENTATION_LANDSCAPE) {
+                mDisplayHeight = r.y;
+                mDisplayWidth = r.x;
+            } else {
+                mDisplayHeight = r.x;
+                mDisplayWidth = r.y;
+            }
+            lp.height = mDisplayHeight;
+            lp.width = mDisplayWidth;
+            mSurfaceView.setLayoutParams(lp);
+        }
+
+        @Override
+        public void onNothingSelected(AdapterView<?> parent) { /* Ignore */ }
+    }
+
+    private class MediaProjectionCallback extends MediaProjection.Callback {
+        @Override
+        public void onStop() {
+            mMediaProjection = null;
+            stopScreenSharing();
+        }
+    }
+
+    private class SurfaceCallbacks implements SurfaceHolder.Callback {
+        @Override
+        public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
+            mDisplayWidth = width;
+            mDisplayHeight = height;
+            resizeVirtualDisplay();
+        }
+
+        @Override
+        public void surfaceCreated(SurfaceHolder holder) {
+            mSurface = holder.getSurface();
+            if (mScreenSharing) {
+                shareScreen();
+            }
+        }
+
+        @Override
+        public void surfaceDestroyed(SurfaceHolder holder) {
+            if (!mScreenSharing) {
+                stopScreenSharing();
+            }
+        }
+    }
+
+    private static class Resolution {
+        int x;
+        int y;
+
+        public Resolution(int x, int y) {
+            this.x = x;
+            this.y = y;
+        }
+
+        @Override
+        public String toString() {
+            return x + "x" + y;
+        }
+    }
+}
diff --git a/samples/Support7Demos/AndroidManifest.xml b/samples/Support7Demos/AndroidManifest.xml
index 32c14ae..14076c3 100644
--- a/samples/Support7Demos/AndroidManifest.xml
+++ b/samples/Support7Demos/AndroidManifest.xml
@@ -204,6 +204,15 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".widget.GridLayoutManagerActivity"
+                  android:label="@string/grid_layout_manager"
+                  android:theme="@style/Theme.AppCompat">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="com.example.android.supportv7.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <activity android:name=".view.CardViewActivity"
                   android:label="@string/card_view"
                   android:theme="@style/Theme.AppCompat">
diff --git a/samples/Support7Demos/res/layout/activity_linear_layout_manager.xml b/samples/Support7Demos/res/layout/activity_base_layout_manager.xml
similarity index 88%
rename from samples/Support7Demos/res/layout/activity_linear_layout_manager.xml
rename to samples/Support7Demos/res/layout/activity_base_layout_manager.xml
index d671c73..f75018e 100644
--- a/samples/Support7Demos/res/layout/activity_linear_layout_manager.xml
+++ b/samples/Support7Demos/res/layout/activity_base_layout_manager.xml
@@ -21,6 +21,13 @@
             android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_height="wrap_content">
+        <CheckBox
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:id="@+id/enable_smooth_scroll"
+                android:text="smooth scroll"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"/>
         <EditText
                 android:id="@+id/scroll_offset"
                 android:layout_width="wrap_content"
@@ -31,11 +38,10 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:id="@+id/spinner"/>
-        <CheckBox
-                android:id="@+id/enable_smooth_scroll"
-                android:text="smooth scroll"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"/>
+        <Button android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="scroll"
+                android:onClick="onScrollClicked"/>
     </LinearLayout>
 
     <android.support.v7.widget.RecyclerView
diff --git a/samples/Support7Demos/res/values/strings.xml b/samples/Support7Demos/res/values/strings.xml
index 8530f00..04dad5d 100644
--- a/samples/Support7Demos/res/values/strings.xml
+++ b/samples/Support7Demos/res/values/strings.xml
@@ -97,7 +97,8 @@
 
     <string name="recycler_view">RecyclerView/RecyclerViewActivity</string>
     <string name="animated_recycler_view">RecyclerView/AnimatedRecyclerView</string>
-    <string name="linear_layout_manager">Linear Layout Manager</string>
+    <string name="linear_layout_manager">RecyclerView/Linear Layout Manager</string>
+    <string name="grid_layout_manager">RecyclerView/Grid Layout Manager</string>
     <string name="checkbox_orientation">Horz.</string>
     <string name="checkbox_reverse">Rev.</string>
     <string name="checkbox_layout_dir">Layout Dir</string>
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/widget/BaseLayoutManagerActivity.java b/samples/Support7Demos/src/com/example/android/supportv7/widget/BaseLayoutManagerActivity.java
new file mode 100644
index 0000000..0a6ac6d
--- /dev/null
+++ b/samples/Support7Demos/src/com/example/android/supportv7/widget/BaseLayoutManagerActivity.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.supportv7.widget;
+
+import com.example.android.supportv7.Cheeses;
+import com.example.android.supportv7.R;
+import com.example.android.supportv7.widget.adapter.SimpleStringAdapter;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Bundle;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.EditText;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+/**
+ * A simple activity that can be extended to demonstrate LayoutManagers.
+ * <p>
+ * It initializes a sample adapter and a list of configuration options. Extending activities can
+ * define the {@link ConfigToggle} list depending on its functionality.
+ */
+abstract public class BaseLayoutManagerActivity<T extends RecyclerView.LayoutManager>
+        extends Activity {
+
+    protected T mLayoutManager;
+
+    protected RecyclerView mRecyclerView;
+
+    private ConfigToggle[] mConfigToggles;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_base_layout_manager);
+        initToggles();
+        initRecyclerView();
+        initSpinner();
+    }
+
+    abstract protected T createLayoutManager();
+
+    private void initRecyclerView() {
+        mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
+        mRecyclerView.setHasFixedSize(true);
+        mLayoutManager = createLayoutManager();
+        mRecyclerView.setLayoutManager(mLayoutManager);
+        mRecyclerView.setAdapter(createAdapter());
+        mRecyclerView.getItemAnimator().setSupportsChangeAnimations(true);
+        onRecyclerViewInit(mRecyclerView);
+    }
+
+    protected void onRecyclerViewInit(RecyclerView recyclerView) {
+
+    }
+
+    protected RecyclerView.Adapter createAdapter() {
+        return new SimpleStringAdapter(this, Cheeses.sCheeseStrings) {
+            @Override
+            public SimpleStringAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
+                    int viewType) {
+                final SimpleStringAdapter.ViewHolder vh = super
+                        .onCreateViewHolder(parent, viewType);
+                vh.itemView.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        final int pos = vh.getPosition();
+                        if (pos + 1 < getItemCount()) {
+                            swap(pos, pos + 1);
+                        }
+                        notifyItemChanged(pos);
+                    }
+                });
+                return vh;
+            }
+        };
+    }
+
+    private void initToggles() {
+        mConfigToggles = createConfigToggles();
+        RecyclerView configView = (RecyclerView) findViewById(R.id.config_recycler_view);
+        configView.setAdapter(mConfigAdapter);
+        configView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL,
+                false));
+        configView.setHasFixedSize(true);
+    }
+
+    public void onScrollClicked(View view) {
+        final EditText scrollOffset = (EditText) findViewById(R.id.scroll_offset);
+        final CheckBox checkBox = (CheckBox) findViewById(R.id.enable_smooth_scroll);
+        final Spinner spinner = (Spinner) findViewById(R.id.spinner);
+
+        Integer offset = null;
+        String offsetString = scrollOffset.getText().toString();
+        try {
+            offset = Integer.parseInt(offsetString);
+        } catch (NumberFormatException ex) {
+
+        }
+        final boolean smooth = checkBox.isChecked();
+        if (offset == null) {
+            scrollToPosition(smooth, spinner.getSelectedItemPosition());
+        } else {
+            scrollToPositionWithOffset(smooth, spinner.getSelectedItemPosition(), offset);
+        }
+    }
+
+    private void initSpinner() {
+        final Spinner spinner = (Spinner) findViewById(R.id.spinner);
+        spinner.setAdapter(new BaseAdapter() {
+            @Override
+            public int getCount() {
+                return mRecyclerView.getAdapter().getItemCount();
+            }
+
+            @Override
+            public Integer getItem(int position) {
+                return position;
+            }
+
+            @Override
+            public long getItemId(int position) {
+                return position;
+            }
+
+            @Override
+            public View getView(int position, View convertView, ViewGroup parent) {
+                if (convertView == null) {
+                    convertView = new TextView(parent.getContext());
+                }
+                ((TextView) convertView).setText(" " + position + " ");
+                return convertView;
+            }
+        });
+    }
+
+    protected void scrollToPosition(boolean smooth, int position) {
+        if (smooth) {
+            mRecyclerView.smoothScrollToPosition(position);
+        } else {
+            mRecyclerView.scrollToPosition(position);
+        }
+    }
+
+    protected void scrollToPositionWithOffset(boolean smooth, int position, int offset) {
+        scrollToPosition(smooth, position);
+    }
+
+    abstract ConfigToggle[] createConfigToggles();
+
+    private class ConfigViewHolder extends RecyclerView.ViewHolder
+            implements CompoundButton.OnCheckedChangeListener {
+
+        private CheckBox mCheckBox;
+
+        private ConfigToggle mConfigToggle;
+
+        public ConfigViewHolder(View itemView) {
+            super(itemView);
+            mCheckBox = (CheckBox) itemView;
+            mCheckBox.setOnCheckedChangeListener(this);
+        }
+
+        public void bind(ConfigToggle toggle) {
+            mConfigToggle = toggle;
+            mCheckBox.setText(toggle.getText());
+            mCheckBox.setChecked(toggle.isChecked());
+        }
+
+        @Override
+        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+            if (mConfigToggle != null) {
+                mConfigToggle.onChange(isChecked);
+            }
+        }
+    }
+
+
+    public abstract static class ConfigToggle {
+
+        private String mLabel;
+
+        protected ConfigToggle(Context context, int labelId) {
+            mLabel = context.getResources().getString(labelId);
+        }
+
+        public String getText() {
+            return mLabel;
+        }
+
+        abstract public boolean isChecked();
+
+        abstract public void onChange(boolean newValue);
+    }
+
+
+    private RecyclerView.Adapter mConfigAdapter = new RecyclerView.Adapter<ConfigViewHolder>() {
+        @Override
+        public ConfigViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+            return new ConfigViewHolder(new CheckBox(parent.getContext()));
+        }
+
+        @Override
+        public void onBindViewHolder(ConfigViewHolder holder, int position) {
+            ConfigToggle toggle = mConfigToggles[position];
+            holder.bind(toggle);
+        }
+
+        @Override
+        public int getItemCount() {
+            return mConfigToggles.length;
+        }
+    };
+}
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/widget/GridLayoutManagerActivity.java b/samples/Support7Demos/src/com/example/android/supportv7/widget/GridLayoutManagerActivity.java
new file mode 100644
index 0000000..00cfbf8
--- /dev/null
+++ b/samples/Support7Demos/src/com/example/android/supportv7/widget/GridLayoutManagerActivity.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.android.supportv7.widget;
+
+import com.example.android.supportv7.Cheeses;
+import com.example.android.supportv7.R;
+import com.example.android.supportv7.widget.adapter.SimpleStringAdapter;
+
+import android.support.v4.view.ViewCompat;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.view.ViewGroup;
+
+/**
+ * A sample Activity to demonstrate capabilities of {@link GridLayoutManager}.
+ */
+public class GridLayoutManagerActivity extends BaseLayoutManagerActivity<GridLayoutManager> {
+    SimpleStringAdapter mAdapter;
+    @Override
+    protected GridLayoutManager createLayoutManager() {
+        GridLayoutManager lm = new GridLayoutManager(this, 3);
+        lm.setReverseLayout(true);
+        lm.setSpanSizeLookup(mSpanSizeLookup);
+        return lm;
+    }
+
+    GridLayoutManager.SpanSizeLookup mSpanSizeLookup = new GridLayoutManager.SpanSizeLookup() {
+        @Override
+        public int getSpanSize(int position) {
+            String item = mAdapter.getValueAt(position);
+            return 1 + (Math.abs(item.hashCode()) % mLayoutManager.getSpanCount());
+        }
+    };
+
+    @Override
+    ConfigToggle[] createConfigToggles() {
+        return new ConfigToggle[]{
+                new ConfigToggle(this, R.string.checkbox_orientation) {
+                    @Override
+                    public boolean isChecked() {
+                        return mLayoutManager.getOrientation() == LinearLayoutManager.HORIZONTAL;
+                    }
+
+                    @Override
+                    public void onChange(boolean newValue) {
+                        mLayoutManager.setOrientation(newValue ? LinearLayoutManager.HORIZONTAL
+                                : LinearLayoutManager.VERTICAL);
+                    }
+                },
+                new ConfigToggle(this, R.string.checkbox_reverse) {
+                    @Override
+                    public boolean isChecked() {
+                        return mLayoutManager.getReverseLayout();
+                    }
+
+                    @Override
+                    public void onChange(boolean newValue) {
+                        mLayoutManager.setReverseLayout(newValue);
+                    }
+                },
+                new ConfigToggle(this, R.string.checkbox_layout_dir) {
+                    @Override
+                    public boolean isChecked() {
+                        return ViewCompat.getLayoutDirection(mRecyclerView) ==
+                                ViewCompat.LAYOUT_DIRECTION_RTL;
+                    }
+
+                    @Override
+                    public void onChange(boolean newValue) {
+                        ViewCompat.setLayoutDirection(mRecyclerView, newValue ?
+                                ViewCompat.LAYOUT_DIRECTION_RTL : ViewCompat.LAYOUT_DIRECTION_LTR);
+                    }
+                },
+                new ConfigToggle(this, R.string.checkbox_stack_from_end) {
+                    @Override
+                    public boolean isChecked() {
+                        return mLayoutManager.getStackFromEnd();
+                    }
+
+                    @Override
+                    public void onChange(boolean newValue) {
+                        mLayoutManager.setStackFromEnd(newValue);
+                    }
+                }
+        };
+    }
+
+    @Override
+    protected void scrollToPositionWithOffset(boolean smooth, int position, int offset) {
+        if (smooth) {
+            super.scrollToPositionWithOffset(smooth, position, offset);
+        } else {
+            mLayoutManager.scrollToPositionWithOffset(position, offset);
+        }
+    }
+
+    protected RecyclerView.Adapter createAdapter() {
+        mAdapter = new SimpleStringAdapter(this, Cheeses.sCheeseStrings) {
+            @Override
+            public SimpleStringAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
+                    int viewType) {
+                final SimpleStringAdapter.ViewHolder vh = super
+                        .onCreateViewHolder(parent, viewType);
+                vh.itemView.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        final int pos = vh.getPosition();
+                        if (pos + 1 < getItemCount()) {
+                            swap(pos, pos + 1);
+                        }
+                        notifyItemChanged(pos);
+                    }
+                });
+                return vh;
+            }
+        };
+        return mAdapter;
+    }
+}
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/widget/LinearLayoutManagerActivity.java b/samples/Support7Demos/src/com/example/android/supportv7/widget/LinearLayoutManagerActivity.java
index 8c2caa9..9aaa558 100644
--- a/samples/Support7Demos/src/com/example/android/supportv7/widget/LinearLayoutManagerActivity.java
+++ b/samples/Support7Demos/src/com/example/android/supportv7/widget/LinearLayoutManagerActivity.java
@@ -16,222 +16,61 @@
 
 package com.example.android.supportv7.widget;
 
-import com.example.android.supportv7.Cheeses;
-import com.example.android.supportv7.widget.adapter.SimpleStringAdapter;
 import com.example.android.supportv7.widget.decorator.DividerItemDecoration;
 
-import android.app.Activity;
-import android.os.Bundle;
 import android.support.v4.view.ViewCompat;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.BaseAdapter;
-import android.widget.CheckBox;
-import android.widget.CompoundButton;
-import android.widget.EditText;
-import android.widget.Spinner;
-import android.widget.TextView;
-
 import com.example.android.supportv7.R;
 
 /**
- * A sample activity that uses {@link android.support.v7.widget.LinearLayoutManager}.
+ * A sample activity that uses {@link LinearLayoutManager}.
  */
-public class LinearLayoutManagerActivity extends Activity {
-
-    private RecyclerView.LayoutManager mListLayoutManager;
-
-    private ListWrapper mListWrapper;
-
-    private RecyclerView mRecyclerView;
-
+public class LinearLayoutManagerActivity extends BaseLayoutManagerActivity<LinearLayoutManager> {
     private DividerItemDecoration mDividerItemDecoration;
 
-    private ConfigToggle[] mConfigToggles;
+    @Override
+    protected LinearLayoutManager createLayoutManager() {
+        return new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
+    }
 
     @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_linear_layout_manager);
-        initConfig();
-        initRecyclerView();
-        initSpinner();
+    protected void onRecyclerViewInit(RecyclerView recyclerView) {
+        mDividerItemDecoration = new DividerItemDecoration(this, mLayoutManager.getOrientation());
+        recyclerView.addItemDecoration(mDividerItemDecoration);
     }
 
-    private void initRecyclerView() {
-        mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
-        mRecyclerView.setHasFixedSize(true);
-        mListLayoutManager = new LinearLayoutManager(this);
-        mRecyclerView.setLayoutManager(mListLayoutManager);
-        mRecyclerView.setAdapter(new SimpleStringAdapter(this, Cheeses.sCheeseStrings) {
-            @Override
-            public SimpleStringAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
-                    int viewType) {
-                final SimpleStringAdapter.ViewHolder vh = super
-                        .onCreateViewHolder(parent, viewType);
-                vh.itemView.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        final int pos = vh.getPosition();
-                        if (pos + 1 < getItemCount()) {
-                            swap(pos, pos + 1);
-                        }
-                        notifyItemChanged(pos);
-                    }
-                });
-                return vh;
-            }
-        });
-        initListForLayoutManager();
-    }
-
-    private void initListForLayoutManager() {
-        mListWrapper = new ListWrapper() {
-            @Override
-            public int getOrientation() {
-                return lm().getOrientation();
-            }
-
-            @Override
-            public void setOrientation(int orientation) {
-                lm().setOrientation(orientation);
-            }
-
-            @Override
-            public boolean getReverseLayout() {
-                return lm().getReverseLayout();
-            }
-
-            @Override
-            public void setReverseLayout(boolean newValue) {
-                lm().setReverseLayout(newValue);
-            }
-
-            @Override
-            public boolean getStackFromEnd() {
-                return lm().getStackFromEnd();
-            }
-
-            @Override
-            public void setStackFromEnd(boolean newValue) {
-                lm().setStackFromEnd(newValue);
-            }
-
-            private LinearLayoutManager lm() {
-                return (LinearLayoutManager) mListLayoutManager;
-            }
-        };
-        if (mDividerItemDecoration != null) {
-            mRecyclerView.removeItemDecoration(mDividerItemDecoration);
-        }
-        mDividerItemDecoration = new DividerItemDecoration(this, mListWrapper.getOrientation());
-        mRecyclerView.addItemDecoration(mDividerItemDecoration);
-    }
-
-    private void initConfig() {
-        RecyclerView configView = (RecyclerView) findViewById(R.id.config_recycler_view);
-        initToggles();
-        configView.setAdapter(mConfigAdapter);
-        configView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL,
-                false));
-        configView.setHasFixedSize(true);
-    }
-
-    private void initSpinner() {
-        final CheckBox checkBox = (CheckBox)
-                findViewById(R.id.enable_smooth_scroll);
-
-        final Spinner spinner = (Spinner) findViewById(R.id.spinner);
-        final EditText scrollOffset = (EditText) findViewById(R.id.scroll_offset);
-        spinner.setAdapter(new BaseAdapter() {
-            @Override
-            public int getCount() {
-                return mRecyclerView.getAdapter().getItemCount();
-            }
-
-            @Override
-            public Integer getItem(int position) {
-                return position;
-            }
-
-            @Override
-            public long getItemId(int position) {
-                return position;
-            }
-
-            @Override
-            public View getView(int position, View convertView, ViewGroup parent) {
-                if (convertView == null) {
-                    convertView = new TextView(parent.getContext());
-                }
-                ((TextView) convertView).setText("" + position);
-                return convertView;
-            }
-        });
-        spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
-            @Override
-            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
-                int offset = Integer.MIN_VALUE;
-                String offsetString = scrollOffset.getText().toString();
-                try {
-                    offset = Integer.parseInt(offsetString);
-                } catch (NumberFormatException ex) {
-
-                }
-
-                if (offset == Integer.MIN_VALUE) {
-                    if (checkBox.isChecked()) {
-                        mRecyclerView.smoothScrollToPosition(position);
-                    } else {
-                        mRecyclerView.scrollToPosition(position);
-                    }
-                } else {
-                    // ignore offset until we add recycling list view with smooth scroll to offset
-                    mRecyclerView.smoothScrollToPosition(position);
-                }
-
-            }
-
-            @Override
-            public void onNothingSelected(AdapterView<?> parent) {
-
-            }
-        });
-    }
-
-    private void initToggles() {
-        mConfigToggles = new ConfigToggle[]{
-                new ConfigToggle(R.string.checkbox_orientation) {
+    @Override
+    BaseLayoutManagerActivity.ConfigToggle[] createConfigToggles() {
+        return new ConfigToggle[]{
+                new ConfigToggle(this, R.string.checkbox_orientation) {
                     @Override
                     public boolean isChecked() {
-                        return mListWrapper.getOrientation() == LinearLayoutManager.HORIZONTAL;
+                        return mLayoutManager.getOrientation() == LinearLayoutManager.HORIZONTAL;
                     }
 
                     @Override
                     public void onChange(boolean newValue) {
-                        mListWrapper.setOrientation(newValue ? LinearLayoutManager.HORIZONTAL
+                        mLayoutManager.setOrientation(newValue ? LinearLayoutManager.HORIZONTAL
                                 : LinearLayoutManager.VERTICAL);
                         if (mDividerItemDecoration != null) {
-                            mDividerItemDecoration.setOrientation(mListWrapper.getOrientation());
+                            mDividerItemDecoration.setOrientation(mLayoutManager.getOrientation());
                         }
 
                     }
                 },
-                new ConfigToggle(R.string.checkbox_reverse) {
+                new ConfigToggle(this, R.string.checkbox_reverse) {
                     @Override
                     public boolean isChecked() {
-                        return mListWrapper.getReverseLayout();
+                        return mLayoutManager.getReverseLayout();
                     }
 
                     @Override
                     public void onChange(boolean newValue) {
-                        mListWrapper.setReverseLayout(newValue);
+                        mLayoutManager.setReverseLayout(newValue);
                     }
                 },
-                new ConfigToggle(R.string.checkbox_layout_dir) {
+                new ConfigToggle(this, R.string.checkbox_layout_dir) {
                     @Override
                     public boolean isChecked() {
                         return ViewCompat.getLayoutDirection(mRecyclerView) ==
@@ -244,103 +83,17 @@
                                 ViewCompat.LAYOUT_DIRECTION_RTL : ViewCompat.LAYOUT_DIRECTION_LTR);
                     }
                 },
-                new ConfigToggle(R.string.checkbox_stack_from_end) {
+                new ConfigToggle(this, R.string.checkbox_stack_from_end) {
                     @Override
                     public boolean isChecked() {
-                        return mListWrapper.getStackFromEnd();
+                        return mLayoutManager.getStackFromEnd();
                     }
 
                     @Override
                     public void onChange(boolean newValue) {
-                        mListWrapper.setStackFromEnd(newValue);
+                        mLayoutManager.setStackFromEnd(newValue);
                     }
                 }
         };
     }
-
-    private class ConfigViewHolder extends RecyclerView.ViewHolder
-            implements CompoundButton.OnCheckedChangeListener {
-
-        private CheckBox mCheckBox;
-
-        private ConfigToggle mConfigToggle;
-
-        public ConfigViewHolder(View itemView) {
-            super(itemView);
-            mCheckBox = (CheckBox) itemView;
-            mCheckBox.setOnCheckedChangeListener(this);
-        }
-
-        public void render(ConfigToggle toggle) {
-            mConfigToggle = toggle;
-            mCheckBox.setText(toggle.getText());
-            mCheckBox.setChecked(toggle.isChecked());
-        }
-
-        @Override
-        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-            if (mConfigToggle != null) {
-                mConfigToggle.onChange(isChecked);
-            }
-        }
-    }
-
-
-    private abstract class ConfigToggle {
-
-        private String mLabel;
-
-        protected ConfigToggle(int labelId) {
-            mLabel = getResources().getString(labelId);
-        }
-
-        public String getText() {
-            return mLabel;
-        }
-
-        abstract public boolean isChecked();
-
-        abstract public void onChange(boolean newValue);
-    }
-
-
-    private RecyclerView.Adapter mConfigAdapter = new RecyclerView.Adapter<ConfigViewHolder>() {
-        @Override
-        public ConfigViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
-            return new ConfigViewHolder(new CheckBox(parent.getContext()));
-        }
-
-        @Override
-        public void onBindViewHolder(ConfigViewHolder holder, int position) {
-            ConfigToggle toggle = mConfigToggles[position];
-            holder.render(toggle);
-        }
-
-        @Override
-        public int getItemCount() {
-            return mConfigToggles.length;
-        }
-    };
-
-
-    /**
-     * To avoid adding interfaces to LayoutManager for the demo, we use this wrapper class to
-     * call different LayoutManagers
-     */
-    private static interface ListWrapper {
-
-        int getOrientation();
-
-        void setOrientation(int orientation);
-
-        boolean getReverseLayout();
-
-        void setReverseLayout(boolean newValue);
-
-        boolean getStackFromEnd();
-
-        void setStackFromEnd(boolean newValue);
-    }
-
-
 }
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/widget/adapter/SimpleStringAdapter.java b/samples/Support7Demos/src/com/example/android/supportv7/widget/adapter/SimpleStringAdapter.java
index a12e79d..49f1e19 100644
--- a/samples/Support7Demos/src/com/example/android/supportv7/widget/adapter/SimpleStringAdapter.java
+++ b/samples/Support7Demos/src/com/example/android/supportv7/widget/adapter/SimpleStringAdapter.java
@@ -33,7 +33,7 @@
     private ArrayList<String> mValues;
 
     public static class ViewHolder extends RecyclerView.ViewHolder {
-
+        public String mBoundString;
         public TextView mTextView;
 
         public ViewHolder(TextView v) {
@@ -47,6 +47,10 @@
         }
     }
 
+    public String getValueAt(int position) {
+        return mValues.get(position);
+    }
+
     public SimpleStringAdapter(Context context, String[] strings) {
         TypedValue val = new TypedValue();
         if (context.getTheme() != null) {
@@ -86,6 +90,7 @@
 
     @Override
     public void onBindViewHolder(ViewHolder holder, int position) {
+        holder.mBoundString = mValues.get(position);
         holder.mTextView.setText(position + ":" + mValues.get(position));
         holder.mTextView.setMinHeight((200 + mValues.get(position).length() * 10));
         holder.mTextView.setBackgroundColor(getBackgroundColor(position));
@@ -95,7 +100,7 @@
         switch (position % 4) {
             case 0: return Color.BLACK;
             case 1: return Color.RED;
-            case 2: return Color.GREEN;
+            case 2: return Color.DKGRAY;
             case 3: return Color.BLUE;
         }
         return Color.TRANSPARENT;
diff --git a/samples/SupportLeanbackDemos/res/drawable-xhdpi/grid_bg.png b/samples/SupportLeanbackDemos/res/drawable-xhdpi/bg.png
similarity index 100%
rename from samples/SupportLeanbackDemos/res/drawable-xhdpi/grid_bg.png
rename to samples/SupportLeanbackDemos/res/drawable-xhdpi/bg.png
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/details_img_16x9.png b/samples/SupportLeanbackDemos/res/drawable/details_img_16x9.png
new file mode 100644
index 0000000..daa505d
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/details_img_16x9.png
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/layout/playback_controls.xml b/samples/SupportLeanbackDemos/res/layout/playback_controls.xml
index 357184c..0c9f43c 100644
--- a/samples/SupportLeanbackDemos/res/layout/playback_controls.xml
+++ b/samples/SupportLeanbackDemos/res/layout/playback_controls.xml
@@ -15,9 +15,20 @@
      limitations under the License.
 -->
 
-<fragment xmlns:android="http://schemas.android.com/apk/res/android"
-    android:name="com.example.android.leanback.PlaybackOverlayFragment"
-    android:id="@+id/playback_controls_fragment"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-/>
+    android:layout_height="match_parent" >
+
+    <ImageView
+        android:id="@+id/media_content"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:src="@drawable/bg" />
+
+    <fragment
+        android:id="@+id/playback_controls_fragment"
+        android:name="com.example.android.leanback.PlaybackOverlayFragment"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
+</FrameLayout>
\ No newline at end of file
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseAnimationFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseAnimationFragment.java
index 9b3a074..e6b92c4 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseAnimationFragment.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseAnimationFragment.java
@@ -93,7 +93,7 @@
                     int index = adapter.indexOf(item);
                     if (index >= 0) {
                         if (index > 0)
-                            index = 0;
+                            index--;
                         adapter.removeItems(index, 1);
                     }
                 }
@@ -247,7 +247,7 @@
 
     ListRow createRandomRow(HeaderItem header) {
         ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(
-                new CardPresenter());
+                new StringPresenter());
         for (int i = 0; i < 8; i++) {
             listRowAdapter.add(createRandomItem());
         }
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/PlaybackOverlayFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/PlaybackOverlayFragment.java
index db674a2..44cd34a 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/PlaybackOverlayFragment.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/PlaybackOverlayFragment.java
@@ -13,16 +13,28 @@
  */
 package com.example.android.leanback;
 
+import java.util.ArrayList;
+
 import android.content.Context;
 import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.os.Handler;
 import android.support.v17.leanback.widget.Action;
 import android.support.v17.leanback.widget.ArrayObjectAdapter;
 import android.support.v17.leanback.widget.ClassPresenterSelector;
+import android.support.v17.leanback.widget.AbstractDetailsDescriptionPresenter;
 import android.support.v17.leanback.widget.PlaybackControlsRow;
+import android.support.v17.leanback.widget.PlaybackControlsRow.PlayPauseAction;
+import android.support.v17.leanback.widget.PlaybackControlsRow.RepeatAction;
+import android.support.v17.leanback.widget.PlaybackControlsRow.ThumbsUpAction;
+import android.support.v17.leanback.widget.PlaybackControlsRow.ThumbsDownAction;
+import android.support.v17.leanback.widget.PlaybackControlsRow.ShuffleAction;
+import android.support.v17.leanback.widget.PlaybackControlsRow.SkipNextAction;
+import android.support.v17.leanback.widget.PlaybackControlsRow.SkipPreviousAction;
 import android.support.v17.leanback.widget.PlaybackControlsRowPresenter;
 import android.support.v17.leanback.widget.HeaderItem;
+import android.support.v17.leanback.widget.VerticalGridView;
 import android.support.v17.leanback.widget.ListRow;
 import android.support.v17.leanback.widget.ListRowPresenter;
 import android.support.v17.leanback.widget.OnActionClickedListener;
@@ -34,17 +46,25 @@
     private static final String TAG = "leanback.PlaybackControlsFragment";
 
     private static final boolean SHOW_DETAIL = true;
-    private static final boolean SHOW_IMAGE = true;
     private static final boolean HIDE_MORE_ACTIONS = false;
-    private static final int TOTAL_TIME_MS = 120 * 1000;
-    private static final int NUM_ROWS = 3;
+    private static final int PRIMARY_CONTROLS = 5;
+    private static final boolean SHOW_IMAGE = PRIMARY_CONTROLS <= 5;
+    private static final int BACKGROUND_TYPE = PlaybackOverlayFragment.BG_LIGHT;
+    private static final int MORE_ROWS = 3;
 
     private ArrayObjectAdapter mRowsAdapter;
     private ArrayObjectAdapter mPrimaryActionsAdapter;
     private ArrayObjectAdapter mSecondaryActionsAdapter;
-    private PlaybackControlsRow.PlayPauseAction mPlayPauseAction;
-    private PlaybackControlsRow.RepeatAction mRepeatAction;
+    private PlayPauseAction mPlayPauseAction;
+    private RepeatAction mRepeatAction;
+    private ThumbsUpAction mThumbsUpAction;
+    private ThumbsDownAction mThumbsDownAction;
+    private ShuffleAction mShuffleAction;
+    private SkipNextAction mSkipNextAction;
+    private SkipPreviousAction mSkipPreviousAction;
     private PlaybackControlsRow mPlaybackControlsRow;
+    private ArrayList<MediaItem> mItems = new ArrayList<MediaItem>();
+    private int mCurrentItem;
     private Handler mHandler;
     private Runnable mRunnable;
 
@@ -55,12 +75,12 @@
 
         mHandler = new Handler();
 
+        setBackgroundType(BACKGROUND_TYPE);
+        setFadingEnabled(false);
+
         setupRows();
     }
 
-    private static void notifyChanged(ArrayObjectAdapter adapter, Action action) {
-        adapter.notifyArrayItemRangeChanged(adapter.indexOf(action), 1);
-    }
 
     private void setupRows() {
         ClassPresenterSelector ps = new ClassPresenterSelector();
@@ -68,28 +88,28 @@
         PlaybackControlsRowPresenter playbackControlsRowPresenter;
         if (SHOW_DETAIL) {
             playbackControlsRowPresenter = new PlaybackControlsRowPresenter(
-                    new DetailsDescriptionPresenter());
+                    new DescriptionPresenter());
         } else {
             playbackControlsRowPresenter = new PlaybackControlsRowPresenter();
         }
         playbackControlsRowPresenter.setOnActionClickedListener(new OnActionClickedListener() {
             public void onActionClicked(Action action) {
-                Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
                 if (action.getId() == mPlayPauseAction.getId()) {
-                    if (mPlayPauseAction.isPlayIconShown()) {
-                        int totalTime = mPlaybackControlsRow.getTotalTime();
-                        if (totalTime > 0 && mPlaybackControlsRow.getCurrentTime() >= totalTime) {
-                            mPlaybackControlsRow.setCurrentTime(0);
-                        }
+                    if (mPlayPauseAction.getIndex() == PlayPauseAction.PLAY) {
                         startProgressAutomation();
+                        setFadingEnabled(true);
                     } else {
                         stopProgressAutomation();
+                        setFadingEnabled(false);
                     }
-                    mPlayPauseAction.toggle();
-                    notifyChanged(mPrimaryActionsAdapter, mPlayPauseAction);
-                } else if (action.getId() == mRepeatAction.getId()) {
-                    mRepeatAction.next();
-                    notifyChanged(mSecondaryActionsAdapter, mRepeatAction);
+                } else if (action.getId() == mSkipNextAction.getId()) {
+                    next();
+                } else if (action.getId() == mSkipPreviousAction.getId()) {
+                    Toast.makeText(getActivity(), "TODO", Toast.LENGTH_SHORT).show();
+                }
+                if (action instanceof PlaybackControlsRow.MultiAction) {
+                    ((PlaybackControlsRow.MultiAction) action).nextIndex();
+                    notifyChanged(action);
                 }
             }
         });
@@ -100,6 +120,7 @@
         mRowsAdapter = new ArrayObjectAdapter(ps);
 
         addPlaybackControlsRow();
+        addOtherRows();
 
         setAdapter(mRowsAdapter);
     }
@@ -107,42 +128,91 @@
     private void addPlaybackControlsRow() {
         Context context = getActivity();
 
-        ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
-        mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
-        mSecondaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
-
         if (SHOW_DETAIL) {
-            mPlaybackControlsRow = new PlaybackControlsRow("Playback Controls Title");
+            mPlaybackControlsRow = new PlaybackControlsRow(new MediaItem());
         } else {
             mPlaybackControlsRow = new PlaybackControlsRow();
         }
-        if (SHOW_IMAGE) {
-            mPlaybackControlsRow.setImageDrawable(context.getResources().getDrawable(
-                    R.drawable.details_img));
-        }
-        mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);
-        mPlaybackControlsRow.setSecondaryActionsAdapter(mSecondaryActionsAdapter);
-        mPlaybackControlsRow.setTotalTime(TOTAL_TIME_MS);
-        mPlaybackControlsRow.setCurrentTime(10 * 1000);
-        mPlaybackControlsRow.setBufferedProgress(75 * 1000);
-
         mRowsAdapter.add(mPlaybackControlsRow);
 
-        mPlayPauseAction = new PlaybackControlsRow.PlayPauseAction(context);
-        mRepeatAction = new PlaybackControlsRow.RepeatAction(context);
+        mItems = new ArrayList<MediaItem>();
+        mItems.add(new MediaItem("Awesome Tune", "The More Awesome Band", R.drawable.details_img, 15*1000));
+        mItems.add(new MediaItem("Pretty nice Tune", "The Nice Guys", R.drawable.details_img, 10*1000));
+        mCurrentItem = 1;
+        updatePlaybackRow(mCurrentItem);
 
-        mPrimaryActionsAdapter.add(new PlaybackControlsRow.SkipPreviousAction(context));
-        mPrimaryActionsAdapter.add(new PlaybackControlsRow.RewindAction(context));
+        ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
+        mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
+        mSecondaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
+        mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);
+        mPlaybackControlsRow.setSecondaryActionsAdapter(mSecondaryActionsAdapter);
+
+        mPlayPauseAction = new PlayPauseAction(context);
+        mRepeatAction = new RepeatAction(context);
+        mThumbsUpAction = new ThumbsUpAction(context);
+        mThumbsDownAction = new ThumbsDownAction(context);
+        mShuffleAction = new ShuffleAction(context);
+        mSkipNextAction = new PlaybackControlsRow.SkipNextAction(context);
+        mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(context);
+
+        if (PRIMARY_CONTROLS > 5) {
+            mPrimaryActionsAdapter.add(mThumbsUpAction);
+        } else {
+            mSecondaryActionsAdapter.add(mThumbsUpAction);
+        }
+        mPrimaryActionsAdapter.add(mSkipPreviousAction);
+        if (PRIMARY_CONTROLS > 3) {
+            mPrimaryActionsAdapter.add(new PlaybackControlsRow.RewindAction(context));
+        }
         mPrimaryActionsAdapter.add(mPlayPauseAction);
-        mPrimaryActionsAdapter.add(new PlaybackControlsRow.FastForwardAction(context));
-        mPrimaryActionsAdapter.add(new PlaybackControlsRow.SkipNextAction(context));
+        if (PRIMARY_CONTROLS > 3) {
+            mPrimaryActionsAdapter.add(new PlaybackControlsRow.FastForwardAction(context));
+        }
+        mPrimaryActionsAdapter.add(mSkipNextAction);
 
-        mSecondaryActionsAdapter.add(new PlaybackControlsRow.ThumbsUpAction(context));
         mSecondaryActionsAdapter.add(mRepeatAction);
-        mSecondaryActionsAdapter.add(new PlaybackControlsRow.ShuffleAction(context));
-        mSecondaryActionsAdapter.add(new PlaybackControlsRow.ThumbsDownAction(context));
+        mSecondaryActionsAdapter.add(mShuffleAction);
+        if (PRIMARY_CONTROLS > 5) {
+            mPrimaryActionsAdapter.add(mThumbsDownAction);
+        } else {
+            mSecondaryActionsAdapter.add(mThumbsDownAction);
+        }
+        mSecondaryActionsAdapter.add(new PlaybackControlsRow.HighQualityAction(context));
+        mSecondaryActionsAdapter.add(new PlaybackControlsRow.ClosedCaptioningAction(context));
+    }
 
-        for (int i = 0; i < NUM_ROWS; ++i) {
+    private void notifyChanged(Action action) {
+        ArrayObjectAdapter adapter = mPrimaryActionsAdapter;
+        if (adapter.indexOf(action) >= 0) {
+            adapter.notifyArrayItemRangeChanged(adapter.indexOf(action), 1);
+            return;
+        }
+        adapter = mSecondaryActionsAdapter;
+        if (adapter.indexOf(action) >= 0) {
+            adapter.notifyArrayItemRangeChanged(adapter.indexOf(action), 1);
+            return;
+        }
+    }
+
+    private void updatePlaybackRow(int index) {
+        if (mPlaybackControlsRow.getItem() != null) {
+            MediaItem item = (MediaItem) mPlaybackControlsRow.getItem();
+            item.title = mItems.get(index).title;
+            item.subtitle = mItems.get(index).subtitle;
+        }
+        if (SHOW_IMAGE) {
+            mPlaybackControlsRow.setImageDrawable(getResources().getDrawable(
+                    mItems.get(mCurrentItem).imageResId));
+        }
+        mRowsAdapter.notifyArrayItemRangeChanged(0, 1);
+
+        mPlaybackControlsRow.setTotalTime(mItems.get(mCurrentItem).durationMs);
+        mPlaybackControlsRow.setCurrentTime(0);
+        mPlaybackControlsRow.setBufferedProgress(75 * 1000);
+    }
+
+    private void addOtherRows() {
+        for (int i = 0; i < MORE_ROWS; ++i) {
             ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new StringPresenter());
             listRowAdapter.add("Some related content");
             listRowAdapter.add("Other related content");
@@ -151,22 +221,35 @@
         }
     }
 
+    private int getUpdatePeriod() {
+        if (getView() == null || mPlaybackControlsRow.getTotalTime() <= 0) {
+            return 1000;
+        }
+        return Math.max(16, mPlaybackControlsRow.getTotalTime() / getView().getWidth());
+    }
+
     private void startProgressAutomation() {
-        int width = getView().getWidth();
-        final int totalTime = mPlaybackControlsRow.getTotalTime();
-        final int updateFreq = totalTime <= 0 ? 1000 :
-                Math.max(16, totalTime / width);
         mRunnable = new Runnable() {
             @Override
             public void run() {
-                int currentTime = mPlaybackControlsRow.getCurrentTime() + updateFreq;
+                int updatePeriod = getUpdatePeriod();
+                int currentTime = mPlaybackControlsRow.getCurrentTime() + updatePeriod;
+                int totalTime = mPlaybackControlsRow.getTotalTime();
                 mPlaybackControlsRow.setCurrentTime(currentTime);
-                if (totalTime <= 0 || totalTime > currentTime) {
-                    mHandler.postDelayed(this, updateFreq);
+                if (totalTime > 0 && totalTime <= currentTime) {
+                    next();
                 }
+                mHandler.postDelayed(this, updatePeriod);
             }
         };
-        mHandler.postDelayed(mRunnable, updateFreq);
+        mHandler.postDelayed(mRunnable, getUpdatePeriod());
+    }
+
+    private void next() {
+        if (++mCurrentItem >= mItems.size()) {
+            mCurrentItem = 0;
+        }
+        updatePlaybackRow(mCurrentItem);
     }
 
     private void stopProgressAutomation() {
@@ -174,4 +257,29 @@
             mHandler.removeCallbacks(mRunnable);
         }
     }
+
+    static class MediaItem {
+        String title;
+        String subtitle;
+        int imageResId;
+        int durationMs;
+
+        MediaItem() {
+        }
+
+        MediaItem(String title, String subtitle, int imageResId, int durationMs) {
+            this.title = title;
+            this.subtitle = subtitle;
+            this.imageResId = imageResId;
+            this.durationMs = durationMs;
+        }
+    }
+
+    static class DescriptionPresenter extends AbstractDetailsDescriptionPresenter {
+        @Override
+        protected void onBindDescription(ViewHolder vh, Object item) {
+            vh.getTitle().setText(((MediaItem) item).title);
+            vh.getSubtitle().setText(((MediaItem) item).subtitle);
+        }
+    }
 }
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/VerticalGridActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/VerticalGridActivity.java
index c5262b9..5107be5 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/VerticalGridActivity.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/VerticalGridActivity.java
@@ -24,6 +24,7 @@
     {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.vertical_grid);
-        getWindow().setBackgroundDrawableResource(R.drawable.grid_bg);
+        // TODO: use BackgroundManager here
+        getWindow().setBackgroundDrawableResource(R.drawable.bg);
     }
 }
diff --git a/samples/browseable/AdapterTransition/res/values/fragmentview_strings.xml b/samples/browseable/AdapterTransition/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/AdapterTransition/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/AdapterTransition/res/values/strings.xml b/samples/browseable/AdapterTransition/res/values/strings.xml
index 7b9d9ec..02b87cf 100755
--- a/samples/browseable/AdapterTransition/res/values/strings.xml
+++ b/samples/browseable/AdapterTransition/res/values/strings.xml
@@ -1,19 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
-  Copyright 2013 The Android Open Source Project
+Copyright 2014 The Android Open Source Project
 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
 
-      http://www.apache.org/licenses/LICENSE-2.0
+http://www.apache.org/licenses/LICENSE-2.0
 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
 -->
 <resources>
-    <string name="sample_show_log">Show Log</string>
-    <string name="sample_hide_log">Hide Log</string>
+    <string name="item_clicked">%s clicked</string>
+    <string name="show_as_grid">Show as grid</string>
+    <string name="show_as_list">Show as list</string>
 </resources>
diff --git a/samples/browseable/AdvancedImmersiveMode/res/values/fragmentview_strings.xml b/samples/browseable/AdvancedImmersiveMode/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/AdvancedImmersiveMode/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/BasicGestureDetect/AndroidManifest.xml b/samples/browseable/BasicGestureDetect/AndroidManifest.xml
index 1d7b3bd..87ed603 100644
--- a/samples/browseable/BasicGestureDetect/AndroidManifest.xml
+++ b/samples/browseable/BasicGestureDetect/AndroidManifest.xml
@@ -22,7 +22,7 @@
     android:versionCode="1"
     android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="17" />
+    <uses-sdk android:minSdkVersion="13" android:targetSdkVersion="17" />
 
     <application android:allowBackup="true"
         android:label="@string/app_name"
diff --git a/samples/browseable/BasicTransition/res/values/fragmentview_strings.xml b/samples/browseable/BasicTransition/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/BasicTransition/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/BasicTransition/res/values/strings.xml b/samples/browseable/BasicTransition/res/values/strings.xml
index 7b9d9ec..319cf31 100755
--- a/samples/browseable/BasicTransition/res/values/strings.xml
+++ b/samples/browseable/BasicTransition/res/values/strings.xml
@@ -1,19 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
-  Copyright 2013 The Android Open Source Project
+ Copyright 2014 The Android Open Source Project
 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
 
-      http://www.apache.org/licenses/LICENSE-2.0
+     http://www.apache.org/licenses/LICENSE-2.0
 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
 -->
 <resources>
-    <string name="sample_show_log">Show Log</string>
-    <string name="sample_hide_log">Hide Log</string>
+
+    <string name="scene">Scene</string>
+    <string name="scene_1">1</string>
+    <string name="scene_2">2</string>
+    <string name="scene_3">3</string>
+    <string name="scene_4">4</string>
+    <string name="hello">Hello!</string>
+    <string name="additional_message">This text fades in and out.</string>
+
 </resources>
diff --git a/samples/browseable/CardEmulation/res/values/fragmentview_strings.xml b/samples/browseable/CardEmulation/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/CardEmulation/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/CardEmulation/res/values/strings.xml b/samples/browseable/CardEmulation/res/values/strings.xml
index 7b9d9ec..f708284 100755
--- a/samples/browseable/CardEmulation/res/values/strings.xml
+++ b/samples/browseable/CardEmulation/res/values/strings.xml
@@ -1,19 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
-  Copyright 2013 The Android Open Source Project
+Copyright (C) 2013 The Android Open Source Project
 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
 
-      http://www.apache.org/licenses/LICENSE-2.0
+     http://www.apache.org/licenses/LICENSE-2.0
 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
 -->
+
 <resources>
-    <string name="sample_show_log">Show Log</string>
-    <string name="sample_hide_log">Hide Log</string>
-</resources>
+    <string name="service_name">CardEmulation Sample</string>
+    <string name="card_title">Sample Loyalty Card</string>
+    <string name="account_number">Account Number</string>
+</resources>
\ No newline at end of file
diff --git a/samples/browseable/CardReader/res/values/fragmentview_strings.xml b/samples/browseable/CardReader/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/CardReader/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/CardReader/res/values/strings.xml b/samples/browseable/CardReader/res/values/strings.xml
index 7b9d9ec..b1b1a49 100755
--- a/samples/browseable/CardReader/res/values/strings.xml
+++ b/samples/browseable/CardReader/res/values/strings.xml
@@ -1,19 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
-  Copyright 2013 The Android Open Source Project
+Copyright (C) 2013 The Android Open Source Project
 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
 
-      http://www.apache.org/licenses/LICENSE-2.0
+     http://www.apache.org/licenses/LICENSE-2.0
 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
 -->
+
 <resources>
-    <string name="sample_show_log">Show Log</string>
-    <string name="sample_hide_log">Hide Log</string>
-</resources>
+    <string name="card_title">Sample Loyalty Card</string>
+    <string name="account_number">Account Number</string>
+</resources>
\ No newline at end of file
diff --git a/samples/browseable/CustomTransition/res/values/fragmentview_strings.xml b/samples/browseable/CustomTransition/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/CustomTransition/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/FragmentTransition/res/values/fragmentview_strings.xml b/samples/browseable/FragmentTransition/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/FragmentTransition/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/FragmentTransition/res/values/strings.xml b/samples/browseable/FragmentTransition/res/values/strings.xml
index 7b9d9ec..5f77789 100755
--- a/samples/browseable/FragmentTransition/res/values/strings.xml
+++ b/samples/browseable/FragmentTransition/res/values/strings.xml
@@ -1,19 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
-  Copyright 2013 The Android Open Source Project
+Copyright 2014 The Android Open Source Project
 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
 
-      http://www.apache.org/licenses/LICENSE-2.0
+  http://www.apache.org/licenses/LICENSE-2.0
 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
 -->
 <resources>
-    <string name="sample_show_log">Show Log</string>
-    <string name="sample_hide_log">Hide Log</string>
+
+    <string name="lorem_ipsum">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</string>
+
 </resources>
diff --git a/samples/browseable/SlidingTabsBasic/res/values/fragmentview_strings.xml b/samples/browseable/SlidingTabsBasic/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/SlidingTabsBasic/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/SlidingTabsColors/res/values/fragmentview_strings.xml b/samples/browseable/SlidingTabsColors/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/SlidingTabsColors/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/SlidingTabsColors/res/values/strings.xml b/samples/browseable/SlidingTabsColors/res/values/strings.xml
index 7b9d9ec..e1b0846 100755
--- a/samples/browseable/SlidingTabsColors/res/values/strings.xml
+++ b/samples/browseable/SlidingTabsColors/res/values/strings.xml
@@ -1,19 +1,9 @@
-<!--
-  Copyright 2013 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
+<?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <string name="sample_show_log">Show Log</string>
-    <string name="sample_hide_log">Hide Log</string>
-</resources>
+
+    <string name="tab_stream">Stream</string>
+    <string name="tab_messages">Messages</string>
+    <string name="tab_notifications">Notifications</string>
+    <string name="tab_photos">Photos</string>
+
+</resources>
\ No newline at end of file
diff --git a/samples/browseable/SwipeRefreshLayoutBasic/res/values/fragmentview_strings.xml b/samples/browseable/SwipeRefreshLayoutBasic/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/SwipeRefreshLayoutBasic/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/SwipeRefreshLayoutBasic/res/values/strings.xml b/samples/browseable/SwipeRefreshLayoutBasic/res/values/strings.xml
index 7b9d9ec..6bdb32e 100755
--- a/samples/browseable/SwipeRefreshLayoutBasic/res/values/strings.xml
+++ b/samples/browseable/SwipeRefreshLayoutBasic/res/values/strings.xml
@@ -1,19 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
-  Copyright 2013 The Android Open Source Project
+ Copyright 2014 The Android Open Source Project
 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
 
-      http://www.apache.org/licenses/LICENSE-2.0
+     http://www.apache.org/licenses/LICENSE-2.0
 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
 -->
+
 <resources>
-    <string name="sample_show_log">Show Log</string>
-    <string name="sample_hide_log">Hide Log</string>
-</resources>
+
+    <string name="menu_refresh">Refresh</string>
+
+</resources>
\ No newline at end of file
diff --git a/samples/browseable/SwipeRefreshListFragment/res/values/fragmentview_strings.xml b/samples/browseable/SwipeRefreshListFragment/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/SwipeRefreshListFragment/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/SwipeRefreshListFragment/res/values/strings.xml b/samples/browseable/SwipeRefreshListFragment/res/values/strings.xml
index 7b9d9ec..21bbcaf 100755
--- a/samples/browseable/SwipeRefreshListFragment/res/values/strings.xml
+++ b/samples/browseable/SwipeRefreshListFragment/res/values/strings.xml
@@ -1,19 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
-  Copyright 2013 The Android Open Source Project
+ Copyright 2014 The Android Open Source Project
 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
 
-      http://www.apache.org/licenses/LICENSE-2.0
+     http://www.apache.org/licenses/LICENSE-2.0
 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
 -->
+
 <resources>
-    <string name="sample_show_log">Show Log</string>
-    <string name="sample_hide_log">Hide Log</string>
-</resources>
+
+    <string name="menu_refresh">Refresh</string>
+
+    <string name="menu_color_scheme">Color scheme</string>
+    <string name="menu_color_scheme_1">Scheme #1</string>
+    <string name="menu_color_scheme_2">Scheme #2</string>
+    <string name="menu_color_scheme_3">Scheme #3</string>
+
+</resources>
\ No newline at end of file
diff --git a/samples/browseable/SwipeRefreshMultipleViews/res/values/fragmentview_strings.xml b/samples/browseable/SwipeRefreshMultipleViews/res/values/fragmentview_strings.xml
new file mode 100755
index 0000000..7b9d9ec
--- /dev/null
+++ b/samples/browseable/SwipeRefreshMultipleViews/res/values/fragmentview_strings.xml
@@ -0,0 +1,19 @@
+<!--
+  Copyright 2013 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<resources>
+    <string name="sample_show_log">Show Log</string>
+    <string name="sample_hide_log">Hide Log</string>
+</resources>
diff --git a/samples/browseable/SwipeRefreshMultipleViews/res/values/strings.xml b/samples/browseable/SwipeRefreshMultipleViews/res/values/strings.xml
index 7b9d9ec..991f0e8 100755
--- a/samples/browseable/SwipeRefreshMultipleViews/res/values/strings.xml
+++ b/samples/browseable/SwipeRefreshMultipleViews/res/values/strings.xml
@@ -1,19 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
-  Copyright 2013 The Android Open Source Project
+ Copyright 2014 The Android Open Source Project
 
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
 
-      http://www.apache.org/licenses/LICENSE-2.0
+     http://www.apache.org/licenses/LICENSE-2.0
 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
 -->
+
 <resources>
-    <string name="sample_show_log">Show Log</string>
-    <string name="sample_hide_log">Hide Log</string>
-</resources>
+
+    <string name="menu_clear">Clear items</string>
+    <string name="menu_refresh">Refresh</string>
+    <string name="empty_text">List is empty! Swipe down to refresh.</string>
+
+</resources>
\ No newline at end of file
diff --git a/samples/wearable/GridViewPager/Wearable/src/main/java/com/example/android/wearable/gridviewpager/MainActivity.java b/samples/wearable/GridViewPager/Wearable/src/main/java/com/example/android/wearable/gridviewpager/MainActivity.java
index 20cae65..20751a3 100644
--- a/samples/wearable/GridViewPager/Wearable/src/main/java/com/example/android/wearable/gridviewpager/MainActivity.java
+++ b/samples/wearable/GridViewPager/Wearable/src/main/java/com/example/android/wearable/gridviewpager/MainActivity.java
@@ -43,6 +43,11 @@
                 int colMargin = res.getDimensionPixelOffset(round ?
                         R.dimen.page_column_margin_round : R.dimen.page_column_margin);
                 pager.setPageMargins(rowMargin, colMargin);
+
+                // GridViewPager relies on insets to properly handle
+                // layout for round displays. They must be explicitly
+                // applied since this listener has taken them over.
+                pager.onApplyWindowInsets(insets);
                 return insets;
             }
         });
diff --git a/samples/wearable/SynchronizedNotifications/Application/src/main/java/com/example/android/wearable/synchronizednotifications/PhoneActivity.java b/samples/wearable/SynchronizedNotifications/Application/src/main/java/com/example/android/wearable/synchronizednotifications/PhoneActivity.java
index 2cac137..eb08334 100644
--- a/samples/wearable/SynchronizedNotifications/Application/src/main/java/com/example/android/wearable/synchronizednotifications/PhoneActivity.java
+++ b/samples/wearable/SynchronizedNotifications/Application/src/main/java/com/example/android/wearable/synchronizednotifications/PhoneActivity.java
@@ -34,8 +34,9 @@
 import com.google.android.gms.wearable.PutDataRequest;
 import com.google.android.gms.wearable.Wearable;
 
-import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Locale;
 
 /**
  * A simple activity that presents three buttons that would trigger three different combinations of
@@ -165,8 +166,8 @@
      * Returns a string built from the current time
      */
     private String now() {
-        DateFormat dateFormat = android.text.format.DateFormat.getTimeFormat(this);
-        return dateFormat.format(new Date());
+        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
+        return sdf.format(new Date());
     }
 
     /**
diff --git a/samples/wearable/SynchronizedNotifications/Wearable/src/main/java/com/example/android/wearable/synchronizednotifications/NotificationUpdateService.java b/samples/wearable/SynchronizedNotifications/Wearable/src/main/java/com/example/android/wearable/synchronizednotifications/NotificationUpdateService.java
index d701ab1..d571483 100644
--- a/samples/wearable/SynchronizedNotifications/Wearable/src/main/java/com/example/android/wearable/synchronizednotifications/NotificationUpdateService.java
+++ b/samples/wearable/SynchronizedNotifications/Wearable/src/main/java/com/example/android/wearable/synchronizednotifications/NotificationUpdateService.java
@@ -107,7 +107,7 @@
                 if (Constants.BOTH_PATH.equals(dataEvent.getDataItem().getUri().getPath())) {
                     // Dismiss the corresponding notification
                     ((NotificationManager) getSystemService(NOTIFICATION_SERVICE))
-                            .cancel(Constants.BOTH_ID);
+                            .cancel(Constants.WATCH_ONLY_ID);
                 }
             }
         }