Update browseable samples for lmp-docs

Synced to commit df5e5013422b81b4fd05c0ac9fd964b13624847a. Includes
new samples for Android Auto.

Change-Id: I3fec46e2a6b3f196682a92f1afd91eb682dc2dc1
This commit is contained in:
Trevor Johns
2014-11-12 11:39:30 -08:00
parent fcd28181a1
commit 527a4f30a6
684 changed files with 10100 additions and 10207 deletions

View File

@@ -22,7 +22,7 @@
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
<!-- Min/target SDK versions (<uses-sdk>) managed by build.gradle -->
<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher"

View File

@@ -1,12 +1,15 @@
page.tags="DoneBar"
sample.group=UI
@jd:body
<p>This sample demonstrates a user interface design pattern for simple data
entry from an {@link android.app.ActionBar}. The sample implements a custom
<strong>Done/Cancel</strong> bar to provide users with an easy way to directly
save or cancel their changes. This design pattern is suitable for scenarios
where no additional view details or actions are needed in the action bar.</p>
<p>
This sample demonstrates two alternative presentations of the
action bar that are well-suited for simple data entry scenarios.
In this presentation, a done bar replaces the action
bar entirely, providing two direct actions to persist or dismiss changes. This is
suitable for cases where no additional view details or actions are needed in the
action bar.
</p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

View File

@@ -14,19 +14,37 @@
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Widget.SampleDashboard.Item"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="wrap_content">
<!-- The CardView needs to be wrapped to ensure spacing is applied correctly. -->
<TextView android:id="@android:id/text1"
style="@style/Widget.SampleDashboard.Item.Title"
<android.support.v7.widget.CardView
style="@style/Widget.SampleDashboard.Card"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content">
<TextView android:id="@android:id/text2"
style="@style/Widget.SampleDashboard.Item.Description"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
style="@style/Widget.SampleDashboard.Item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@android:id/text1"
style="@style/Widget.SampleDashboard.Item.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello world" />
<TextView
android:id="@android:id/text2"
style="@style/Widget.SampleDashboard.Item.Description"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
</FrameLayout>

View File

@@ -0,0 +1,22 @@
<!--
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
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>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Material.Light" />
</resources>

View File

@@ -0,0 +1,21 @@
<!--
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
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="teal">#009688</color>
<color name="black_87">#DD000000</color>
<color name="black_54">#89000000</color>
</resources>

View File

@@ -0,0 +1,22 @@
<!--
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>
<dimen name="card_padding">16dp</dimen>
<dimen name="card_margin">8dp</dimen>
</resources>

View File

@@ -15,9 +15,6 @@
limitations under the License.
-->
<resources>
<string name="donebaractivity_title">Done Bar</string>
<string name="donebaractivity_description">In this presentation, a done bar replaces the action bar entirely, providing

View File

@@ -14,9 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<string name="app_name">DoneBar</string>
<string name="intro_message">

View File

@@ -0,0 +1,15 @@
<?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>
</resources>

View File

@@ -34,9 +34,10 @@
<item name="android:paddingRight">@dimen/horizontal_page_margin</item>
</style>
<style name="Widget.SampleMessage">
<style name="Widget.SampleMessage">
<item name="android:textAppearance">?android:textAppearanceMedium</item>
<item name="android:lineSpacingMultiplier">1.1</item>
<item name="android:textColor">@color/black_54</item>
</style>
<style name="Widget.SampleDashboard.Grid" parent="Widget">
@@ -44,28 +45,32 @@
<item name="android:columnWidth">200dp</item>
<item name="android:numColumns">auto_fit</item>
<item name="android:drawSelectorOnTop">true</item>
<item name="android:horizontalSpacing">@dimen/margin_medium</item>
<item name="android:verticalSpacing">@dimen/margin_medium</item>
<item name="android:horizontalSpacing">0dp</item>
<item name="android:verticalSpacing">0dp</item>
</style>
<style name="Widget.SampleDashboard.Card" parent="Widget">
<item name="android:gravity">center</item>
<item name="android:layout_margin">@dimen/card_margin</item>
<item name="cardCornerRadius">4dp</item>
<item name="cardElevation">5dp</item>
<item name="contentPadding">@dimen/card_padding</item>
</style>
<style name="Widget.SampleDashboard.Item" parent="Widget">
<item name="android:background">@drawable/sample_dashboard_item_background</item>
<item name="android:paddingTop">@dimen/margin_small</item>
<item name="android:paddingLeft">@dimen/margin_medium</item>
<item name="android:paddingRight">@dimen/margin_medium</item>
<item name="android:paddingBottom">@dimen/margin_medium</item>
</style>
<style name="Widget.SampleDashboard.Item.Title" parent="Widget">
<item name="android:layout_marginBottom">@dimen/margin_tiny</item>
<item name="android:textAppearance">?android:textAppearanceLarge</item>
<item name="android:textColor">#09c</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/teal</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:textSize">24sp</item>
</style>
<style name="Widget.SampleDashboard.Item.Description" parent="Widget">
<item name="android:textAppearance">?android:textAppearanceSmall</item>
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:textColor">@color/black_87</item>
</style>
</resources>

View File

@@ -14,9 +14,6 @@
* limitations under the License.
*/
package com.example.android.donebar;
import android.app.Activity;