Add demos for GuidedStepFragment.

Make the main activity a guided step that allows the selection of
other activities.  Add a dedicated activity to represent a
sequence of GuidedStepFragments.

b/18935698

Change-Id: I16142f4d7e87b3f2f02b812faa9bff82ecf5361c
diff --git a/samples/SupportLeanbackDemos/AndroidManifest.xml b/samples/SupportLeanbackDemos/AndroidManifest.xml
index 391bcb7..e429423 100644
--- a/samples/SupportLeanbackDemos/AndroidManifest.xml
+++ b/samples/SupportLeanbackDemos/AndroidManifest.xml
@@ -14,14 +14,17 @@
         android:theme="@style/Theme.Example.Leanback">
 
         <activity android:name="MainActivity"
-            android:label="@string/app_name"
-            android:theme="@style/Theme.Example.Leanback.Browse">
+            android:label="@string/app_name">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
             </intent-filter>
         </activity>
 
+        <activity android:name="BrowseActivity"
+            android:theme="@style/Theme.Example.Leanback.Browse"
+            android:exported="true" />
+
         <activity android:name="BrowseAnimationActivity"
             android:exported="true" >
         </activity>
@@ -44,9 +47,14 @@
             android:exported="true" />
 
         <activity android:name="BrowseErrorActivity"
-                  android:exported="true" />
+            android:exported="true" />
 
         <activity android:name="HorizontalGridTestActivity"
             android:exported="true" />
+
+        <activity android:name="GuidedStepActivity"
+            android:theme="@style/Theme.Example.Leanback.GuidedStep"
+            android:exported="true" />
+
     </application>
 </manifest>
diff --git a/samples/SupportLeanbackDemos/res/drawable-hdpi/ic_main_icon.png b/samples/SupportLeanbackDemos/res/drawable-hdpi/ic_main_icon.png
new file mode 100644
index 0000000..6f0c962
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable-hdpi/ic_main_icon.png
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable-mdpi/ic_main_icon.png b/samples/SupportLeanbackDemos/res/drawable-mdpi/ic_main_icon.png
new file mode 100644
index 0000000..e9effc8
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable-mdpi/ic_main_icon.png
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable-xhdpi/ic_main_icon.png b/samples/SupportLeanbackDemos/res/drawable-xhdpi/ic_main_icon.png
new file mode 100644
index 0000000..2e56516
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable-xhdpi/ic_main_icon.png
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/ic_guidedstep_option_a.png b/samples/SupportLeanbackDemos/res/drawable/ic_guidedstep_option_a.png
new file mode 100644
index 0000000..b1afd78
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/ic_guidedstep_option_a.png
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/ic_guidedstep_option_b.png b/samples/SupportLeanbackDemos/res/drawable/ic_guidedstep_option_b.png
new file mode 100644
index 0000000..3349108
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/ic_guidedstep_option_b.png
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/ic_guidedstep_option_c.png b/samples/SupportLeanbackDemos/res/drawable/ic_guidedstep_option_c.png
new file mode 100644
index 0000000..d92c927
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/ic_guidedstep_option_c.png
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/layout/main.xml b/samples/SupportLeanbackDemos/res/layout/browse.xml
similarity index 100%
rename from samples/SupportLeanbackDemos/res/layout/main.xml
rename to samples/SupportLeanbackDemos/res/layout/browse.xml
diff --git a/samples/SupportLeanbackDemos/res/layout/guidedstep_second_guidance.xml b/samples/SupportLeanbackDemos/res/layout/guidedstep_second_guidance.xml
new file mode 100644
index 0000000..09aaef1
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/layout/guidedstep_second_guidance.xml
@@ -0,0 +1,47 @@
+<?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.
+-->
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent" >
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        style="?attr/guidanceContainerStyle" >
+
+        <ImageView
+            android:id="@+id/guidance_icon"
+            style="@style/Widget.Example.Leanback.SecondStepGuidanceIconStyle"
+            android:layout_width="188dp"
+            tools:ignore="ContentDescription" />
+
+        <TextView
+            android:id="@+id/guidance_title"
+            style="?attr/guidanceTitleStyle" />
+
+        <TextView
+            android:id="@+id/guidance_breadcrumb"
+            style="?attr/guidanceBreadcrumbStyle" />
+
+        <TextView
+            android:id="@+id/guidance_description"
+            style="?attr/guidanceDescriptionStyle" />
+
+    </RelativeLayout>
+
+</FrameLayout>
diff --git a/samples/SupportLeanbackDemos/res/values/colors.xml b/samples/SupportLeanbackDemos/res/values/colors.xml
new file mode 100644
index 0000000..705ce01
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/values/colors.xml
@@ -0,0 +1,19 @@
+<?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.
+-->
+<resources>
+    <color name="icon_background">#4A4F51</color>
+    <color name="icon_alt_background">#2A2F51</color>
+</resources>
diff --git a/samples/SupportLeanbackDemos/res/values/strings.xml b/samples/SupportLeanbackDemos/res/values/strings.xml
index e884043..09e43a6 100644
--- a/samples/SupportLeanbackDemos/res/values/strings.xml
+++ b/samples/SupportLeanbackDemos/res/values/strings.xml
@@ -17,4 +17,33 @@
 
 <resources>
     <string name="app_name">MainActivity</string>
+    <string name="main_breadcrumb">Demo</string>
+    <string name="main_title">Activities</string>
+    <string name="browse">Browse</string>
+    <string name="browse_description">BrowseFragment test</string>
+    <string name="search">Search</string>
+    <string name="search_description">SearchFragment test</string>
+    <string name="details">Details</string>
+    <string name="details_description">DetailsFragment test</string>
+    <string name="playback">Playback</string>
+    <string name="playback_description">PlaybackOverlay test</string>
+    <string name="hgrid">Horizontal Grid</string>
+    <string name="hgrid_description">HorizontalGridView test</string>
+    <string name="vgrid">Vertical Grid</string>
+    <string name="vgrid_description">VerticalGridView test</string>
+    <string name="guidedstep">Guided Step</string>
+    <string name="guidedstep_description">GuidedStepFragment test</string>
+    <string name="browseerror">Browse Error</string>
+    <string name="browseerror_description">BrowseError test</string>
+
+    <!-- Strings related to guided sequence activity -->
+    <string name="guidedstep_first_title">First</string>
+    <string name="guidedstep_first_description">First step of guided sequence</string>
+    <string name="guidedstep_first_breadcrumb">Guided Steps</string>
+    <string name="guidedstep_second_title">Second</string>
+    <string name="guidedstep_second_description">Showcasing different action configurations</string>
+    <string name="guidedstep_second_breadcrumb">Guided Steps</string>
+    <string name="guidedstep_third_title">Third</string>
+    <string name="guidedstep_third_description">Third step of guided sequence</string>
+    <string name="guidedstep_third_breadcrumb">Guided Steps</string>
 </resources>
diff --git a/samples/SupportLeanbackDemos/res/values/styles.xml b/samples/SupportLeanbackDemos/res/values/styles.xml
index 17ea0ef..dd86e7e 100644
--- a/samples/SupportLeanbackDemos/res/values/styles.xml
+++ b/samples/SupportLeanbackDemos/res/values/styles.xml
@@ -20,4 +20,13 @@
     <style name="Widget.Example.Leanback.Rows.VerticalGridView" parent="Widget.Leanback.Rows.VerticalGridView">
         <item name="android:paddingTop">96dp</item>
     </style>
+    <style name="Widget.Example.Leanback.GuidanceIconStyle" parent="Widget.Leanback.GuidanceIconStyle">
+        <item name="android:background">@color/icon_background</item>
+    </style>
+    <style name="Widget.Example.Leanback.FirstStepGuidanceIconStyle" parent="Widget.Leanback.GuidanceIconStyle">
+        <item name="android:background">@color/icon_alt_background</item>
+    </style>
+    <style name="Widget.Example.Leanback.SecondStepGuidanceIconStyle" parent="Widget.Leanback.GuidanceIconStyle">
+        <item name="android:padding">24dp</item>
+    </style>
 </resources>
\ No newline at end of file
diff --git a/samples/SupportLeanbackDemos/res/values/themes.xml b/samples/SupportLeanbackDemos/res/values/themes.xml
index 22a41f0..5d7c232 100644
--- a/samples/SupportLeanbackDemos/res/values/themes.xml
+++ b/samples/SupportLeanbackDemos/res/values/themes.xml
@@ -25,4 +25,10 @@
         <item name="browseTitleTextStyle">@style/Widget.Example.Leanback.Title.Text</item>
         <item name="rowsVerticalGridStyle">@style/Widget.Example.Leanback.Rows.VerticalGridView</item>
     </style>
+    <style name="Theme.Example.Leanback.GuidedStep" parent="Theme.Leanback.GuidedStep">
+        <item name="guidanceIconStyle">@style/Widget.Example.Leanback.GuidanceIconStyle</item>
+    </style>
+    <style name="Theme.Example.Leanback.GuidedStep.First">
+        <item name="guidanceIconStyle">@style/Widget.Example.Leanback.FirstStepGuidanceIconStyle</item>
+    </style>
 </resources>
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseActivity.java
new file mode 100644
index 0000000..fdd81c6
--- /dev/null
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseActivity.java
@@ -0,0 +1,26 @@
+/*
+ * 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.leanback;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class BrowseActivity extends Activity {
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.browse);
+    }
+}
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseErrorActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseErrorActivity.java
index f2f6192..0223101 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseErrorActivity.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseErrorActivity.java
@@ -34,7 +34,7 @@
     public void onCreate(Bundle savedInstanceState)
     {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.main);
+        setContentView(R.layout.browse);
 
         testError();
     }
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java
new file mode 100644
index 0000000..3a3d712
--- /dev/null
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java
@@ -0,0 +1,190 @@
+/*
+ * 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.leanback;
+
+import android.app.Activity;
+import android.app.FragmentManager;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.support.v17.leanback.app.GuidedStepFragment;
+import android.support.v17.leanback.widget.GuidedAction;
+import android.support.v17.leanback.widget.GuidanceStylist;
+import android.support.v17.leanback.widget.GuidanceStylist.Guidance;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Activity that showcases different aspects of GuidedStepFragments.
+ */
+public class GuidedStepActivity extends Activity {
+
+    private static final int CONTINUE = 0;
+    private static final int BACK = 1;
+
+    private static final int OPTION_CHECK_SET_ID = 10;
+    private static final int DEFAULT_OPTION = 0;
+    private static final String[] OPTION_NAMES = { "Option A", "Option B", "Option C" };
+    private static final String[] OPTION_DESCRIPTIONS = { "Here's one thing you can do",
+            "Here's another thing you can do", "Here's one more thing you can do" };
+    private static final int[] OPTION_DRAWABLES = { R.drawable.ic_guidedstep_option_a,
+            R.drawable.ic_guidedstep_option_b, R.drawable.ic_guidedstep_option_c };
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        GuidedStepFragment.add(getFragmentManager(), new FirstStepFragment());
+    }
+
+    private static void addAction(List<GuidedAction> actions, long id, String title, String desc) {
+        actions.add(new GuidedAction.Builder()
+                .id(id)
+                .title(title)
+                .description(desc)
+                .build());
+    }
+
+    private static void addCheckedAction(List<GuidedAction> actions, int iconResId, Context context,
+            String title, String desc) {
+        actions.add(new GuidedAction.Builder()
+                .title(title)
+                .description(desc)
+                .checkSetId(OPTION_CHECK_SET_ID)
+                .iconResourceId(iconResId, context)
+                .build());
+    }
+
+    /**
+     * The first fragment is instantiated via XML, so it must be public.
+     */
+    public static class FirstStepFragment extends GuidedStepFragment {
+        @Override
+        public int onProvideTheme() {
+            return R.style.Theme_Example_Leanback_GuidedStep_First;
+        }
+
+        @Override
+        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+            String title = getString(R.string.guidedstep_first_title);
+            String breadcrumb = getString(R.string.guidedstep_first_breadcrumb);
+            String description = getString(R.string.guidedstep_first_description);
+            Drawable icon = getActivity().getDrawable(R.drawable.ic_main_icon);
+            return new Guidance(title, description, breadcrumb, icon);
+        }
+
+        @Override
+        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+            addAction(actions, CONTINUE, "Continue", "Let's do it");
+            addAction(actions, BACK, "Cancel", "Nevermind");
+        }
+
+        @Override
+        public void onGuidedActionClicked(GuidedAction action) {
+            FragmentManager fm = getFragmentManager();
+            if (action.getId() == CONTINUE) {
+                GuidedStepFragment.add(fm, new SecondStepFragment());
+            } else {
+                getActivity().finish();
+            }
+        }
+    }
+
+    private static class SecondStepFragment extends GuidedStepFragment {
+
+        @Override
+        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+            String title = getString(R.string.guidedstep_second_title);
+            String breadcrumb = getString(R.string.guidedstep_second_breadcrumb);
+            String description = getString(R.string.guidedstep_second_description);
+            Drawable icon = getActivity().getDrawable(R.drawable.ic_main_icon);
+            return new Guidance(title, description, breadcrumb, icon);
+        }
+
+        @Override
+        public GuidanceStylist onCreateGuidanceStylist() {
+            return new GuidanceStylist() {
+                @Override
+                public int onProvideLayoutId() {
+                    return R.layout.guidedstep_second_guidance;
+                }
+            };
+        }
+
+        @Override
+        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+            String desc = "The description can be quite long as well.  ";
+            desc += "Just be sure to set multilineDescription to true in the GuidedAction.";
+            actions.add(new GuidedAction.Builder()
+                    .title("Note that Guided Actions can have titles that are quite long.")
+                    .description(desc)
+                    .multilineDescription(true)
+                    .infoOnly(true)
+                    .enabled(false)
+                    .build());
+            for (int i = 0; i < OPTION_NAMES.length; i++) {
+                addCheckedAction(actions, OPTION_DRAWABLES[i], getActivity(), OPTION_NAMES[i],
+                        OPTION_DESCRIPTIONS[i]);
+                if (i == DEFAULT_OPTION) {
+                    actions.get(actions.size() -1).setChecked(true);
+                }
+            }
+        }
+
+        @Override
+        public void onGuidedActionClicked(GuidedAction action) {
+            FragmentManager fm = getFragmentManager();
+            GuidedStepFragment.add(fm, new ThirdStepFragment(getSelectedActionPosition()-1));
+        }
+
+    }
+
+    private static class ThirdStepFragment extends GuidedStepFragment {
+        private final int mOption;
+
+        public ThirdStepFragment(int option) {
+            mOption = option;
+        }
+
+        @Override
+        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+            String title = getString(R.string.guidedstep_third_title);
+            String breadcrumb = getString(R.string.guidedstep_third_breadcrumb);
+            String description = "You chose: " + OPTION_NAMES[mOption];
+            Drawable icon = getActivity().getDrawable(R.drawable.ic_main_icon);
+            return new Guidance(title, description, breadcrumb, icon);
+        }
+
+        @Override
+        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+            addAction(actions, CONTINUE, "Done", "All finished");
+            addAction(actions, BACK, "Back", "Forgot something...");
+        }
+
+        @Override
+        public void onGuidedActionClicked(GuidedAction action) {
+            if (action.getId() == CONTINUE) {
+                getActivity().finish();
+            } else {
+                getFragmentManager().popBackStack();
+            }
+        }
+
+    }
+
+}
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/MainActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/MainActivity.java
index 74e7fb2..90b1c6f 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/MainActivity.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/MainActivity.java
@@ -1,28 +1,92 @@
 /*
  * 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
+ * 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.
  */
+
 package com.example.android.leanback;
 
 import android.app.Activity;
+import android.content.Intent;
+import android.graphics.drawable.Drawable;
 import android.os.Bundle;
+import android.support.v17.leanback.app.GuidedStepFragment;
+import android.support.v17.leanback.widget.GuidedAction;
+import android.support.v17.leanback.widget.GuidanceStylist.Guidance;
 
-public class MainActivity extends Activity
-{
-    /** Called when the activity is first created. */
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Activity that allows navigation among the demo activities.
+ */
+public class MainActivity extends Activity {
+
+    private GuidedStepFragment mGuidedStepFragment;
+
     @Override
-    public void onCreate(Bundle savedInstanceState)
-    {
+    protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.main);
+
+        mGuidedStepFragment = new StepFragment();
+        GuidedStepFragment.add(getFragmentManager(), mGuidedStepFragment);
     }
+
+    private static class StepFragment extends GuidedStepFragment {
+        @Override
+        public Guidance onCreateGuidance(Bundle savedInstanceState) {
+            String title = getString(R.string.main_title);
+            String breadcrumb = getString(R.string.main_breadcrumb);
+            String description = "";
+            Drawable icon = getActivity().getDrawable(R.drawable.ic_main_icon);
+            return new Guidance(title, description, breadcrumb, icon);
+        }
+
+        @Override
+        public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
+            addAction(actions, BrowseActivity.class, R.string.browse, R.string.browse_description);
+            addAction(actions, SearchActivity.class, R.string.search, R.string.search_description);
+            addAction(actions, DetailsActivity.class, R.string.details, R.string.details_description);
+            actions.get(actions.size()-1).getIntent().putExtra(DetailsActivity.EXTRA_ITEM,
+                    new PhotoItem("Hello world", R.drawable.gallery_photo_1));
+            addAction(actions, PlaybackOverlayActivity.class, R.string.playback,
+                    R.string.playback_description);
+            addAction(actions, HorizontalGridTestActivity.class, R.string.hgrid,
+                    R.string.hgrid_description);
+            addAction(actions, VerticalGridActivity.class, R.string.vgrid,
+                    R.string.vgrid_description);
+            addAction(actions, GuidedStepActivity.class, R.string.guidedstep,
+                    R.string.guidedstep_description);
+            addAction(actions, BrowseErrorActivity.class, R.string.browseerror,
+                    R.string.browseerror_description);
+        }
+
+        private void addAction(List<GuidedAction> actions, Class cls, int titleRes, int descRes) {
+            actions.add(new GuidedAction.Builder()
+                    .intent(new Intent(getActivity(), cls))
+                    .title(getString(titleRes))
+                    .description(getString(descRes))
+                    .build());
+        }
+
+        @Override
+        public void onGuidedActionClicked(GuidedAction action) {
+            Intent intent = action.getIntent();
+            if (intent != null) {
+                startActivity(intent);
+            }
+        }
+
+    }
+
 }