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
This commit is contained in:
Kris Giesing
2015-02-16 15:10:05 -08:00
parent 9678c58e02
commit bfcde222e9
17 changed files with 415 additions and 17 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>