From 6e94ff6be96e3fe65054a49d498278631abee5e2 Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Wed, 18 Aug 2010 21:29:29 -0700 Subject: [PATCH] New Views/Controls themes: Theme.Holo and Theme.Light.Holo Change-Id: Ie3cd1ea5713119ce2027096a55e68997127a46f7 --- samples/ApiDemos/AndroidManifest.xml | 44 ++++++++++++++----- .../android/apis/app/FragmentDialog.java | 2 +- .../example/android/apis/view/Controls2.java | 33 +------------- .../example/android/apis/view/Controls3.java | 19 ++++++++ .../example/android/apis/view/Controls4.java | 19 ++++++++ .../com/example/android/apis/view/Tabs3.java | 2 +- .../com/example/android/apis/view/_index.html | 14 ++++-- 7 files changed, 84 insertions(+), 49 deletions(-) create mode 100644 samples/ApiDemos/src/com/example/android/apis/view/Controls3.java create mode 100644 samples/ApiDemos/src/com/example/android/apis/view/Controls4.java diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml index 1ebc3ee9f..a8d556307 100644 --- a/samples/ApiDemos/AndroidManifest.xml +++ b/samples/ApiDemos/AndroidManifest.xml @@ -1220,63 +1220,63 @@ - + - + - + - + - + - + - + - + - + @@ -1503,15 +1503,35 @@ + android:label="Views/Controls/1. Light Theme" + android:theme="@android:style/Theme.Light"> - + + + + + + + + + + + + + + + diff --git a/samples/ApiDemos/src/com/example/android/apis/app/FragmentDialog.java b/samples/ApiDemos/src/com/example/android/apis/app/FragmentDialog.java index bf9a7ea5b..bb2ef8b4d 100644 --- a/samples/ApiDemos/src/com/example/android/apis/app/FragmentDialog.java +++ b/samples/ApiDemos/src/com/example/android/apis/app/FragmentDialog.java @@ -25,8 +25,8 @@ import android.app.FragmentTransaction; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; import android.view.View.OnClickListener; +import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Controls2.java b/samples/ApiDemos/src/com/example/android/apis/view/Controls2.java index 4f4024b2d..42bc29774 100644 --- a/samples/ApiDemos/src/com/example/android/apis/view/Controls2.java +++ b/samples/ApiDemos/src/com/example/android/apis/view/Controls2.java @@ -16,35 +16,4 @@ package com.example.android.apis.view; -// Need the following import to get access to the app resources, since this -// class is in a sub-package. -import com.example.android.apis.R; - -import android.app.Activity; -import android.os.Bundle; -import android.widget.Spinner; -import android.widget.ArrayAdapter; - - -/** - * A gallery of basic controls: Button, EditText, RadioButton, Checkbox, - * Spinner. This example uses the default theme. - */ -public class Controls2 extends Activity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.controls_1); - - Spinner s1 = (Spinner) findViewById(R.id.spinner1); - ArrayAdapter adapter = new ArrayAdapter(this, - android.R.layout.simple_spinner_item, mStrings); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - s1.setAdapter(adapter); - } - - private static final String[] mStrings = { - "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune" - }; -} +public class Controls2 extends Controls1 {} diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Controls3.java b/samples/ApiDemos/src/com/example/android/apis/view/Controls3.java new file mode 100644 index 000000000..407767f5c --- /dev/null +++ b/samples/ApiDemos/src/com/example/android/apis/view/Controls3.java @@ -0,0 +1,19 @@ +/* + * 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. + * 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 Controls3 extends Controls1 {} diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Controls4.java b/samples/ApiDemos/src/com/example/android/apis/view/Controls4.java new file mode 100644 index 000000000..3dcf310e1 --- /dev/null +++ b/samples/ApiDemos/src/com/example/android/apis/view/Controls4.java @@ -0,0 +1,19 @@ +/* + * 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. + * 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 Controls4 extends Controls1 {} diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Tabs3.java b/samples/ApiDemos/src/com/example/android/apis/view/Tabs3.java index e09f041e5..587bfe8b2 100644 --- a/samples/ApiDemos/src/com/example/android/apis/view/Tabs3.java +++ b/samples/ApiDemos/src/com/example/android/apis/view/Tabs3.java @@ -44,7 +44,7 @@ public class Tabs3 extends TabActivity { // the tab is clicked. tabHost.addTab(tabHost.newTabSpec("tab3") .setIndicator("destroy") - .setContent(new Intent(this, Controls2.class) + .setContent(new Intent(this, Controls1.class) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))); } } diff --git a/samples/ApiDemos/src/com/example/android/apis/view/_index.html b/samples/ApiDemos/src/com/example/android/apis/view/_index.html index a462bc1c5..21d756fb0 100644 --- a/samples/ApiDemos/src/com/example/android/apis/view/_index.html +++ b/samples/ApiDemos/src/com/example/android/apis/view/_index.html @@ -235,13 +235,21 @@

Controls

-
1. Theme White
-
Demonstrates a variety of common form type widgets, such as check boxes and radio buttons using the white theme.
+
1. Theme Light
+
Demonstrates a variety of common form type widgets, such as check boxes and radio buttons using the light theme.
-
2. Theme Dark
+
2. Theme Dark
Demonstrates a variety of common form type widgets, such as check boxes and radio buttons using the dark theme.
+
+
3. Theme Holographic Light
+
Demonstrates a variety of common form type widgets, such as check boxes and radio buttons using the light holographic theme.
+
+
+
4. Theme Holographic Dark
+
Demonstrates a variety of common form type widgets, such as check boxes and radio buttons using the dark holographic theme.
+

Auto Complete