Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -2853,6 +2853,8 @@ package android.app { method public void setMessage(java.lang.CharSequence); method public void setView(android.view.View); method public void setView(android.view.View, int, int, int, int); field public static final int THEME_DEVICE_DEFAULT_DARK = 4; // 0x4 field public static final int THEME_DEVICE_DEFAULT_LIGHT = 5; // 0x5 field public static final int THEME_HOLO_DARK = 2; // 0x2 field public static final int THEME_HOLO_LIGHT = 3; // 0x3 field public static final int THEME_TRADITIONAL = 1; // 0x1 core/java/android/app/AlertDialog.java +16 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,18 @@ public class AlertDialog extends Dialog implements DialogInterface { */ public static final int THEME_HOLO_LIGHT = 3; /** * Special theme constant for {@link #AlertDialog(Context, int)}: use * the device's default alert theme with a dark background. */ public static final int THEME_DEVICE_DEFAULT_DARK = 4; /** * Special theme constant for {@link #AlertDialog(Context, int)}: use * the device's default alert theme with a dark background. */ public static final int THEME_DEVICE_DEFAULT_LIGHT = 5; protected AlertDialog(Context context) { this(context, resolveDialogTheme(context, 0), true); } Loading Loading @@ -113,6 +125,10 @@ public class AlertDialog extends Dialog implements DialogInterface { return com.android.internal.R.style.Theme_Holo_Dialog_Alert; } else if (resid == THEME_HOLO_LIGHT) { return com.android.internal.R.style.Theme_Holo_Light_Dialog_Alert; } else if (resid == THEME_DEVICE_DEFAULT_DARK) { return com.android.internal.R.style.Theme_DeviceDefault_Dialog_Alert; } else if (resid == THEME_DEVICE_DEFAULT_LIGHT) { return com.android.internal.R.style.Theme_DeviceDefault_Light_Dialog_Alert; } else if (resid >= 0x01000000) { // start of real resource IDs. return resid; } else { Loading core/java/android/app/ContextImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -364,7 +364,8 @@ class ContextImpl extends Context { Resources.selectSystemTheme(0, outerContext.getApplicationInfo().targetSdkVersion, com.android.internal.R.style.Theme_Dialog, com.android.internal.R.style.Theme_Holo_Dialog)), com.android.internal.R.style.Theme_Holo_Dialog, com.android.internal.R.style.Theme_DeviceDefault_Dialog)), ctx.mMainThread.getHandler()); }}); Loading core/java/android/app/DialogFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -204,7 +204,7 @@ public class DialogFragment extends Fragment public void setStyle(int style, int theme) { mStyle = style; if (mStyle == STYLE_NO_FRAME || mStyle == STYLE_NO_INPUT) { mTheme = com.android.internal.R.style.Theme_Holo_Dialog_NoFrame; mTheme = com.android.internal.R.style.Theme_DeviceDefault_Dialog_NoFrame; } if (theme != 0) { mTheme = theme; Loading core/java/android/content/res/Resources.java +9 −3 Original line number Diff line number Diff line Loading @@ -134,19 +134,25 @@ public class Resources { /** @hide */ public static int selectDefaultTheme(int curTheme, int targetSdkVersion) { return selectSystemTheme(curTheme, targetSdkVersion, com.android.internal.R.style.Theme, com.android.internal.R.style.Theme_Holo); com.android.internal.R.style.Theme, com.android.internal.R.style.Theme_Holo, com.android.internal.R.style.Theme_DeviceDefault); } /** @hide */ public static int selectSystemTheme(int curTheme, int targetSdkVersion, int orig, int holo) { public static int selectSystemTheme(int curTheme, int targetSdkVersion, int orig, int holo, int deviceDefault) { if (curTheme != 0) { return curTheme; } if (targetSdkVersion < Build.VERSION_CODES.HONEYCOMB) { return orig; } if (targetSdkVersion < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { return holo; } return deviceDefault; } /** * This exception is thrown by the resource APIs when a requested resource Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -2853,6 +2853,8 @@ package android.app { method public void setMessage(java.lang.CharSequence); method public void setView(android.view.View); method public void setView(android.view.View, int, int, int, int); field public static final int THEME_DEVICE_DEFAULT_DARK = 4; // 0x4 field public static final int THEME_DEVICE_DEFAULT_LIGHT = 5; // 0x5 field public static final int THEME_HOLO_DARK = 2; // 0x2 field public static final int THEME_HOLO_LIGHT = 3; // 0x3 field public static final int THEME_TRADITIONAL = 1; // 0x1
core/java/android/app/AlertDialog.java +16 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,18 @@ public class AlertDialog extends Dialog implements DialogInterface { */ public static final int THEME_HOLO_LIGHT = 3; /** * Special theme constant for {@link #AlertDialog(Context, int)}: use * the device's default alert theme with a dark background. */ public static final int THEME_DEVICE_DEFAULT_DARK = 4; /** * Special theme constant for {@link #AlertDialog(Context, int)}: use * the device's default alert theme with a dark background. */ public static final int THEME_DEVICE_DEFAULT_LIGHT = 5; protected AlertDialog(Context context) { this(context, resolveDialogTheme(context, 0), true); } Loading Loading @@ -113,6 +125,10 @@ public class AlertDialog extends Dialog implements DialogInterface { return com.android.internal.R.style.Theme_Holo_Dialog_Alert; } else if (resid == THEME_HOLO_LIGHT) { return com.android.internal.R.style.Theme_Holo_Light_Dialog_Alert; } else if (resid == THEME_DEVICE_DEFAULT_DARK) { return com.android.internal.R.style.Theme_DeviceDefault_Dialog_Alert; } else if (resid == THEME_DEVICE_DEFAULT_LIGHT) { return com.android.internal.R.style.Theme_DeviceDefault_Light_Dialog_Alert; } else if (resid >= 0x01000000) { // start of real resource IDs. return resid; } else { Loading
core/java/android/app/ContextImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -364,7 +364,8 @@ class ContextImpl extends Context { Resources.selectSystemTheme(0, outerContext.getApplicationInfo().targetSdkVersion, com.android.internal.R.style.Theme_Dialog, com.android.internal.R.style.Theme_Holo_Dialog)), com.android.internal.R.style.Theme_Holo_Dialog, com.android.internal.R.style.Theme_DeviceDefault_Dialog)), ctx.mMainThread.getHandler()); }}); Loading
core/java/android/app/DialogFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -204,7 +204,7 @@ public class DialogFragment extends Fragment public void setStyle(int style, int theme) { mStyle = style; if (mStyle == STYLE_NO_FRAME || mStyle == STYLE_NO_INPUT) { mTheme = com.android.internal.R.style.Theme_Holo_Dialog_NoFrame; mTheme = com.android.internal.R.style.Theme_DeviceDefault_Dialog_NoFrame; } if (theme != 0) { mTheme = theme; Loading
core/java/android/content/res/Resources.java +9 −3 Original line number Diff line number Diff line Loading @@ -134,19 +134,25 @@ public class Resources { /** @hide */ public static int selectDefaultTheme(int curTheme, int targetSdkVersion) { return selectSystemTheme(curTheme, targetSdkVersion, com.android.internal.R.style.Theme, com.android.internal.R.style.Theme_Holo); com.android.internal.R.style.Theme, com.android.internal.R.style.Theme_Holo, com.android.internal.R.style.Theme_DeviceDefault); } /** @hide */ public static int selectSystemTheme(int curTheme, int targetSdkVersion, int orig, int holo) { public static int selectSystemTheme(int curTheme, int targetSdkVersion, int orig, int holo, int deviceDefault) { if (curTheme != 0) { return curTheme; } if (targetSdkVersion < Build.VERSION_CODES.HONEYCOMB) { return orig; } if (targetSdkVersion < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { return holo; } return deviceDefault; } /** * This exception is thrown by the resource APIs when a requested resource Loading