diff options
author | Alan Viverette <alanv@google.com> | 2014-04-01 14:57:39 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2014-04-01 14:57:39 -0700 |
commit | 6259933ec99dee566f200c5fdfe1756ee72b1513 (patch) | |
tree | 78196ea29921d4331a576922a564568f6894a207 | |
parent | 6f127c9b6c249ca1cd17c07a8476edd0fcc1f04d (diff) | |
download | frameworks_base-6259933ec99dee566f200c5fdfe1756ee72b1513.zip frameworks_base-6259933ec99dee566f200c5fdfe1756ee72b1513.tar.gz frameworks_base-6259933ec99dee566f200c5fdfe1756ee72b1513.tar.bz2 |
Switch framework Holo references to Quantum.Light
Change-Id: Ib545a143f1959b6104adbc9d594dd626851d90b3
22 files changed, 56 insertions, 54 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index d1f94f0..7149ab9 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 1955be3..d6eafc6 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<ConstantState>(); } - /** @hide */ + /** + * Returns the most appropriate default theme for the specified target SDK version. + * <ul> + * <li>Below API 11: Gingerbread + * <li>APIs 11 thru 14: Holo + * <li>APIs 14 thru XX: Device default dark + * <li>API XX and above: Device default light with dark action bar + * </ul> + * + * @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 81ad28b..a355d1e 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 cc51a8b..80e1caa 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 3265736..b1afec1 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"> <FrameLayout android:id="@android:id/content" android:layout_width="match_parent" android:layout_height="match_parent" /> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 369dda1..67421b2 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -677,8 +677,6 @@ <!-- Action bar styles --> <!-- =================== --> <eat-comment /> - <!-- Theme override for the Action Bar --> - <attr name="actionBarTheme" format="reference" /> <!-- Default style for tabs within an action bar --> <attr name="actionBarTabStyle" format="reference" /> <attr name="actionBarTabBarStyle" format="reference" /> diff --git a/core/res/res/values/themes_quantum.xml b/core/res/res/values/themes_quantum.xml index d39a1f86..2908dc7 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. --> <style name="Theme.Quantum.Light.DarkActionBar"> - <item name="actionBarTheme">@style/Theme.Quantum</item> + <item name="actionBarWidgetTheme">@style/Theme.Quantum</item> </style> <!-- Variant of the quantum (dark) theme with no action bar. --> diff --git a/packages/DocumentsUI/AndroidManifest.xml b/packages/DocumentsUI/AndroidManifest.xml index 179bcd1..6b77a7c 100644 --- a/packages/DocumentsUI/AndroidManifest.xml +++ b/packages/DocumentsUI/AndroidManifest.xml @@ -42,7 +42,7 @@ <activity android:name=".SettingsActivity" android:label="@string/menu_settings" - android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" + android:theme="@android:style/Theme.DeviceDefault.Light.DialogWhenLarge" android:exported="false" /> <provider diff --git a/packages/DocumentsUI/res/values-sw720dp/styles.xml b/packages/DocumentsUI/res/values-sw720dp/styles.xml index 19d2ebe..8d31444 100644 --- a/packages/DocumentsUI/res/values-sw720dp/styles.xml +++ b/packages/DocumentsUI/res/values-sw720dp/styles.xml @@ -15,11 +15,11 @@ --> <resources xmlns:android="http://schemas.android.com/apk/res/android"> - <style name="Theme" parent="@android:style/Theme.Holo.Light"> + <style name="Theme" parent="@android:style/Theme.DeviceDefault.Light"> <item name="android:actionOverflowButtonStyle">@style/DarkerOverflow</item> <item name="android:windowBackground">@*android:drawable/dialog_full_holo_light</item> <item name="android:colorBackgroundCacheHint">@null</item> <item name="android:windowIsTranslucent">true</item> - <item name="android:windowAnimationStyle">@*android:style/Animation.Holo.Dialog</item> + <item name="android:windowAnimationStyle">@*android:style/Animation.DeviceDefault.Dialog</item> </style> </resources> diff --git a/packages/DocumentsUI/res/values/styles.xml b/packages/DocumentsUI/res/values/styles.xml index 0c8f712..a416eb4 100644 --- a/packages/DocumentsUI/res/values/styles.xml +++ b/packages/DocumentsUI/res/values/styles.xml @@ -29,11 +29,11 @@ <!-- Normally just a redirection, but this is used to make ourselves a dialog on large tablets --> - <style name="Theme" parent="@android:style/Theme.Holo.Light"> + <style name="Theme" parent="@android:style/Theme.DeviceDefault.Light"> <item name="android:actionOverflowButtonStyle">@style/DarkerOverflow</item> </style> - <style name="DarkerOverflow" parent="@android:style/Widget.Holo.Light.ActionButton.Overflow"> + <style name="DarkerOverflow" parent="@android:style/Widget.DeviceDefault.Light.ActionButton.Overflow"> <item name="android:src">@drawable/ic_menu_overflow</item> </style> diff --git a/packages/Keyguard/res/values/styles.xml b/packages/Keyguard/res/values/styles.xml index d4f98af..80fcf75 100644 --- a/packages/Keyguard/res/values/styles.xml +++ b/packages/Keyguard/res/values/styles.xml @@ -68,7 +68,7 @@ <item name="android:textSize">@dimen/widget_big_font_size</item> </style> - <style name="Widget.TransportControl.SeekBar" parent="@android:style/Widget.Holo.SeekBar"> + <style name="Widget.TransportControl.SeekBar" parent="@android:style/Widget.DeviceDefault.Light.SeekBar"> <item name="android:indeterminateOnly">false</item> <item name="android:progressDrawable">@drawable/scrubber_progress_horizontal_holo_light</item> <item name="android:indeterminateDrawable">@drawable/scrubber_progress_horizontal_holo_light</item> diff --git a/packages/Keyguard/test/AndroidManifest.xml b/packages/Keyguard/test/AndroidManifest.xml index b801e4b..1638127 100644 --- a/packages/Keyguard/test/AndroidManifest.xml +++ b/packages/Keyguard/test/AndroidManifest.xml @@ -23,7 +23,7 @@ <application android:label="@string/app_name" android:icon="@drawable/app_icon"> <activity android:name=".KeyguardTestActivity" android:label="@string/app_name" - android:theme="@android:style/Theme.Holo"> + android:theme="@android:style/Theme.DeviceDefault.Light"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/packages/PrintSpooler/res/layout/select_printer_activity.xml b/packages/PrintSpooler/res/layout/select_printer_activity.xml index 6fc77df..4488b6a 100644 --- a/packages/PrintSpooler/res/layout/select_printer_activity.xml +++ b/packages/PrintSpooler/res/layout/select_printer_activity.xml @@ -61,7 +61,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:indeterminate="true" - style="@android:style/Widget.Holo.ProgressBar.Horizontal"> + style="@android:style/Widget.DeviceDefault.Light.ProgressBar.Horizontal"> </ProgressBar> </LinearLayout> diff --git a/packages/PrintSpooler/res/values/themes.xml b/packages/PrintSpooler/res/values/themes.xml index 86f4a37..94ab895 100644 --- a/packages/PrintSpooler/res/values/themes.xml +++ b/packages/PrintSpooler/res/values/themes.xml @@ -16,7 +16,7 @@ <resources> - <style name="PrintJobConfigActivityTheme" parent="@android:style/Theme.Holo.Light.NoActionBar"> + <style name="PrintJobConfigActivityTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar"> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowSoftInputMode">stateAlwaysHidden|adjustResize</item> <item name="android:windowIsTranslucent">true</item> @@ -25,11 +25,11 @@ <item name="android:windowIsFloating">true</item> </style> - <style name="SelectPrinterActivityTheme" parent="@android:style/Theme.Holo.Light"> + <style name="SelectPrinterActivityTheme" parent="@android:style/Theme.DeviceDefault.Light"> <item name="android:actionBarStyle">@style/SelectPrinterActivityActionBarStyle</item> </style> - <style name="SelectPrinterActivityActionBarStyle" parent="@android:style/Widget.Holo.ActionBar"> + <style name="SelectPrinterActivityActionBarStyle" parent="@android:style/Widget.DeviceDefault.Light.ActionBar"> <item name="android:displayOptions">showTitle</item> </style> diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml index 29e8d1d..c456374 100644 --- a/packages/Shell/AndroidManifest.xml +++ b/packages/Shell/AndroidManifest.xml @@ -83,7 +83,7 @@ <activity android:name=".BugreportWarningActivity" - android:theme="@*android:style/Theme.Holo.Dialog.Alert" + android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert" android:finishOnCloseSystemDialogs="true" android:excludeFromRecents="true" android:exported="false" /> diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index b09cc1d..cccdaf5 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -157,7 +157,7 @@ <activity android:name=".usb.UsbConfirmActivity" android:exported="true" android:permission="android.permission.MANAGE_USB" - android:theme="@*android:style/Theme.Holo.Dialog.Alert" + android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert" android:finishOnCloseSystemDialogs="true" android:excludeFromRecents="true"> </activity> @@ -166,7 +166,7 @@ <activity android:name=".usb.UsbPermissionActivity" android:exported="true" android:permission="android.permission.MANAGE_USB" - android:theme="@*android:style/Theme.Holo.Dialog.Alert" + android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert" android:finishOnCloseSystemDialogs="true" android:excludeFromRecents="true"> </activity> @@ -175,7 +175,7 @@ <activity android:name=".usb.UsbResolverActivity" android:exported="true" android:permission="android.permission.MANAGE_USB" - android:theme="@*android:style/Theme.Holo.Dialog.Alert" + android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert" android:finishOnCloseSystemDialogs="true" android:excludeFromRecents="true"> </activity> @@ -184,7 +184,7 @@ <activity android:name=".usb.UsbAccessoryUriActivity" android:exported="true" android:permission="android.permission.MANAGE_USB" - android:theme="@*android:style/Theme.Holo.Dialog.Alert" + android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert" android:finishOnCloseSystemDialogs="true" android:excludeFromRecents="true"> </activity> @@ -192,7 +192,7 @@ <!-- started from UsbDebuggingManager --> <activity android:name=".usb.UsbDebuggingActivity" android:permission="android.permission.MANAGE_USB" - android:theme="@*android:style/Theme.Holo.Dialog.Alert" + android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert" android:finishOnCloseSystemDialogs="true" android:excludeFromRecents="true"> </activity> @@ -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 14af020..c29075b 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -16,12 +16,12 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android"> - <style name="RecentsStyle" parent="@android:style/Theme.Holo.Wallpaper.NoTitleBar"> + <style name="RecentsStyle" parent="@android:style/Theme.DeviceDefault.Light.Wallpaper.NoTitleBar"> <item name="android:windowAnimationStyle">@style/Animation.RecentsActivity</item> </style> <!-- Alternate Recents theme --> - <style name="RecentsTheme" parent="@android:style/Theme.Holo.Wallpaper.NoTitleBar"> + <style name="RecentsTheme" parent="@android:style/Theme.DeviceDefault.Light.Wallpaper.NoTitleBar"> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> <item name="android:windowAnimationStyle">@style/Animation.RecentsActivity</item> diff --git a/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java b/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java index d584043..c99f691 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java +++ b/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java @@ -83,22 +83,7 @@ public class ToggleSlider extends RelativeLayout } public void onCheckedChanged(CompoundButton toggle, boolean checked) { - Drawable thumb; - Drawable slider; - final Resources res = getContext().getResources(); - if (checked) { - thumb = res.getDrawable( - com.android.internal.R.drawable.scrubber_control_disabled_holo); - slider = res.getDrawable( - R.drawable.status_bar_settings_slider_disabled); - } else { - thumb = res.getDrawable( - com.android.internal.R.drawable.scrubber_control_selector_holo); - slider = res.getDrawable( - com.android.internal.R.drawable.scrubber_progress_horizontal_holo_dark); - } - mSlider.setThumb(thumb); - mSlider.setProgressDrawable(slider); + mSlider.setEnabled(checked); if (mListener != null) { mListener.onChanged(this, mTracking, checked, mSlider.getProgress()); diff --git a/packages/VpnDialogs/AndroidManifest.xml b/packages/VpnDialogs/AndroidManifest.xml index ef640d5..da5e123 100644 --- a/packages/VpnDialogs/AndroidManifest.xml +++ b/packages/VpnDialogs/AndroidManifest.xml @@ -4,7 +4,7 @@ <application android:label="VpnDialogs" android:allowBackup="false" > <activity android:name=".ConfirmDialog" - android:theme="@*android:style/Theme.Holo.Dialog.Alert"> + android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.DEFAULT"/> @@ -12,7 +12,7 @@ </activity> <activity android:name=".ManageDialog" - android:theme="@*android:style/Theme.Holo.Dialog.Alert" + android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert" android:noHistory="true"> <intent-filter> <action android:name="android.intent.action.MAIN"/> diff --git a/packages/WallpaperCropper/res/layout/wallpaper_cropper.xml b/packages/WallpaperCropper/res/layout/wallpaper_cropper.xml index 97d7001..cf78989 100644 --- a/packages/WallpaperCropper/res/layout/wallpaper_cropper.xml +++ b/packages/WallpaperCropper/res/layout/wallpaper_cropper.xml @@ -28,7 +28,7 @@ android:layout_height="match_parent" /> <ProgressBar android:id="@+id/loading" - style="@android:style/Widget.Holo.ProgressBar.Large" + style="@android:style/Widget.DeviceDefault.Light.ProgressBar.Large" android:visibility="invisible" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/packages/WallpaperCropper/res/values/styles.xml b/packages/WallpaperCropper/res/values/styles.xml index 2b63fe0..b27a387 100644 --- a/packages/WallpaperCropper/res/values/styles.xml +++ b/packages/WallpaperCropper/res/values/styles.xml @@ -15,13 +15,13 @@ --> <resources> - <style name="Theme.WallpaperCropper" parent="@android:style/Theme.Holo"> + <style name="Theme.WallpaperCropper" parent="@android:style/Theme.DeviceDefault.Light"> <item name="android:actionBarStyle">@style/WallpaperCropperActionBar</item> <item name="android:windowFullscreen">true</item> <item name="android:windowActionBarOverlay">true</item> </style> - <style name="WallpaperCropperActionBar" parent="android:style/Widget.Holo.ActionBar"> + <style name="WallpaperCropperActionBar" parent="android:style/Widget.DeviceDefault.Light.ActionBar"> <item name="android:displayOptions">showCustom</item> <item name="android:background">#88000000</item> </style> diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index ab4c89e..3f7d03e 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() { |