New Views/Controls themes: Theme.Holo and Theme.Light.Holo
Change-Id: Ie3cd1ea5713119ce2027096a55e68997127a46f7
This commit is contained in:
@@ -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<String> adapter = new ArrayAdapter<String>(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 {}
|
||||
|
||||
@@ -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 {}
|
||||
@@ -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 {}
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,13 +235,21 @@
|
||||
|
||||
<h3>Controls</h3>
|
||||
<dl>
|
||||
<dt><a href="Controls1.html">1. Theme White</a></dt>
|
||||
<dd>Demonstrates a variety of common form type widgets, such as check boxes and radio buttons using the white theme. </dd>
|
||||
<dt><a href="Controls1.html">1. Theme Light</a></dt>
|
||||
<dd>Demonstrates a variety of common form type widgets, such as check boxes and radio buttons using the light theme. </dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="Controls2.html">2. Theme Dark</a></dt>
|
||||
<dt><a href="Controls1.html">2. Theme Dark</a></dt>
|
||||
<dd>Demonstrates a variety of common form type widgets, such as check boxes and radio buttons using the dark theme. </dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="Controls1.html">3. Theme Holographic Light</a></dt>
|
||||
<dd>Demonstrates a variety of common form type widgets, such as check boxes and radio buttons using the light holographic theme. </dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><a href="Controls1.html">4. Theme Holographic Dark</a></dt>
|
||||
<dd>Demonstrates a variety of common form type widgets, such as check boxes and radio buttons using the dark holographic theme. </dd>
|
||||
</dl>
|
||||
|
||||
<h3>Auto Complete</h3>
|
||||
<dl>
|
||||
|
||||
Reference in New Issue
Block a user