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
diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml
index 7e8c9e1..a21b23c 100644
--- a/samples/ApiDemos/AndroidManifest.xml
+++ b/samples/ApiDemos/AndroidManifest.xml
@@ -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" />
diff --git a/samples/ApiDemos/res/layout/controls_1.xml b/samples/ApiDemos/res/layout/controls_1.xml
index e280188..cd7fd0d 100644
--- a/samples/ApiDemos/res/layout/controls_1.xml
+++ b/samples/ApiDemos/res/layout/controls_1.xml
@@ -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,139 +16,143 @@
-->
<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">
-
- <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"
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
+ android:layout_height="wrap_content"
+ android:orientation="horizontal" >
- <EditText android:id="@+id/edit2"
+ <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:layout_height="wrap_content"
+ android:orientation="horizontal" >
- </LinearLayout>
+ <EditText
+ android:id="@+id/edit"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1" />
- <CheckBox android:id="@+id/check1"
- android:paddingBottom="24sp"
- android:paddingTop="24sp"
+ <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" />
-
+
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <RadioButton android:id="@+id/radio1"
+ android:orientation="vertical" >
+
+ <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>
+</ScrollView>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/values-v11/styles.xml b/samples/ApiDemos/res/values-v11/styles.xml
index 3b4fead..46ed272 100644
--- a/samples/ApiDemos/res/values-v11/styles.xml
+++ b/samples/ApiDemos/res/values-v11/styles.xml
@@ -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. -->
diff --git a/samples/ApiDemos/res/values-v19/bools.xml b/samples/ApiDemos/res/values-v19/bools.xml
index 136d8fe..3a4b91e 100644
--- a/samples/ApiDemos/res/values-v19/bools.xml
+++ b/samples/ApiDemos/res/values-v19/bools.xml
@@ -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>
diff --git a/samples/ApiDemos/res/values-v19/styles.xml b/samples/ApiDemos/res/values-v19/styles.xml
new file mode 100644
index 0000000..8307228
--- /dev/null
+++ b/samples/ApiDemos/res/values-v19/styles.xml
@@ -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>
diff --git a/samples/ApiDemos/res/values-v99/bools.xml b/samples/ApiDemos/res/values-v99/bools.xml
new file mode 100644
index 0000000..136d8fe
--- /dev/null
+++ b/samples/ApiDemos/res/values-v99/bools.xml
@@ -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>
diff --git a/samples/ApiDemos/res/values-v99/styles.xml b/samples/ApiDemos/res/values-v99/styles.xml
new file mode 100644
index 0000000..33a7472
--- /dev/null
+++ b/samples/ApiDemos/res/values-v99/styles.xml
@@ -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>
diff --git a/samples/ApiDemos/res/values/bools.xml b/samples/ApiDemos/res/values/bools.xml
index fa3f25f..127c142 100644
--- a/samples/ApiDemos/res/values/bools.xml
+++ b/samples/ApiDemos/res/values/bools.xml
@@ -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>
diff --git a/samples/ApiDemos/res/values/styles.xml b/samples/ApiDemos/res/values/styles.xml
index 4d7894f..7ef0e28 100644
--- a/samples/ApiDemos/res/values/styles.xml
+++ b/samples/ApiDemos/res/values/styles.xml
@@ -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">
@@ -91,14 +99,6 @@
<item name="android:windowNoTitle">true</item>
<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>
@@ -124,9 +124,7 @@
<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:windowBackground">@android:color/transparent</item>
<item name="android:windowContentTransitionManager">@transition/activity_transition_mgr</item>
</style>
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Controls8.java b/samples/ApiDemos/src/com/example/android/apis/view/Controls8.java
new file mode 100644
index 0000000..4dd4291
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/view/Controls8.java
@@ -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 {}
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Controls9.java b/samples/ApiDemos/src/com/example/android/apis/view/Controls9.java
new file mode 100644
index 0000000..8a940aa
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/view/Controls9.java
@@ -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 {}