Merge branch 'master' into honeycomb-release

This commit is contained in:
The Android Automerger
2010-12-06 07:26:57 -08:00
6 changed files with 84 additions and 12 deletions

View File

@@ -75,7 +75,7 @@
<activity android:name=".app.DialogActivity"
android:label="@string/activity_dialog"
android:theme="@android:style/Theme.Dialog">
android:theme="@android:style/Theme.Holo.Dialog">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
@@ -1668,7 +1668,7 @@
<activity android:name=".view.Controls3"
android:label="Views/Controls/3. Holo Light Theme"
android:theme="@android:style/Theme.Light.Holo">
android:theme="@android:style/Theme.Holo.Light">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />

View File

@@ -17,8 +17,37 @@
<!-- Demonstrates an activity with a dialog theme.
See corresponding Java code com.android.sdk.app.DialogActivity.java. -->
<!-- This screen consists of a single text field that displays some text. -->
<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text"
android:layout_width="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal"
android:text="@string/dialog_activity_text"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:padding="4dp" android:gravity="center_horizontal">
<!-- Message to show to use. -->
<TextView android:id="@+id/text"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:textStyle="?android:attr/textAppearanceMedium"
android:text="@string/dialog_activity_text"/>
<!-- Container in which we are going to add and remove views, to demonstrate
how the layout adjusts based on size. -->
<LinearLayout android:id="@+id/inner_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="4dp" android:paddingBottom="4dp">
</LinearLayout>
<!-- Alert dialog style buttons along the bottom. -->
<LinearLayout style="?android:attr/alertDialogButtonGroupStyle"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:measureWithLargestChild="true">
<Button style="?android:attr/borderlessButtonStyle" android:id="@+id/add"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_activity_add" />
<Button style="?android:attr/borderlessButtonStyle" android:id="@+id/remove"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_activity_remove" />
</LinearLayout>
</LinearLayout>

View File

@@ -17,9 +17,10 @@
<!-- Demonstrates starting and stopping a local service.
See corresponding Java code com.android.sdk.app.LocalSerice.java. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="4dip"
android:gravity="center_horizontal"
android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:padding="4dip"
android:gravity="center_horizontal"
android:layout_width="match_parent" android:layout_height="match_parent">
<TextView
android:layout_width="match_parent" android:layout_height="wrap_content"

View File

@@ -31,7 +31,10 @@
<string name="activity_dialog">App/Activity/Dialog</string>
<string name="dialog_activity_text">Example of how you can use the
Theme.Dialog theme to make an activity that looks like a
dialog.</string>
dialog. It also has lots of text to show how text wrapping (and
corresponding window size adjustment) can happen in a dialog.</string>
<string name="dialog_activity_add">Add content</string>
<string name="dialog_activity_remove">Remove content</string>
<string name="activity_custom_dialog">App/Activity/Custom Dialog</string>
<string name="custom_dialog_activity_text">Example of how you can use a
custom Theme.Dialog theme to make an activity that looks like a
@@ -372,7 +375,7 @@
<!-- app/dialog examples strings -->
<!-- ============================== -->
<string name="activity_alert_dialog">App/Dialog</string>
<string name="activity_alert_dialog">App/Alert Dialogs</string>
<string name="alert_dialog_two_buttons">OK Cancel dialog with a message</string>
<string name="alert_dialog_two_buttons2">OK Cancel dialog with a long message</string>
<string name="alert_dialog_two_buttons2ultra">OK Cancel dialog with ultra long message</string>

View File

@@ -19,10 +19,17 @@ package com.example.android.apis.app;
// Need the following import to get access to the app resources, since this
// class is in a sub-package.
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.example.android.apis.R;
import com.example.android.apis.app.ForegroundService.Controller;
/**
* <h3>Dialog Activity</h3>
@@ -50,5 +57,30 @@ public class DialogActivity extends Activity {
getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
android.R.drawable.ic_dialog_alert);
Button button = (Button)findViewById(R.id.add);
button.setOnClickListener(mAddContentListener);
button = (Button)findViewById(R.id.remove);
button.setOnClickListener(mRemoveContentListener);
}
private OnClickListener mAddContentListener = new OnClickListener() {
public void onClick(View v) {
LinearLayout layout = (LinearLayout)findViewById(R.id.inner_content);
ImageView iv = new ImageView(DialogActivity.this);
iv.setImageDrawable(getResources().getDrawable(R.drawable.icon48x48_1));
iv.setPadding(4, 4, 4, 4);
layout.addView(iv);
}
};
private OnClickListener mRemoveContentListener = new OnClickListener() {
public void onClick(View v) {
LinearLayout layout = (LinearLayout)findViewById(R.id.inner_content);
int num = layout.getChildCount();
if (num > 0) {
layout.removeViewAt(num-1);
}
}
};
}

View File

@@ -218,6 +218,13 @@ See test_defs.xsd for more information.
coverage_target="framework"
suite="cts" />
<test name="cts-accounts"
build_path="cts/tests/tests/accounts"
package="android.accounts.cts"
runner="android.test.InstrumentationTestRunner"
coverage_target="framework"
suite="cts" />
<test name="cts-api-signature"
build_path="cts/tests/SignatureTest"
package="android.tests.sigtest"