Temporarily taking over API Demos v19 for Quantum demos

v19 has been moved to v99 until we have an API rev for L release.

Change-Id: I864ef7962ce5be6f072bfe9866c9f93f12ea438e
This commit is contained in:
Alan Viverette
2014-03-03 14:08:19 -08:00
parent 3a5fd7bea4
commit 2178063c52
11 changed files with 262 additions and 103 deletions

View File

@@ -37,7 +37,7 @@
<!-- For android.media.audiofx.Visualizer -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="17" />
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="19" />
<!-- We will request access to the camera, saying we require a camera
of some sort but not one with autofocus capability. -->
@@ -48,6 +48,7 @@
<application android:name="ApiDemosApplication"
android:label="@string/activity_sample_code"
android:icon="@drawable/app_sample_code"
android:theme="@style/ThemeCurrent"
android:hardwareAccelerated="true"
android:supportsRtl="true">
@@ -78,7 +79,7 @@
<activity android:name=".app.DialogActivity"
android:label="@string/activity_dialog"
android:theme="@android:style/Theme.Holo.Dialog">
android:theme="@style/ThemeCurrentDialog">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -740,7 +741,7 @@
<!-- BEGIN_INCLUDE(interstitial_affinity) -->
<activity android:name=".app.IncomingMessageInterstitial"
android:label="You have messages"
android:theme="@style/ThemeHoloDialog"
android:theme="@style/ThemeCurrentDialog"
android:launchMode="singleTask"
android:taskAffinity=""
android:excludeFromRecents="true">
@@ -2181,8 +2182,9 @@
</activity>
<activity android:name=".view.Controls5"
android:label="Views/Controls/5. Custom Theme"
android:theme="@style/CustomTheme">
android:label="Views/Controls/5. Quantum Light Theme"
android:theme="@android:style/Theme.Quantum.Light"
android:enabled="@bool/atLeastLRelease">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -2190,8 +2192,9 @@
</activity>
<activity android:name=".view.Controls6"
android:label="Views/Controls/6. Holo or Old Theme"
android:theme="@style/ThemeHolo">
android:label="Views/Controls/6. Quantum Dark Theme"
android:theme="@android:style/Theme.Quantum"
android:enabled="@bool/atLeastLRelease">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -2199,7 +2202,25 @@
</activity>
<activity android:name=".view.Controls7"
android:label="Views/Controls/7. Default Theme">
android:label="Views/Controls/7. Custom Theme"
android:theme="@style/CustomTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name=".view.Controls8"
android:label="Views/Controls/7. Current or Old Theme"
android:theme="@style/ThemeCurrent">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name=".view.Controls9"
android:label="Views/Controls/9. Default Theme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -2613,7 +2634,7 @@
<activity android:name=".graphics.TriangleActivity"
android:label="Graphics/OpenGL ES/Textured Triangle"
android:theme="@android:style/Theme.Holo.Dialog"
android:theme="@style/ThemeCurrentDialog"
android:configChanges="keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
<!--
Copyright (C) 2007 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.
@@ -15,55 +16,61 @@
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button android:id="@+id/button"
android:text="@string/controls_1_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button android:id="@+id/button_disabled"
android:text="@string/controls_1_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<EditText android:id="@+id/edit2"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<CheckBox android:id="@+id/check1"
android:paddingBottom="24sp"
android:paddingTop="24sp"
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/controls_1_save" />
<Button
android:id="@+id/button_disabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/controls_1_save" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="@+id/edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<EditText
android:id="@+id/edit2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<CheckBox
android:id="@+id/check1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="24sp"
android:paddingTop="24sp"
android:text="@string/controls_1_checkbox_1" />
<CheckBox android:id="@+id/check2"
<CheckBox
android:id="@+id/check2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/controls_1_checkbox_2" />
@@ -71,83 +78,81 @@
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical" >
<RadioButton android:id="@+id/radio1"
<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/controls_1_radiobutton_1" />
<RadioButton android:id="@+id/radio2"
<RadioButton
android:id="@+id/radio2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/controls_1_radiobutton_2" />
</RadioGroup>
<CheckBox android:id="@+id/star"
<CheckBox
android:id="@+id/star"
style="?android:attr/starStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/controls_1_star" />
<ToggleButton android:id="@+id/toggle1"
<ToggleButton
android:id="@+id/toggle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ToggleButton android:id="@+id/toggle2"
<ToggleButton
android:id="@+id/toggle2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner android:id="@+id/spinner1"
<Spinner
android:id="@+id/spinner1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
/>
android:drawSelectorOnTop="true" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="@string/textColorPrimary"
android:textAppearance="?android:attr/textAppearanceLarge"
android:focusable="true"
/>
android:text="@string/textColorPrimary"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:focusable="true"
android:text="@string/textColorSecondary"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorSecondary"
android:focusable="true"
/>
android:textColor="?android:attr/textColorSecondary" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:focusable="true"
android:text="@string/textColorTertiary"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorTertiary"
android:focusable="true"
/>
android:textColor="?android:attr/textColorTertiary" />
<TextView
style="?android:attr/listSeparatorTextViewStyle"
android:text="@string/listSeparatorTextViewStyle"
android:layout_marginTop="5dip"
/>
android:text="@string/listSeparatorTextViewStyle" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="400dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="(And all inside of a ScrollView!)"
/>
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</ScrollView>

View File

@@ -16,11 +16,11 @@
<resources>
<!-- For API level 11 or later, the Holo theme is available and we prefer that. -->
<style name="ThemeHolo" parent="android:Theme.Holo">
<style name="ThemeCurrent" parent="android:Theme.Holo">
</style>
<!-- For API level 11 or later, the Holo theme is available and we prefer that. -->
<style name="ThemeHoloDialog" parent="android:Theme.Holo.Dialog">
<style name="ThemeCurrentDialog" parent="android:Theme.Holo.Dialog">
</style>
<!-- For API level 11 or later, we can use the magical DialogWhenLarge theme. -->

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project
<!-- 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.
@@ -15,8 +15,8 @@
-->
<resources>
<!-- This resource is true if running under at least KitKat
<!-- This resource is true if running under at least L-Release
API level. The default value is false; an alternative value
for KitKat is true. -->
<bool name="atLeastKitKat">true</bool>
for L-Release is true. -->
<bool name="atLeastLRelease">true</bool>
</resources>

View File

@@ -0,0 +1,35 @@
<?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>
<!-- For API level XX or later, the Quantum theme is available and we prefer that. -->
<style name="ThemeCurrent" parent="android:Theme.Quantum.Light">
</style>
<!-- For API level XX or later, the Holo theme is available and we prefer that. -->
<style name="ThemeCurrentDialog" parent="android:Theme.Quantum.Light.Dialog">
</style>
<!-- For API level XX or later, we can use the magical DialogWhenLarge theme. -->
<style name="ThemeCurrentDialogWhenLarge" parent="android:style/Theme.Quantum.Light.DialogWhenLarge">
</style>
<style name="ActivityTransitionTheme" parent="android:style/Theme.Quantum.Light">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentTransitionManager">@transition/activity_transition_mgr</item>
</style>
</resources>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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
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>
<!-- This resource is true if running under at least KitKat
API level. The default value is false; an alternative value
for KitKat is true. -->
<bool name="atLeastKitKat">true</bool>
</resources>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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>
<!-- For API level XX or later, the Quantum theme is available and we prefer that. -->
<style name="ThemeCurrent" parent="android:Theme.Quantum">
</style>
<!-- For API level XX or later, the Holo theme is available and we prefer that. -->
<style name="ThemeCurrentDialog" parent="android:Theme.Quantum.Dialog">
</style>
<!-- For API level XX or later, we can use the magical DialogWhenLarge theme. -->
<style name="ThemeCurrentDialogWhenLarge" parent="android:style/Theme.Quantum.DialogWhenLarge">
</style>
<style name="ActivityTransitionTheme" parent="android:style/Theme.Quantum">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentTransitionManager">@transition/activity_transition_mgr</item>
</style>
</resources>

View File

@@ -49,4 +49,9 @@
for KitKat is true. -->
<bool name="atLeastKitKat">false</bool>
<!-- This resource is true if running under at least L-Release
API level. The default value is false; an alternative value
for L-Release is true. -->
<bool name="atLeastLRelease">false</bool>
</resources>

View File

@@ -26,25 +26,33 @@
<!-- This is a theme that will adjust itself depending on the API version.
The default definition is the safe one, using a theme that has always
been defined. Look at values-11/styles.xml for a variation that is
selected when the holographic theme is available. -->
<style name="ThemeHolo" parent="android:Theme">
selected when the holographic theme is available, or look at
values-XX/styles.xml for a variation that is selected when the quantum
theme is available. -->
<style name="ThemeCurrent" parent="android:Theme">
</style>
<!-- This is a theme that will adjust itself depending on the API version.
The default definition is the safe one, using a theme that has always
been defined. Look at values-11/styles.xml for a variation that is
selected when the holographic theme is available. -->
<style name="ThemeHoloDialog" parent="android:Theme.Dialog">
selected when the holographic theme is available, or look at
values-XX/styles.xml for a variation that is selected when the quantum
theme is available. -->
<style name="ThemeCurrentDialog" parent="android:Theme.Dialog">
</style>
<!-- Older platforms don't have Theme.Holo.DialogWhenLarge; we will define
our own wrapper theme that uses it only when running on the appropriate
platform version. On older platforms, we always use the generic
fullscreen theme, because they don't support some feature that help
in correctly laying out an activity as a dialog. -->
<style name="ThemeCurrentDialogWhenLarge" parent="android:style/Theme">
</style>
<!-- Base application theme is the default theme. -->
<style name="Theme" parent="android:Theme">
</style>
<!-- Base application theme is the default theme. -->
<style name="BadTheme" parent="@android:style/Theme.Holo.Light.NoActionBar">
</style>
<!-- Variation on our application theme that forces a plain
text style. -->
<style name="Theme.PlainText">
@@ -92,14 +100,6 @@
<item name="android:colorForeground">#fff</item>
</style>
<!-- Older platforms don't have Theme.Holo.DialogWhenLarge; we will define
our own wrapper theme that uses it only when running on the appropriate
platform version. On older platforms, we always use the generic
fullscreen theme, because they don't support some feature that help
in correctly laying out an activity as a dialog. -->
<style name="ThemeDialogWhenLarge" parent="android:style/Theme">
</style>
<style name="TextAppearance.Theme.PlainText" parent="android:TextAppearance.Theme">
<item name="android:textStyle">normal</item>
</style>
@@ -125,8 +125,6 @@
<style name="ActivityTransitionTheme" parent="android:style/Theme.Holo">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<!--
-->
<item name="android:windowContentTransitionManager">@transition/activity_transition_mgr</item>
</style>

View File

@@ -0,0 +1,19 @@
/*
* 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.view;
public class Controls8 extends Controls1 {}

View File

@@ -0,0 +1,19 @@
/*
* 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.view;
public class Controls9 extends Controls1 {}