Merge "Switch framework Holo references to Quantum.Light"

This commit is contained in:
Alan Viverette
2014-04-02 22:15:15 +00:00
committed by Android (Google) Code Review
22 changed files with 56 additions and 54 deletions

View File

@ -468,7 +468,8 @@ class ContextImpl extends Context {
outerContext.getApplicationInfo().targetSdkVersion, outerContext.getApplicationInfo().targetSdkVersion,
com.android.internal.R.style.Theme_Dialog, 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)), com.android.internal.R.style.Theme_DeviceDefault_Dialog,
com.android.internal.R.style.Theme_DeviceDefault_Light_Dialog)),
ctx.mMainThread.getHandler()); ctx.mMainThread.getHandler());
}}); }});

View File

@ -135,17 +135,31 @@ public class Resources {
sPreloadedDrawables[1] = new LongSparseArray<ConstantState>(); 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) { public static int selectDefaultTheme(int curTheme, int targetSdkVersion) {
return selectSystemTheme(curTheme, targetSdkVersion, return selectSystemTheme(curTheme, targetSdkVersion,
com.android.internal.R.style.Theme, com.android.internal.R.style.Theme,
com.android.internal.R.style.Theme_Holo, 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 */ /** @hide */
public static int selectSystemTheme(int curTheme, int targetSdkVersion, public static int selectSystemTheme(int curTheme, int targetSdkVersion, int orig, int holo,
int orig, int holo, int deviceDefault) { int dark, int deviceDefault) {
if (curTheme != 0) { if (curTheme != 0) {
return curTheme; return curTheme;
} }
@ -155,9 +169,12 @@ public class Resources {
if (targetSdkVersion < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { if (targetSdkVersion < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
return holo; return holo;
} }
if (targetSdkVersion < Build.VERSION_CODES.CUR_DEVELOPMENT) {
return dark;
}
return deviceDefault; return deviceDefault;
} }
/** /**
* This exception is thrown by the resource APIs when a requested resource * This exception is thrown by the resource APIs when a requested resource
* can not be found. * can not be found.

View File

@ -647,6 +647,7 @@ public class InputMethodService extends AbstractInputMethodService {
getApplicationInfo().targetSdkVersion, getApplicationInfo().targetSdkVersion,
android.R.style.Theme_InputMethod, android.R.style.Theme_InputMethod,
android.R.style.Theme_Holo_InputMethod, android.R.style.Theme_Holo_InputMethod,
android.R.style.Theme_DeviceDefault_InputMethod,
android.R.style.Theme_DeviceDefault_InputMethod); android.R.style.Theme_DeviceDefault_InputMethod);
super.setTheme(mTheme); super.setTheme(mTheme);
super.onCreate(); super.onCreate();

View File

@ -174,7 +174,6 @@ public class ActionBarImpl extends ActionBar {
} }
private void init(View decor) { private void init(View decor) {
mContext = decor.getContext();
mOverlayLayout = (ActionBarOverlayLayout) decor.findViewById( mOverlayLayout = (ActionBarOverlayLayout) decor.findViewById(
com.android.internal.R.id.action_bar_overlay_layout); com.android.internal.R.id.action_bar_overlay_layout);
if (mOverlayLayout != null) { if (mOverlayLayout != null) {
@ -193,6 +192,7 @@ public class ActionBarImpl extends ActionBar {
"with a compatible window decor layout"); "with a compatible window decor layout");
} }
mContext = mActionView.getContext();
mActionView.setContextView(mContextView); mActionView.setContextView(mContextView);
mContextDisplayMode = mActionView.isSplitActionBar() ? mContextDisplayMode = mActionView.isSplitActionBar() ?
CONTEXT_DISPLAY_SPLIT : CONTEXT_DISPLAY_NORMAL; CONTEXT_DISPLAY_SPLIT : CONTEXT_DISPLAY_NORMAL;

View File

@ -24,7 +24,7 @@ This is an optimized layout for a screen with the Action Bar enabled.
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:splitMotionEvents="false" android:splitMotionEvents="false"
android:theme="?attr/actionBarTheme"> android:theme="?attr/actionBarWidgetTheme">
<FrameLayout android:id="@android:id/content" <FrameLayout android:id="@android:id/content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />

View File

@ -677,8 +677,6 @@
<!-- Action bar styles --> <!-- Action bar styles -->
<!-- =================== --> <!-- =================== -->
<eat-comment /> <eat-comment />
<!-- Theme override for the Action Bar -->
<attr name="actionBarTheme" format="reference" />
<!-- Default style for tabs within an action bar --> <!-- Default style for tabs within an action bar -->
<attr name="actionBarTabStyle" format="reference" /> <attr name="actionBarTabStyle" format="reference" />
<attr name="actionBarTabBarStyle" format="reference" /> <attr name="actionBarTabBarStyle" format="reference" />

View File

@ -694,7 +694,7 @@ please see themes_device_defaults.xml.
with an inverse color profile. The dark action bar sharply stands out against with an inverse color profile. The dark action bar sharply stands out against
the light content. --> the light content. -->
<style name="Theme.Quantum.Light.DarkActionBar"> <style name="Theme.Quantum.Light.DarkActionBar">
<item name="actionBarTheme">@style/Theme.Quantum</item> <item name="actionBarWidgetTheme">@style/Theme.Quantum</item>
</style> </style>
<!-- Variant of the quantum (dark) theme with no action bar. --> <!-- Variant of the quantum (dark) theme with no action bar. -->

View File

@ -42,7 +42,7 @@
<activity <activity
android:name=".SettingsActivity" android:name=".SettingsActivity"
android:label="@string/menu_settings" android:label="@string/menu_settings"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge" android:theme="@android:style/Theme.DeviceDefault.Light.DialogWhenLarge"
android:exported="false" /> android:exported="false" />
<provider <provider

View File

@ -15,11 +15,11 @@
--> -->
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <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:actionOverflowButtonStyle">@style/DarkerOverflow</item>
<item name="android:windowBackground">@*android:drawable/dialog_full_holo_light</item> <item name="android:windowBackground">@*android:drawable/dialog_full_holo_light</item>
<item name="android:colorBackgroundCacheHint">@null</item> <item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</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> </style>
</resources> </resources>

View File

@ -29,11 +29,11 @@
<!-- Normally just a redirection, but this is used to make ourselves a <!-- Normally just a redirection, but this is used to make ourselves a
dialog on large tablets --> 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> <item name="android:actionOverflowButtonStyle">@style/DarkerOverflow</item>
</style> </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> <item name="android:src">@drawable/ic_menu_overflow</item>
</style> </style>

View File

@ -68,7 +68,7 @@
<item name="android:textSize">@dimen/widget_big_font_size</item> <item name="android:textSize">@dimen/widget_big_font_size</item>
</style> </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:indeterminateOnly">false</item>
<item name="android:progressDrawable">@drawable/scrubber_progress_horizontal_holo_light</item> <item name="android:progressDrawable">@drawable/scrubber_progress_horizontal_holo_light</item>
<item name="android:indeterminateDrawable">@drawable/scrubber_progress_horizontal_holo_light</item> <item name="android:indeterminateDrawable">@drawable/scrubber_progress_horizontal_holo_light</item>

View File

@ -23,7 +23,7 @@
<application android:label="@string/app_name" android:icon="@drawable/app_icon"> <application android:label="@string/app_name" android:icon="@drawable/app_icon">
<activity android:name=".KeyguardTestActivity" <activity android:name=".KeyguardTestActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@android:style/Theme.Holo"> android:theme="@android:style/Theme.DeviceDefault.Light">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />

View File

@ -61,7 +61,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:indeterminate="true" android:indeterminate="true"
style="@android:style/Widget.Holo.ProgressBar.Horizontal"> style="@android:style/Widget.DeviceDefault.Light.ProgressBar.Horizontal">
</ProgressBar> </ProgressBar>
</LinearLayout> </LinearLayout>

View File

@ -16,7 +16,7 @@
<resources> <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:windowBackground">@android:color/transparent</item>
<item name="android:windowSoftInputMode">stateAlwaysHidden|adjustResize</item> <item name="android:windowSoftInputMode">stateAlwaysHidden|adjustResize</item>
<item name="android:windowIsTranslucent">true</item> <item name="android:windowIsTranslucent">true</item>
@ -25,11 +25,11 @@
<item name="android:windowIsFloating">true</item> <item name="android:windowIsFloating">true</item>
</style> </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> <item name="android:actionBarStyle">@style/SelectPrinterActivityActionBarStyle</item>
</style> </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> <item name="android:displayOptions">showTitle</item>
</style> </style>

View File

@ -83,7 +83,7 @@
<activity <activity
android:name=".BugreportWarningActivity" android:name=".BugreportWarningActivity"
android:theme="@*android:style/Theme.Holo.Dialog.Alert" android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert"
android:finishOnCloseSystemDialogs="true" android:finishOnCloseSystemDialogs="true"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:exported="false" /> android:exported="false" />

View File

@ -157,7 +157,7 @@
<activity android:name=".usb.UsbConfirmActivity" <activity android:name=".usb.UsbConfirmActivity"
android:exported="true" android:exported="true"
android:permission="android.permission.MANAGE_USB" 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:finishOnCloseSystemDialogs="true"
android:excludeFromRecents="true"> android:excludeFromRecents="true">
</activity> </activity>
@ -166,7 +166,7 @@
<activity android:name=".usb.UsbPermissionActivity" <activity android:name=".usb.UsbPermissionActivity"
android:exported="true" android:exported="true"
android:permission="android.permission.MANAGE_USB" 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:finishOnCloseSystemDialogs="true"
android:excludeFromRecents="true"> android:excludeFromRecents="true">
</activity> </activity>
@ -175,7 +175,7 @@
<activity android:name=".usb.UsbResolverActivity" <activity android:name=".usb.UsbResolverActivity"
android:exported="true" android:exported="true"
android:permission="android.permission.MANAGE_USB" 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:finishOnCloseSystemDialogs="true"
android:excludeFromRecents="true"> android:excludeFromRecents="true">
</activity> </activity>
@ -184,7 +184,7 @@
<activity android:name=".usb.UsbAccessoryUriActivity" <activity android:name=".usb.UsbAccessoryUriActivity"
android:exported="true" android:exported="true"
android:permission="android.permission.MANAGE_USB" 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:finishOnCloseSystemDialogs="true"
android:excludeFromRecents="true"> android:excludeFromRecents="true">
</activity> </activity>
@ -192,7 +192,7 @@
<!-- started from UsbDebuggingManager --> <!-- started from UsbDebuggingManager -->
<activity android:name=".usb.UsbDebuggingActivity" <activity android:name=".usb.UsbDebuggingActivity"
android:permission="android.permission.MANAGE_USB" 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:finishOnCloseSystemDialogs="true"
android:excludeFromRecents="true"> android:excludeFromRecents="true">
</activity> </activity>
@ -202,7 +202,7 @@
android:name=".net.NetworkOverLimitActivity" android:name=".net.NetworkOverLimitActivity"
android:exported="true" android:exported="true"
android:permission="android.permission.MANAGE_NETWORK_POLICY" 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:finishOnCloseSystemDialogs="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:taskAffinity="com.android.systemui.net" android:taskAffinity="com.android.systemui.net"

View File

@ -16,12 +16,12 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <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> <item name="android:windowAnimationStyle">@style/Animation.RecentsActivity</item>
</style> </style>
<!-- Alternate Recents theme --> <!-- 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:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item> <item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowAnimationStyle">@style/Animation.RecentsActivity</item> <item name="android:windowAnimationStyle">@style/Animation.RecentsActivity</item>

View File

@ -83,22 +83,7 @@ public class ToggleSlider extends RelativeLayout
} }
public void onCheckedChanged(CompoundButton toggle, boolean checked) { public void onCheckedChanged(CompoundButton toggle, boolean checked) {
Drawable thumb; mSlider.setEnabled(checked);
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);
if (mListener != null) { if (mListener != null) {
mListener.onChanged(this, mTracking, checked, mSlider.getProgress()); mListener.onChanged(this, mTracking, checked, mSlider.getProgress());

View File

@ -4,7 +4,7 @@
<application android:label="VpnDialogs" <application android:label="VpnDialogs"
android:allowBackup="false" > android:allowBackup="false" >
<activity android:name=".ConfirmDialog" <activity android:name=".ConfirmDialog"
android:theme="@*android:style/Theme.Holo.Dialog.Alert"> android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
@ -12,7 +12,7 @@
</activity> </activity>
<activity android:name=".ManageDialog" <activity android:name=".ManageDialog"
android:theme="@*android:style/Theme.Holo.Dialog.Alert" android:theme="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert"
android:noHistory="true"> android:noHistory="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>

View File

@ -28,7 +28,7 @@
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<ProgressBar <ProgressBar
android:id="@+id/loading" android:id="@+id/loading"
style="@android:style/Widget.Holo.ProgressBar.Large" style="@android:style/Widget.DeviceDefault.Light.ProgressBar.Large"
android:visibility="invisible" android:visibility="invisible"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -15,13 +15,13 @@
--> -->
<resources> <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:actionBarStyle">@style/WallpaperCropperActionBar</item>
<item name="android:windowFullscreen">true</item> <item name="android:windowFullscreen">true</item>
<item name="android:windowActionBarOverlay">true</item> <item name="android:windowActionBarOverlay">true</item>
</style> </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:displayOptions">showCustom</item>
<item name="android:background">#88000000</item> <item name="android:background">#88000000</item>
</style> </style>

View File

@ -269,7 +269,7 @@ public final class SystemServer {
private void createSystemContext() { private void createSystemContext() {
ActivityThread activityThread = ActivityThread.systemMain(); ActivityThread activityThread = ActivityThread.systemMain();
mSystemContext = activityThread.getSystemContext(); mSystemContext = activityThread.getSystemContext();
mSystemContext.setTheme(android.R.style.Theme_Holo); mSystemContext.setTheme(android.R.style.Theme_DeviceDefault_Light_DarkActionBar);
} }
private void startBootstrapServices() { private void startBootstrapServices() {