Dont use R.id.content to host GuidedStepFragment

Added example of set action not focusable

Bug 25352427

Change-Id: Ie9aed8c52d7639c3a39938117be94a65cf2005eb
diff --git a/samples/SupportLeanbackDemos/res/layout/browse.xml b/samples/SupportLeanbackDemos/res/layout/browse.xml
index 4d46233..1642c44 100644
--- a/samples/SupportLeanbackDemos/res/layout/browse.xml
+++ b/samples/SupportLeanbackDemos/res/layout/browse.xml
@@ -32,4 +32,9 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent" />
 
+  <!-- container for hosting GuidedStepFragment -->
+  <FrameLayout android:id="@+id/lb_guidedstep_host"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent" />
+
 </FrameLayout>
diff --git a/samples/SupportLeanbackDemos/res/layout/browse_support.xml b/samples/SupportLeanbackDemos/res/layout/browse_support.xml
index 34cdffe..b0c72a4 100644
--- a/samples/SupportLeanbackDemos/res/layout/browse_support.xml
+++ b/samples/SupportLeanbackDemos/res/layout/browse_support.xml
@@ -34,4 +34,9 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent" />
 
+  <!-- container for hosting GuidedStepFragment -->
+  <FrameLayout android:id="@+id/lb_guidedstep_host"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent" />
+
 </FrameLayout>
diff --git a/samples/SupportLeanbackDemos/res/layout/guided_step_activity.xml b/samples/SupportLeanbackDemos/res/layout/guided_step_activity.xml
new file mode 100644
index 0000000..a1de213
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/layout/guided_step_activity.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<!-- container for hosting GuidedStepFragment -->
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+  android:id="@+id/lb_guidedstep_host"
+  android:layout_width="match_parent"
+  android:layout_height="match_parent" />
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java
index f4c8044..6797dbe 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java
@@ -136,7 +136,7 @@
             if (((PhotoItem) item).getImageResourceId() == R.drawable.gallery_photo_6) {
                 GuidedStepFragment.add(getFragmentManager(),
                         new GuidedStepActivity.FirstStepFragment(),
-                        android.R.id.content);
+                        R.id.lb_guidedstep_host);
                 return;
             } else if ( ((PhotoItem) item).getImageResourceId() == R.drawable.gallery_photo_8) {
                 intent = new Intent(getActivity(), BrowseActivity.class);
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseSupportFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseSupportFragment.java
index 7af8755..29851b3 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseSupportFragment.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseSupportFragment.java
@@ -138,7 +138,7 @@
             if (((PhotoItem) item).getImageResourceId() == R.drawable.gallery_photo_6) {
                 GuidedStepSupportFragment.add(getFragmentManager(),
                         new GuidedStepSupportActivity.FirstStepFragment(),
-                        android.R.id.content);
+                        R.id.lb_guidedstep_host);
                 return;
             } else if ( ((PhotoItem) item).getImageResourceId() == R.drawable.gallery_photo_8) {
                 intent = new Intent(getActivity(), BrowseSupportActivity.class);
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java
index 52ed739..46f1ba9 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepActivity.java
@@ -61,7 +61,8 @@
     protected void onCreate(Bundle savedInstanceState) {
         Log.v(TAG, "onCreate");
         super.onCreate(savedInstanceState);
-        GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), android.R.id.content);
+        setContentView(R.layout.guided_step_activity);
+        GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host);
     }
 
     @Override
@@ -174,7 +175,7 @@
         public void onGuidedActionClicked(GuidedAction action) {
             FragmentManager fm = getFragmentManager();
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
-                GuidedStepFragment.add(fm, new SecondStepFragment(), android.R.id.content);
+                GuidedStepFragment.add(fm, new SecondStepFragment(), R.id.lb_guidedstep_host);
             } else if (action.getId() == GuidedAction.ACTION_ID_CANCEL){
                 finishGuidedStepFragments();
             }
@@ -215,7 +216,7 @@
         public void onGuidedActionClicked(GuidedAction action) {
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
                 FragmentManager fm = getFragmentManager();
-                GuidedStepFragment.add(fm, new ThirdStepFragment());
+                GuidedStepFragment.add(fm, new ThirdStepFragment(), R.id.lb_guidedstep_host);
             }
         }
 
@@ -301,7 +302,8 @@
                     .description(desc)
                     .multilineDescription(true)
                     .infoOnly(true)
-                    .enabled(false)
+                    .enabled(true)
+                    .focusable(false)
                     .build());
             for (int i = 0; i < OPTION_NAMES.length; i++) {
                 addCheckedAction(actions, OPTION_DRAWABLES[i], getActivity(), OPTION_NAMES[i],
@@ -322,7 +324,7 @@
                 Bundle arguments = new Bundle();
                 arguments.putInt(FourthStepFragment.EXTRA_OPTION, mSelectedOption);
                 f.setArguments(arguments);
-                GuidedStepFragment.add(fm, f, android.R.id.content);
+                GuidedStepFragment.add(fm, f, R.id.lb_guidedstep_host);
             } else {
                 mSelectedOption = getSelectedActionPosition()-1;
             }
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java
index 7f3a33a..8baeb6a 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/GuidedStepSupportActivity.java
@@ -63,7 +63,8 @@
     protected void onCreate(Bundle savedInstanceState) {
         Log.v(TAG, "onCreate");
         super.onCreate(savedInstanceState);
-        GuidedStepSupportFragment.addAsRoot(this, new FirstStepFragment(), android.R.id.content);
+        setContentView(R.layout.guided_step_activity);
+        GuidedStepSupportFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host);
     }
 
     @Override
@@ -176,7 +177,7 @@
         public void onGuidedActionClicked(GuidedAction action) {
             FragmentManager fm = getFragmentManager();
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
-                GuidedStepSupportFragment.add(fm, new SecondStepFragment(), android.R.id.content);
+                GuidedStepSupportFragment.add(fm, new SecondStepFragment(), R.id.lb_guidedstep_host);
             } else if (action.getId() == GuidedAction.ACTION_ID_CANCEL){
                 finishGuidedStepSupportFragments();
             }
@@ -217,7 +218,7 @@
         public void onGuidedActionClicked(GuidedAction action) {
             if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
                 FragmentManager fm = getFragmentManager();
-                GuidedStepSupportFragment.add(fm, new ThirdStepFragment());
+                GuidedStepSupportFragment.add(fm, new ThirdStepFragment(), R.id.lb_guidedstep_host);
             }
         }
 
@@ -303,7 +304,8 @@
                     .description(desc)
                     .multilineDescription(true)
                     .infoOnly(true)
-                    .enabled(false)
+                    .enabled(true)
+                    .focusable(false)
                     .build());
             for (int i = 0; i < OPTION_NAMES.length; i++) {
                 addCheckedAction(actions, OPTION_DRAWABLES[i], getActivity(), OPTION_NAMES[i],
@@ -324,7 +326,7 @@
                 Bundle arguments = new Bundle();
                 arguments.putInt(FourthStepFragment.EXTRA_OPTION, mSelectedOption);
                 f.setArguments(arguments);
-                GuidedStepSupportFragment.add(fm, f, android.R.id.content);
+                GuidedStepSupportFragment.add(fm, f, R.id.lb_guidedstep_host);
             } else {
                 mSelectedOption = getSelectedActionPosition()-1;
             }