diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index d1f94f072aa69..7149ab9d989ee 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -468,7 +468,8 @@ class ContextImpl extends Context { outerContext.getApplicationInfo().targetSdkVersion, com.android.internal.R.style.Theme_Dialog, com.android.internal.R.style.Theme_Holo_Dialog, - com.android.internal.R.style.Theme_DeviceDefault_Dialog)), + com.android.internal.R.style.Theme_DeviceDefault_Dialog, + com.android.internal.R.style.Theme_DeviceDefault_Light_Dialog)), ctx.mMainThread.getHandler()); }}); diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 1955be353dfbd..d6eafc6e4018a 100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -135,17 +135,31 @@ public class Resources { sPreloadedDrawables[1] = new LongSparseArray(); } - /** @hide */ + /** + * Returns the most appropriate default theme for the specified target SDK version. + * + * + * @param curTheme The current theme, or 0 if not specified. + * @param targetSdkVersion The target SDK version. + * @return A theme resource identifier + * @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_DeviceDefault); + com.android.internal.R.style.Theme_DeviceDefault, + com.android.internal.R.style.Theme_DeviceDefault_Light_DarkActionBar); } - + /** @hide */ - public static int selectSystemTheme(int curTheme, int targetSdkVersion, - int orig, int holo, int deviceDefault) { + public static int selectSystemTheme(int curTheme, int targetSdkVersion, int orig, int holo, + int dark, int deviceDefault) { if (curTheme != 0) { return curTheme; } @@ -155,9 +169,12 @@ public class Resources { if (targetSdkVersion < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { return holo; } + if (targetSdkVersion < Build.VERSION_CODES.CUR_DEVELOPMENT) { + return dark; + } return deviceDefault; } - + /** * This exception is thrown by the resource APIs when a requested resource * can not be found. diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 81ad28bba41d5..a355d1e6927f6 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -647,6 +647,7 @@ public class InputMethodService extends AbstractInputMethodService { getApplicationInfo().targetSdkVersion, android.R.style.Theme_InputMethod, android.R.style.Theme_Holo_InputMethod, + android.R.style.Theme_DeviceDefault_InputMethod, android.R.style.Theme_DeviceDefault_InputMethod); super.setTheme(mTheme); super.onCreate(); diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java index cc51a8bcc83b8..80e1caaf26d8e 100644 --- a/core/java/com/android/internal/app/ActionBarImpl.java +++ b/core/java/com/android/internal/app/ActionBarImpl.java @@ -174,7 +174,6 @@ public class ActionBarImpl extends ActionBar { } private void init(View decor) { - mContext = decor.getContext(); mOverlayLayout = (ActionBarOverlayLayout) decor.findViewById( com.android.internal.R.id.action_bar_overlay_layout); if (mOverlayLayout != null) { @@ -193,6 +192,7 @@ public class ActionBarImpl extends ActionBar { "with a compatible window decor layout"); } + mContext = mActionView.getContext(); mActionView.setContextView(mContextView); mContextDisplayMode = mActionView.isSplitActionBar() ? CONTEXT_DISPLAY_SPLIT : CONTEXT_DISPLAY_NORMAL; diff --git a/core/res/res/layout/screen_action_bar.xml b/core/res/res/layout/screen_action_bar.xml index 326573674440c..b1afec13075b5 100644 --- a/core/res/res/layout/screen_action_bar.xml +++ b/core/res/res/layout/screen_action_bar.xml @@ -24,7 +24,7 @@ This is an optimized layout for a screen with the Action Bar enabled. android:layout_width="match_parent" android:layout_height="match_parent" android:splitMotionEvents="false" - android:theme="?attr/actionBarTheme"> + android:theme="?attr/actionBarWidgetTheme"> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 2fac75d3b9917..aa5005f00eac5 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -677,8 +677,6 @@ - - diff --git a/core/res/res/values/themes_quantum.xml b/core/res/res/values/themes_quantum.xml index d39a1f8682765..2908dc7cea9c0 100644 --- a/core/res/res/values/themes_quantum.xml +++ b/core/res/res/values/themes_quantum.xml @@ -694,7 +694,7 @@ please see themes_device_defaults.xml. with an inverse color profile. The dark action bar sharply stands out against the light content. --> diff --git a/packages/DocumentsUI/AndroidManifest.xml b/packages/DocumentsUI/AndroidManifest.xml index 179bcd17d633d..6b77a7ca695fc 100644 --- a/packages/DocumentsUI/AndroidManifest.xml +++ b/packages/DocumentsUI/AndroidManifest.xml @@ -42,7 +42,7 @@ - diff --git a/packages/DocumentsUI/res/values/styles.xml b/packages/DocumentsUI/res/values/styles.xml index 0c8f7127811a6..a416eb4ef6331 100644 --- a/packages/DocumentsUI/res/values/styles.xml +++ b/packages/DocumentsUI/res/values/styles.xml @@ -29,11 +29,11 @@ - - diff --git a/packages/Keyguard/res/values/styles.xml b/packages/Keyguard/res/values/styles.xml index d4f98affee907..80fcf7574ebf2 100644 --- a/packages/Keyguard/res/values/styles.xml +++ b/packages/Keyguard/res/values/styles.xml @@ -68,7 +68,7 @@ @dimen/widget_big_font_size - - - diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml index 29e8d1dad952f..c456374fdedd0 100644 --- a/packages/Shell/AndroidManifest.xml +++ b/packages/Shell/AndroidManifest.xml @@ -83,7 +83,7 @@ diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index b09cc1d973833..cccdaf537834a 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -157,7 +157,7 @@ @@ -166,7 +166,7 @@ @@ -175,7 +175,7 @@ @@ -184,7 +184,7 @@ @@ -192,7 +192,7 @@ @@ -202,7 +202,7 @@ android:name=".net.NetworkOverLimitActivity" android:exported="true" android:permission="android.permission.MANAGE_NETWORK_POLICY" - android:theme="@android:style/Theme.Holo.Panel" + android:theme="@android:style/Theme.DeviceDefault.Light.Panel" android:finishOnCloseSystemDialogs="true" android:launchMode="singleTop" android:taskAffinity="com.android.systemui.net" diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 14af02096c54e..c29075b0afe3e 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -16,12 +16,12 @@ - - - diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index ce205c057b0d9..8f2adc8f47b28 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -269,7 +269,7 @@ public final class SystemServer { private void createSystemContext() { ActivityThread activityThread = ActivityThread.systemMain(); mSystemContext = activityThread.getSystemContext(); - mSystemContext.setTheme(android.R.style.Theme_Holo); + mSystemContext.setTheme(android.R.style.Theme_DeviceDefault_Light_DarkActionBar); } private void startBootstrapServices() {