diff --git a/samples/ApiDemos/res/layout/alert_dialog.xml b/samples/ApiDemos/res/layout/alert_dialog.xml
index 98556053c..f8261f8a1 100644
--- a/samples/ApiDemos/res/layout/alert_dialog.xml
+++ b/samples/ApiDemos/res/layout/alert_dialog.xml
@@ -56,5 +56,11 @@
+
+
diff --git a/samples/ApiDemos/res/values/strings.xml b/samples/ApiDemos/res/values/strings.xml
index 0713447ce..7835bd9a6 100644
--- a/samples/ApiDemos/res/values/strings.xml
+++ b/samples/ApiDemos/res/values/strings.xml
@@ -522,6 +522,8 @@
OK Cancel dialog with a message
OK Cancel dialog with traditional theme
OK Cancel dialog with Holo Light theme
+ OK Cancel dialog with DeviceDefault Light theme
+ OK Cancel dialog with DeviceDefault theme
OK Cancel dialog with a long message
OK Cancel dialog with ultra long message
List dialog
diff --git a/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java b/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java
index a22753a04..da0a0a084 100644
--- a/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java
+++ b/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java
@@ -67,6 +67,8 @@ public class AlertDialogSamples extends Activity {
private static final int DIALOG_YES_NO_ULTRA_LONG_MESSAGE = 9;
private static final int DIALOG_YES_NO_OLD_SCHOOL_MESSAGE = 10;
private static final int DIALOG_YES_NO_HOLO_LIGHT_MESSAGE = 11;
+ private static final int DIALOG_YES_NO_DEFAULT_LIGHT_MESSAGE = 12;
+ private static final int DIALOG_YES_NO_DEFAULT_DARK_MESSAGE = 13;
private static final int MAX_PROGRESS = 100;
@@ -120,6 +122,32 @@ public class AlertDialogSamples extends Activity {
}
})
.create();
+ case DIALOG_YES_NO_DEFAULT_LIGHT_MESSAGE:
+ return new AlertDialog.Builder(AlertDialogSamples.this, AlertDialog.THEME_DEVICE_DEFAULT_LIGHT)
+ .setIconAttribute(android.R.attr.alertDialogIcon)
+ .setTitle(R.string.alert_dialog_two_buttons_title)
+ .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ }
+ })
+ .setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ }
+ })
+ .create();
+ case DIALOG_YES_NO_DEFAULT_DARK_MESSAGE:
+ return new AlertDialog.Builder(AlertDialogSamples.this, AlertDialog.THEME_DEVICE_DEFAULT_DARK)
+ .setIconAttribute(android.R.attr.alertDialogIcon)
+ .setTitle(R.string.alert_dialog_two_buttons_title)
+ .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ }
+ })
+ .setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ }
+ })
+ .create();
case DIALOG_YES_NO_LONG_MESSAGE:
return new AlertDialog.Builder(AlertDialogSamples.this)
.setIconAttribute(android.R.attr.alertDialogIcon)
@@ -405,6 +433,22 @@ public class AlertDialogSamples extends Activity {
showDialog(DIALOG_YES_NO_HOLO_LIGHT_MESSAGE);
}
});
+
+ /* Two points, in the light default theme */
+ Button twoButtonsDefaultLightTitle = (Button) findViewById(R.id.two_buttons_default_light);
+ twoButtonsDefaultLightTitle.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ showDialog(DIALOG_YES_NO_DEFAULT_LIGHT_MESSAGE);
+ }
+ });
+
+ /* Two points, in the dark default theme */
+ Button twoButtonsDefaultDarkTitle = (Button) findViewById(R.id.two_buttons_default_dark);
+ twoButtonsDefaultDarkTitle.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ showDialog(DIALOG_YES_NO_DEFAULT_DARK_MESSAGE);
+ }
+ });
mProgressHandler = new Handler() {
@Override