summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alan Viverette <alanv@google.com> 2014-07-16 17:39:27 -0700
committer Alan Viverette <alanv@google.com> 2014-07-17 04:36:11 +0000
commit5134478151d8aa3d776f8d4f368dbcdbc501a92a (patch)
treed9d39702c5271fa7377d44bdf46ec42095a79af7
parentd10b2f17a1ef2773932e9594a7569627426bb823 (diff)
Add public attributes for TimePicker styling
BUG: 11218747 Change-Id: Ifdf981280ebe20a9066f219c9a4505d0d7486b2e
-rw-r--r--api/current.txt12
-rw-r--r--core/java/android/app/TimePickerDialog.java17
-rw-r--r--core/java/android/widget/LegacyTimePickerDelegate.java10
-rw-r--r--core/java/android/widget/RadialTimePickerView.java28
-rw-r--r--core/java/android/widget/TimePicker.java66
-rw-r--r--core/java/android/widget/TimePickerDelegate.java86
-rw-r--r--core/res/res/layout-land/time_picker_holo.xml4
-rw-r--r--core/res/res/layout/time_header_label.xml10
-rw-r--r--core/res/res/values/attrs.xml58
-rw-r--r--core/res/res/values/colors_holo.xml3
-rw-r--r--core/res/res/values/colors_material.xml1
-rw-r--r--core/res/res/values/public.xml14
-rw-r--r--core/res/res/values/styles.xml8
-rw-r--r--core/res/res/values/styles_device_defaults.xml5
-rw-r--r--core/res/res/values/styles_holo.xml16
-rw-r--r--core/res/res/values/styles_material.xml17
-rw-r--r--core/res/res/values/symbols.xml6
-rw-r--r--core/res/res/values/themes.xml9
-rw-r--r--core/res/res/values/themes_device_defaults.xml12
-rw-r--r--core/res/res/values/themes_holo.xml18
-rw-r--r--core/res/res/values/themes_leanback.xml2
-rw-r--r--core/res/res/values/themes_material.xml36
22 files changed, 155 insertions, 283 deletions
diff --git a/api/current.txt b/api/current.txt
index 87ea82e4ea4a..4018ced2cf32 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -299,6 +299,9 @@ package android {
field public static final int alphabeticShortcut = 16843235; // 0x10101e3
field public static final int alwaysDrawnWithCache = 16842991; // 0x10100ef
field public static final int alwaysRetainTaskState = 16843267; // 0x1010203
+ field public static final int amPmSelectedBackgroundColor = 16843946; // 0x10104aa
+ field public static final int amPmTextColor = 16843944; // 0x10104a8
+ field public static final int amPmUnselectedBackgroundColor = 16843945; // 0x10104a9
field public static final int angle = 16843168; // 0x10101a0
field public static final int animateFirstView = 16843477; // 0x10102d5
field public static final int animateLayoutChanges = 16843506; // 0x10102f2
@@ -626,8 +629,12 @@ package android {
field public static final int hapticFeedbackEnabled = 16843358; // 0x101025e
field public static final int hardwareAccelerated = 16843475; // 0x10102d3
field public static final int hasCode = 16842764; // 0x101000c
+ field public static final int headerAmPmTextAppearance = 16843938; // 0x10104a2
field public static final int headerBackground = 16843055; // 0x101012f
+ field public static final int headerBackgroundColor = 16843940; // 0x10104a4
field public static final int headerDividersEnabled = 16843310; // 0x101022e
+ field public static final int headerSelectedTextColor = 16843939; // 0x10104a3
+ field public static final int headerTimeTextAppearance = 16843937; // 0x10104a1
field public static final int height = 16843093; // 0x1010155
field public static final int hideOnContentScroll = 16843845; // 0x1010445
field public static final int hint = 16843088; // 0x1010150
@@ -882,6 +889,9 @@ package android {
field public static final int notificationTimeout = 16843651; // 0x1010383
field public static final int numColumns = 16843032; // 0x1010118
field public static final int numStars = 16843076; // 0x1010144
+ field public static final int numbersBackgroundColor = 16843942; // 0x10104a6
+ field public static final int numbersSelectorColor = 16843943; // 0x10104a7
+ field public static final int numbersTextColor = 16843941; // 0x10104a5
field public static final deprecated int numeric = 16843109; // 0x1010165
field public static final int numericShortcut = 16843236; // 0x10101e4
field public static final int onClick = 16843375; // 0x101026f
@@ -1275,6 +1285,8 @@ package android {
field public static final int tileMode = 16843265; // 0x1010201
field public static final int tileModeX = 16843897; // 0x1010479
field public static final int tileModeY = 16843898; // 0x101047a
+ field public static final int timePickerDialogTheme = 16843936; // 0x10104a0
+ field public static final int timePickerStyle = 16843935; // 0x101049f
field public static final int timeZone = 16843724; // 0x10103cc
field public static final int tint = 16843041; // 0x1010121
field public static final int tintMode = 16843797; // 0x1010415
diff --git a/core/java/android/app/TimePickerDialog.java b/core/java/android/app/TimePickerDialog.java
index 8a53e083480f..ff2a1740ca77 100644
--- a/core/java/android/app/TimePickerDialog.java
+++ b/core/java/android/app/TimePickerDialog.java
@@ -19,6 +19,7 @@ package android.app;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
+import android.os.Build;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater;
@@ -28,8 +29,6 @@ import android.widget.TimePicker.OnTimeChangedListener;
import com.android.internal.R;
-import static android.os.Build.VERSION_CODES.L;
-
/**
* A dialog that prompts the user for the time of day using a {@link TimePicker}.
*
@@ -102,26 +101,26 @@ public class TimePickerDialog extends AlertDialog
OnTimeSetListener callBack,
int hourOfDay, int minute, boolean is24HourView) {
super(context, resolveDialogTheme(context, theme));
+
mTimeSetCallback = callBack;
mInitialHourOfDay = hourOfDay;
mInitialMinute = minute;
mIs24HourView = is24HourView;
- Context themeContext = getContext();
+ final Context themeContext = getContext();
- final int targetSdkVersion = getContext().getApplicationInfo().targetSdkVersion;
- if (targetSdkVersion < L) {
+ final int targetSdkVersion = themeContext.getApplicationInfo().targetSdkVersion;
+ if (targetSdkVersion < Build.VERSION_CODES.L) {
setIcon(0);
setTitle(R.string.time_picker_dialog_title);
setButton(BUTTON_POSITIVE, themeContext.getText(R.string.date_time_done), this);
}
- LayoutInflater inflater =
- (LayoutInflater) themeContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View view = inflater.inflate(R.layout.time_picker_dialog, null);
+ final LayoutInflater inflater = LayoutInflater.from(themeContext);
+ final View view = inflater.inflate(R.layout.time_picker_dialog, null);
setView(view);
- mTimePicker = (TimePicker) view.findViewById(R.id.timePicker);
+ mTimePicker = (TimePicker) view.findViewById(R.id.timePicker);
mTimePicker.setShowDoneButton(true);
mTimePicker.setDismissCallback(new TimePicker.TimePickerDismissCallback() {
@Override
diff --git a/core/java/android/widget/LegacyTimePickerDelegate.java b/core/java/android/widget/LegacyTimePickerDelegate.java
index 221600395b48..6dd70babbb18 100644
--- a/core/java/android/widget/LegacyTimePickerDelegate.java
+++ b/core/java/android/widget/LegacyTimePickerDelegate.java
@@ -19,6 +19,7 @@ package android.widget;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.TypedArray;
+import android.graphics.Color;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.format.DateFormat;
@@ -104,14 +105,13 @@ class LegacyTimePickerDelegate extends TimePicker.AbstractTimePickerDelegate {
super(delegator, context);
// process style attributes
- final TypedArray attributesArray = mContext.obtainStyledAttributes(
+ final TypedArray a = mContext.obtainStyledAttributes(
attrs, R.styleable.TimePicker, defStyleAttr, defStyleRes);
- final int layoutResourceId = attributesArray.getResourceId(
+ final int layoutResourceId = a.getResourceId(
R.styleable.TimePicker_legacyLayout, R.layout.time_picker_legacy);
- attributesArray.recycle();
+ a.recycle();
- final LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
+ final LayoutInflater inflater = LayoutInflater.from(mContext);
inflater.inflate(layoutResourceId, mDelegator, true);
// hour
diff --git a/core/java/android/widget/RadialTimePickerView.java b/core/java/android/widget/RadialTimePickerView.java
index 883183e627ac..9b763c18cac5 100644
--- a/core/java/android/widget/RadialTimePickerView.java
+++ b/core/java/android/widget/RadialTimePickerView.java
@@ -36,6 +36,7 @@ import android.text.format.DateUtils;
import android.text.format.Time;
import android.util.AttributeSet;
import android.util.Log;
+import android.util.TypedValue;
import android.view.HapticFeedbackConstants;
import android.view.MotionEvent;
import android.view.View;
@@ -190,6 +191,8 @@ public class RadialTimePickerView extends View implements View.OnTouchListener {
private int mAmOrPm;
private int mAmOrPmPressed;
+ private int mDisabledAlpha;
+
private RectF mRectF = new RectF();
private boolean mInputEnabled = true;
private OnValueSelectedListener mListener;
@@ -310,15 +313,18 @@ public class RadialTimePickerView extends View implements View.OnTouchListener {
public RadialTimePickerView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs);
+ // Pull disabled alpha from theme.
+ final TypedValue outValue = new TypedValue();
+ context.getTheme().resolveAttribute(android.R.attr.disabledAlpha, outValue, true);
+ mDisabledAlpha = (int) (outValue.getFloat() * 255 + 0.5f);
+
// process style attributes
+ final Resources res = getResources();
final TypedArray a = mContext.obtainStyledAttributes(attrs, R.styleable.TimePicker,
defStyle, 0);
- final Resources res = getResources();
-
mAmPmUnselectedColor = a.getColor(R.styleable.TimePicker_amPmUnselectedBackgroundColor,
res.getColor(R.color.timepicker_default_ampm_unselected_background_color_material));
-
mAmPmSelectedColor = a.getColor(R.styleable.TimePicker_amPmSelectedBackgroundColor,
res.getColor(R.color.timepicker_default_ampm_selected_background_color_material));
@@ -406,10 +412,6 @@ public class RadialTimePickerView extends View implements View.OnTouchListener {
res.getColor(R.color.timepicker_default_numbers_background_color_material)));
mPaintBackground.setAntiAlias(true);
- mPaintDisabled.setColor(a.getColor(R.styleable.TimePicker_disabledColor,
- res.getColor(R.color.timepicker_default_disabled_color_material)));
- mPaintDisabled.setAntiAlias(true);
-
if (DEBUG) {
mPaintDebug.setColor(DEBUG_COLOR);
mPaintDebug.setAntiAlias(true);
@@ -722,7 +724,11 @@ public class RadialTimePickerView extends View implements View.OnTouchListener {
@Override
public void onDraw(Canvas canvas) {
- canvas.save();
+ if (!mInputEnabled) {
+ canvas.saveLayerAlpha(0, 0, getWidth(), getHeight(), mDisabledAlpha);
+ } else {
+ canvas.save();
+ }
calculateGridSizesHours();
calculateGridSizesMinutes();
@@ -749,12 +755,6 @@ public class RadialTimePickerView extends View implements View.OnTouchListener {
drawAmPm(canvas);
}
- if(!mInputEnabled) {
- // Draw outer view rectangle
- mRectF.set(0, 0, getWidth(), getHeight());
- canvas.drawRect(mRectF, mPaintDisabled);
- }
-
if (DEBUG) {
drawDebug(canvas);
}
diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java
index 5021960b9bbb..58a6562ee11e 100644
--- a/core/java/android/widget/TimePicker.java
+++ b/core/java/android/widget/TimePicker.java
@@ -17,7 +17,6 @@
package android.widget;
import android.annotation.Widget;
-import android.app.UiModeManager;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.TypedArray;
@@ -30,8 +29,6 @@ import com.android.internal.R;
import java.util.Locale;
-import static android.os.Build.VERSION_CODES.L;
-
/**
* A view for selecting the time of day, in either 24 hour or AM/PM mode. The
* hour, each minute digit, and AM/PM (if applicable) can be conrolled by
@@ -41,20 +38,14 @@ import static android.os.Build.VERSION_CODES.L;
* by entering single digits. Under AM/PM mode, the user can hit 'a', 'A", 'p'
* or 'P' to pick. For a dialog using this view, see
* {@link android.app.TimePickerDialog}.
- *<p>
+ * <p>
* See the <a href="{@docRoot}guide/topics/ui/controls/pickers.html">Pickers</a>
* guide.
* </p>
*/
@Widget
public class TimePicker extends FrameLayout {
-
- private TimePickerDelegate mDelegate;
-
- private AttributeSet mAttrs;
- private int mDefStyleAttr;
- private int mDefStyleRes;
- private Context mContext;
+ private final TimePickerDelegate mDelegate;
/**
* The callback interface used to indicate the time has been adjusted.
@@ -84,50 +75,18 @@ public class TimePicker extends FrameLayout {
public TimePicker(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
- mContext = context;
- mAttrs = attrs;
- mDefStyleAttr = defStyleAttr;
- mDefStyleRes = defStyleRes;
-
- TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TimePicker,
- mDefStyleAttr, mDefStyleRes);
-
- // Create the correct UI delegate. Legacy mode is used when API Levels is below L
- // release or when it is a TV UI
- final boolean isLegacyMode = a.getBoolean(
- R.styleable.TimePicker_legacyMode, isLegacyMode());
-
+ final TypedArray a = context.obtainStyledAttributes(
+ attrs, R.styleable.TimePicker, defStyleAttr, defStyleRes);
+ final boolean legacyMode = a.getBoolean(R.styleable.TimePicker_legacyMode, true);
a.recycle();
- setLegacyMode(isLegacyMode);
- }
-
- private boolean isLegacyMode() {
- UiModeManager uiModeManager =
- (UiModeManager) mContext.getSystemService(Context.UI_MODE_SERVICE);
- if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
- return true;
+ if (legacyMode) {
+ mDelegate = new LegacyTimePickerDelegate(
+ this, context, attrs, defStyleAttr, defStyleRes);
+ } else {
+ mDelegate = new android.widget.TimePickerDelegate(
+ this, context, attrs, defStyleAttr, defStyleRes);
}
- final int targetSdkVersion = getContext().getApplicationInfo().targetSdkVersion;
- return targetSdkVersion < L;
- }
-
- private TimePickerDelegate createLegacyUIDelegate(Context context, AttributeSet attrs,
- int defStyleAttr, int defStyleRes) {
- return new LegacyTimePickerDelegate(this, context, attrs, defStyleAttr, defStyleRes);
- }
-
- private TimePickerDelegate createNewUIDelegate(Context context, AttributeSet attrs,
- int defStyleAttr, int defStyleRes) {
- return new android.widget.TimePickerDelegate(this, context, attrs, defStyleAttr,
- defStyleRes);
- }
-
- private void setLegacyMode(boolean isLegacyMode) {
- removeAllViewsInLayout();
- mDelegate = isLegacyMode ?
- createLegacyUIDelegate(mContext, mAttrs, mDefStyleAttr, mDefStyleRes) :
- createNewUIDelegate(mContext, mAttrs, mDefStyleAttr, mDefStyleRes);
}
/**
@@ -185,9 +144,6 @@ public class TimePicker extends FrameLayout {
@Override
public void setEnabled(boolean enabled) {
- if (mDelegate.isEnabled() == enabled) {
- return;
- }
super.setEnabled(enabled);
mDelegate.setEnabled(enabled);
}
diff --git a/core/java/android/widget/TimePickerDelegate.java b/core/java/android/widget/TimePickerDelegate.java
index cd896673a65a..a9af2f97fd95 100644
--- a/core/java/android/widget/TimePickerDelegate.java
+++ b/core/java/android/widget/TimePickerDelegate.java
@@ -23,6 +23,7 @@ import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
+import android.graphics.Color;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
@@ -30,7 +31,6 @@ import android.text.format.DateFormat;
import android.text.format.DateUtils;
import android.util.AttributeSet;
import android.util.Log;
-import android.util.TypedValue;
import android.view.HapticFeedbackConstants;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
@@ -79,9 +79,6 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
// Duration in ms of the pulse animation
private static final int PULSE_ANIMATOR_DURATION = 544;
- private static int[] TEXT_APPEARANCE_TIME_LABEL_ATTR =
- new int[] { R.attr.timePickerHeaderTimeLabelTextAppearance };
-
private final View mMainView;
private TextView mHourView;
private TextView mMinuteView;
@@ -92,7 +89,7 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
private ViewGroup mLayoutButtons;
private int mHeaderSelectedColor;
- private int mHeaderUnSelectedColor;
+ private int mHeaderUnselectedColor;
private String mAmText;
private String mPmText;
@@ -140,17 +137,14 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
mSelectMinutes = res.getString(R.string.select_minutes);
mHeaderSelectedColor = a.getColor(R.styleable.TimePicker_headerSelectedTextColor,
- R.color.timepicker_default_selector_color_material);
-
- mHeaderUnSelectedColor = getUnselectedColor(R.color.timepicker_default_text_color_material);
- if (mHeaderUnSelectedColor == -1) {
- mHeaderUnSelectedColor = a.getColor(R.styleable.TimePicker_headerUnselectedTextColor,
- R.color.timepicker_default_text_color_material);
- }
+ res.getColor(R.color.timepicker_default_selector_color_material));
+ final int headerTimeTextAppearance = a.getResourceId(
+ R.styleable.TimePicker_headerTimeTextAppearance, 0);
+ final int headerAmPmTextAppearance = a.getResourceId(
+ R.styleable.TimePicker_headerAmPmTextAppearance, 0);
final int headerBackgroundColor = a.getColor(
- R.styleable.TimePicker_headerBackgroundColor, 0);
-
+ R.styleable.TimePicker_headerBackgroundColor, Color.TRANSPARENT);
final int layoutResourceId = a.getResourceId(
R.styleable.TimePicker_internalLayout, R.layout.time_picker_holo);
@@ -162,18 +156,32 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
mMainView = inflater.inflate(layoutResourceId, null);
mDelegator.addView(mMainView);
- if (headerBackgroundColor != 0) {
- RelativeLayout header = (RelativeLayout) mMainView.findViewById(R.id.time_header);
- header.setBackgroundColor(headerBackgroundColor);
- }
-
mHourView = (TextView) mMainView.findViewById(R.id.hours);
+ mSeparatorView = (TextView) mMainView.findViewById(R.id.separator);
mMinuteView = (TextView) mMainView.findViewById(R.id.minutes);
mAmPmTextView = (TextView) mMainView.findViewById(R.id.ampm_label);
- mSeparatorView = (TextView) mMainView.findViewById(R.id.separator);
- mRadialTimePickerView = (RadialTimePickerView) mMainView.findViewById(R.id.radial_picker);
-
mLayoutButtons = (ViewGroup) mMainView.findViewById(R.id.layout_buttons);
+
+ // Set up text appearances from style.
+ if (headerTimeTextAppearance != 0) {
+ mHourView.setTextAppearance(context, headerTimeTextAppearance);
+ mSeparatorView.setTextAppearance(context, headerTimeTextAppearance);
+ mMinuteView.setTextAppearance(context, headerTimeTextAppearance);
+ }
+
+ if (headerAmPmTextAppearance != 0) {
+ mAmPmTextView.setTextAppearance(context, headerAmPmTextAppearance);
+ }
+
+ if (headerBackgroundColor != Color.TRANSPARENT) {
+ mLayoutButtons.setBackgroundColor(headerBackgroundColor);
+ mMainView.findViewById(R.id.time_header).setBackgroundColor(headerBackgroundColor);
+ }
+
+ // Load unselected header color from current state.
+ mHeaderUnselectedColor = mHourView.getCurrentTextColor();
+
+ mRadialTimePickerView = (RadialTimePickerView) mMainView.findViewById(R.id.radial_picker);
mDoneButton = (Button) mMainView.findViewById(R.id.done_button);
String[] amPmTexts = new DateFormatSymbols().getAmPmStrings();
@@ -198,25 +206,6 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
initialize(currentHour, currentMinute, false /* 12h */, HOUR_INDEX, false);
}
- private int getUnselectedColor(int defColor) {
- int result = -1;
- final Resources.Theme theme = mContext.getTheme();
- final TypedValue outValue = new TypedValue();
- theme.resolveAttribute(R.attr.timePickerHeaderTimeLabelTextAppearance, outValue, true);
- final int appearanceResId = outValue.resourceId;
- TypedArray appearance = null;
- if (appearanceResId != -1) {
- appearance = theme.obtainStyledAttributes(appearanceResId,
- com.android.internal.R.styleable.TextAppearance);
- }
- if (appearance != null) {
- result = appearance.getColor(
- com.android.internal.R.styleable.TextAppearance_textColor, defColor);
- appearance.recycle();
- }
- return result;
- }
-
private void initialize(int hourOfDay, int minute, boolean is24HourView, int index,
boolean showDoneButton) {
mInitialHourOfDay = hourOfDay;
@@ -292,11 +281,7 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
private int computeMaxWidthOfNumbers(int max) {
TextView tempView = new TextView(mContext);
- TypedArray a = mContext.obtainStyledAttributes(TEXT_APPEARANCE_TIME_LABEL_ATTR);
- final int textAppearanceResId = a.getResourceId(0, 0);
- tempView.setTextAppearance(mContext, (textAppearanceResId != 0) ?
- textAppearanceResId : R.style.TextAppearance_Material_TimePicker_TimeLabel);
- a.recycle();
+ tempView.setTextAppearance(mContext, R.style.TextAppearance_Material_TimePicker_TimeLabel);
ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
tempView.setLayoutParams(lp);
@@ -799,6 +784,7 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
separatorText = Character.toString(bestDateTimePattern.charAt(hIndex + 1));
}
mSeparatorView.setText(separatorText);
+ mSeparatorView.setTextColor(mHeaderUnselectedColor);
}
static private int lastIndexOfAny(String str, char[] any) {
@@ -852,8 +838,8 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
labelToAnimate = mMinuteView;
}
- int hourColor = (index == HOUR_INDEX) ? mHeaderSelectedColor : mHeaderUnSelectedColor;
- int minuteColor = (index == MINUTE_INDEX) ? mHeaderSelectedColor : mHeaderUnSelectedColor;
+ int hourColor = (index == HOUR_INDEX) ? mHeaderSelectedColor : mHeaderUnselectedColor;
+ int minuteColor = (index == MINUTE_INDEX) ? mHeaderSelectedColor : mHeaderUnselectedColor;
mHourView.setTextColor(hourColor);
mMinuteView.setTextColor(minuteColor);
@@ -1077,9 +1063,9 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
String minuteStr = (values[1] == -1) ? mDoublePlaceholderText :
String.format(minuteFormat, values[1]).replace(' ', mPlaceholderText);
mHourView.setText(hourStr);
- mHourView.setTextColor(mHeaderUnSelectedColor);
+ mHourView.setTextColor(mHeaderUnselectedColor);
mMinuteView.setText(minuteStr);
- mMinuteView.setTextColor(mHeaderUnSelectedColor);
+ mMinuteView.setTextColor(mHeaderUnselectedColor);
if (!mIs24HourView) {
updateAmPmDisplay(values[2]);
}
diff --git a/core/res/res/layout-land/time_picker_holo.xml b/core/res/res/layout-land/time_picker_holo.xml
index f5ce1ec0868a..1725ddc26365 100644
--- a/core/res/res/layout-land/time_picker_holo.xml
+++ b/core/res/res/layout-land/time_picker_holo.xml
@@ -33,8 +33,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dip"
- android:layout_weight="1"
- android:background="?android:attr/timePickerHeaderBackgroundColor">
+ android:layout_weight="1">
<include
layout="@layout/time_header_label"
android:layout_width="match_parent"
@@ -47,7 +46,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:background="?android:attr/timePickerHeaderBackgroundColor"
android:divider="?android:attr/dividerHorizontal"
android:showDividers="beginning">
<Button
diff --git a/core/res/res/layout/time_header_label.xml b/core/res/res/layout/time_header_label.xml
index f5f4a0493340..45c62413f4bf 100644
--- a/core/res/res/layout/time_header_label.xml
+++ b/core/res/res/layout/time_header_label.xml
@@ -25,8 +25,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/separator"
- android:layout_alignBaseline="@+id/separator"
- android:textAppearance="?android:attr/timePickerHeaderTimeLabelTextAppearance"/>
+ android:layout_alignBaseline="@+id/separator"/>
<TextView
android:id="@+id/separator"
@@ -35,7 +34,6 @@
android:paddingLeft="@dimen/timepicker_separator_padding"
android:paddingRight="@dimen/timepicker_separator_padding"
android:layout_centerInParent="true"
- android:textAppearance="?android:attr/timePickerHeaderTimeLabelTextAppearance"
android:importantForAccessibility="no" />
<TextView
@@ -43,8 +41,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/separator"
- android:layout_alignBaseline="@+id/separator"
- android:textAppearance="?android:attr/timePickerHeaderTimeLabelTextAppearance" />
+ android:layout_alignBaseline="@+id/separator" />
<TextView
android:id="@+id/ampm_label"
@@ -53,7 +50,6 @@
android:paddingLeft="@dimen/timepicker_ampm_left_padding"
android:paddingRight="@dimen/timepicker_ampm_left_padding"
android:layout_toRightOf="@+id/separator"
- android:layout_alignBaseline="@+id/separator"
- android:textAppearance="?android:attr/timePickerHeaderAmPmLabelTextAppearance" />
+ android:layout_alignBaseline="@+id/separator" />
</RelativeLayout>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 93d59b4ceb51..72b648c79314 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -676,15 +676,6 @@
<!-- The TimePicker style. -->
<attr name="timePickerStyle" format="reference" />
- <!-- The TimePicker Header background color . -->
- <attr name="timePickerHeaderBackgroundColor" format="reference" />
-
- <!-- The TimePicker Header time label text appearance -->
- <attr name="timePickerHeaderTimeLabelTextAppearance" format="reference" />
-
- <!-- TimePicker Header am pm label text appearance -->
- <attr name="timePickerHeaderAmPmLabelTextAppearance" format="reference" />
-
<!-- The TimePicker dialog theme. -->
<attr name="timePickerDialogTheme" format="reference" />
@@ -4501,32 +4492,33 @@
</declare-styleable>
<declare-styleable name="TimePicker">
- <!-- @hide The layout of the time picker. -->
- <attr name="internalLayout" />
- <!-- @hide The layout of the legacy time picker. -->
- <attr name="legacyLayout" format="reference" />
<!-- @hide Enables or disable the use of the legacy layout for the TimePicker. -->
<attr name="legacyMode" format="boolean" />
- <!-- @hide The color when the non legacy TimePicker is disabled. -->
- <attr name="disabledColor" format="color|reference" />
- <!-- @hide The color for selected text of the non legacy TimePicker. -->
- <attr name="headerSelectedTextColor" format="color|reference" />
- <!-- @hide The color for unselected text of the non legacy TimePicker. -->
- <attr name="headerUnselectedTextColor" format="color|reference" />
- <!-- @hide The background color for the header of the non legacy TimePicker. -->
- <attr name="headerBackgroundColor" format="color|reference" />
- <!-- @hide The color for the hours/minutes numbers of the non legacy TimePicker. -->
- <attr name="numbersTextColor" format="color|reference" />
- <!-- @hide The background color for the hours/minutes numbers of the non legacy TimePicker. -->
- <attr name="numbersBackgroundColor" format="color|reference" />
- <!-- @hide The color for the AM/PM selectors of the non legacy TimePicker. -->
- <attr name="amPmTextColor" format="color|reference" />
- <!-- @hide The background color for the AM/PM selectors of the non legacy TimePicker when unselected. -->
- <attr name="amPmUnselectedBackgroundColor" format="color|reference" />
- <!-- @hide The background color for the AM/PM selectors of the non legacy TimePicker when selected. -->
- <attr name="amPmSelectedBackgroundColor" format="color|reference" />
- <!-- @hide The color for the hours/minutes selector of the non legacy TimePicker. -->
- <attr name="numbersSelectorColor" format="color|reference" />
+ <!-- @hide The layout of the legacy time picker. -->
+ <attr name="legacyLayout" format="reference" />
+ <!-- @hide The layout of the time picker. -->
+ <attr name="internalLayout" />
+ <!-- The text appearance for the AM/PM header of the TimePicker. -->
+ <attr name="headerAmPmTextAppearance" format="reference" />
+ <!-- The text appearance for the time header of the TimePicker. -->
+ <attr name="headerTimeTextAppearance" format="reference" />
+ <!-- The text color for selected time header of the TimePicker. This
+ will override the value from the text appearance. -->
+ <attr name="headerSelectedTextColor" format="color" />
+ <!-- The background color for the header of the TimePicker. -->
+ <attr name="headerBackgroundColor" format="color" />
+ <!-- The color for the hours/minutes numbers of the TimePicker. -->
+ <attr name="numbersTextColor" format="color" />
+ <!-- The background color for the hours/minutes numbers of the TimePicker. -->
+ <attr name="numbersBackgroundColor" format="color" />
+ <!-- The color for the AM/PM selectors of the TimePicker. -->
+ <attr name="amPmTextColor" format="color" />
+ <!-- The background color for the AM/PM selectors of the TimePicker when unselected. -->
+ <attr name="amPmUnselectedBackgroundColor" format="color" />
+ <!-- The background color for the AM/PM selectors of the TimePicker when selected. -->
+ <attr name="amPmSelectedBackgroundColor" format="color" />
+ <!-- The color for the hours/minutes selector of the TimePicker. -->
+ <attr name="numbersSelectorColor" format="color" />
</declare-styleable>
<!-- ========================= -->
diff --git a/core/res/res/values/colors_holo.xml b/core/res/res/values/colors_holo.xml
index 8785a567babd..eab1e3f84242 100644
--- a/core/res/res/values/colors_holo.xml
+++ b/core/res/res/values/colors_holo.xml
@@ -112,9 +112,6 @@
<color name="timepicker_default_text_color_holo_light">#8c8c8c</color>
<color name="timepicker_default_text_color_holo_dark">@color/white</color>
- <color name="timepicker_default_disabled_color_holo_light">#7f000000</color>
- <color name="timepicker_default_disabled_color_holo_dark">#7f08c8c8</color>
-
<color name="timepicker_default_ampm_selected_background_color_holo_light">@color/holo_blue_light</color>
<color name="timepicker_default_ampm_selected_background_color_holo_dark">@color/holo_blue_light</color>
diff --git a/core/res/res/values/colors_material.xml b/core/res/res/values/colors_material.xml
index c4f4891a207d..698888109e0e 100644
--- a/core/res/res/values/colors_material.xml
+++ b/core/res/res/values/colors_material.xml
@@ -161,7 +161,6 @@
<color name="timepicker_default_background_material">@color/primary_text_default_material_light</color>
<color name="timepicker_default_text_color_material">@color/black</color>
- <color name="timepicker_default_disabled_color_material">@color/bright_foreground_disabled_material_dark</color>
<color name="timepicker_default_ampm_selected_background_color_material">@color/material_light_blue_A200</color>
<color name="timepicker_default_ampm_unselected_background_color_material">@color/transparent</color>
<color name="timepicker_default_selector_color_material">@color/material_light_blue_A200</color>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 7b9a38fe6b53..070c6aa7c2af 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2251,6 +2251,20 @@
<public type="attr" name="dateSelectorYearListSelectedCircleColor" />
<public type="attr" name="calendarTextColor" />
+ <!-- For the TimePicker -->
+ <public type="attr" name="timePickerStyle" />
+ <public type="attr" name="timePickerDialogTheme" />
+ <public type="attr" name="headerTimeTextAppearance" />
+ <public type="attr" name="headerAmPmTextAppearance" />
+ <public type="attr" name="headerSelectedTextColor" />
+ <public type="attr" name="headerBackgroundColor" />
+ <public type="attr" name="numbersTextColor" />
+ <public type="attr" name="numbersBackgroundColor" />
+ <public type="attr" name="numbersSelectorColor" />
+ <public type="attr" name="amPmTextColor" />
+ <public type="attr" name="amPmUnselectedBackgroundColor" />
+ <public type="attr" name="amPmSelectedBackgroundColor" />
+
<public-padding type="dimen" name="l_resource_pad" end="0x01050010" />
<public-padding type="id" name="l_resource_pad" end="0x01020040" />
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 94ac19c98345..b9cacd7ff03c 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -568,6 +568,7 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.TimePicker">
+ <item name="legacyMode">true</item>
<item name="legacyLayout">@layout/time_picker_legacy</item>
</style>
@@ -1331,11 +1332,8 @@ please see styles_device_defaults.xml.
<item name="orientation">vertical</item>
</style>
- <style name="TextAppearance.TimePicker.TimeLabel" parent="TextAppearance">
- </style>
-
- <style name="TextAppearance.TimePicker.AmPmLabel" parent="TextAppearance">
- </style>
+ <style name="TextAppearance.TimePicker.TimeLabel" parent="TextAppearance" />
+ <style name="TextAppearance.TimePicker.AmPmLabel" parent="TextAppearance" />
<style name="Widget.FastScroll">
<item name="thumbDrawable">?attr/fastScrollThumbDrawable</item>
diff --git a/core/res/res/values/styles_device_defaults.xml b/core/res/res/values/styles_device_defaults.xml
index 9b5629b8b240..fb8d9f5ed9c5 100644
--- a/core/res/res/values/styles_device_defaults.xml
+++ b/core/res/res/values/styles_device_defaults.xml
@@ -212,8 +212,6 @@ easier.
<style name="TextAppearance.DeviceDefault.Small.Inverse" parent="TextAppearance.Material.Small.Inverse"/>
<style name="TextAppearance.DeviceDefault.SearchResult.Title" parent="TextAppearance.Material.SearchResult.Title"/>
<style name="TextAppearance.DeviceDefault.SearchResult.Subtitle" parent="TextAppearance.Material.SearchResult.Subtitle"/>
- <style name="TextAppearance.DeviceDefault.TimePicker.TimeLabel" parent="TextAppearance.Material.TimePicker.TimeLabel"/>
- <style name="TextAppearance.DeviceDefault.TimePicker.AmPmLabel" parent="TextAppearance.Material.TimePicker.AmPmLabel"/>
<style name="TextAppearance.DeviceDefault.Widget" parent="TextAppearance.Material.Widget"/>
<style name="TextAppearance.DeviceDefault.Widget.Button" parent="TextAppearance.Material.Widget.Button"/>
<style name="TextAppearance.DeviceDefault.Widget.IconMenu.Item" parent="TextAppearance.Material.Widget.IconMenu.Item"/>
@@ -281,9 +279,6 @@ easier.
<style name="DeviceDefault.Light.ButtonBar.AlertDialog" parent="Widget.Material.Light.ButtonBar.AlertDialog"/>
<style name="DeviceDefault.Light.SegmentedButton" parent="Widget.Material.Light.SegmentedButton"/>
- <style name="TextAppearance.DeviceDefault.Light.TimePicker.TimeLabel" parent="TextAppearance.Material.TimePicker.TimeLabel"/>
- <style name="TextAppearance.DeviceDefault.Light.TimePicker.AmPmLabel" parent="TextAppearance.Material.TimePicker.AmPmLabel"/>
-
<style name="Theme.DeviceDefault.Dialog.TimePicker" parent="Theme.Material.Dialog.TimePicker"/>
<style name="Theme.DeviceDefault.Light.Dialog.TimePicker" parent="Theme.Material.Light.Dialog.TimePicker"/>
diff --git a/core/res/res/values/styles_holo.xml b/core/res/res/values/styles_holo.xml
index 5dfbaeda2e5d..bf5fd29e434a 100644
--- a/core/res/res/values/styles_holo.xml
+++ b/core/res/res/values/styles_holo.xml
@@ -462,12 +462,14 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Holo.TimePicker" parent="Widget.TimePicker">
+ <item name="legacyMode">true</item>
<item name="legacyLayout">@layout/time_picker_legacy_holo</item>
+ <!-- Attributes for new-style TimePicker. -->
<item name="internalLayout">@layout/time_picker_holo</item>
- <item name="disabledColor">@color/timepicker_default_disabled_color_holo_dark</item>
- <item name="headerSelectedTextColor">@color/holo_blue_light</item>
- <item name="headerUnselectedTextColor">@color/timepicker_default_text_color_holo_dark</item>
+ <item name="headerTimeTextAppearance">@style/TextAppearance.Holo.TimePicker.TimeLabel</item>
+ <item name="headerAmPmTextAppearance">@style/TextAppearance.Holo.TimePicker.AmPmLabel</item>
<item name="headerBackgroundColor">@color/timepicker_default_background_holo_dark</item>
+ <item name="headerSelectedTextColor">@color/holo_blue_light</item>
<item name="numbersTextColor">@color/timepicker_default_text_color_holo_dark</item>
<item name="numbersBackgroundColor">@color/timepicker_default_background_holo_dark</item>
<item name="amPmTextColor">@color/timepicker_default_text_color_holo_dark</item>
@@ -880,12 +882,14 @@ please see styles_device_defaults.xml.
<style name="Widget.Holo.Light.NumberPicker" parent="Widget.Holo.NumberPicker" />
<style name="Widget.Holo.Light.TimePicker" parent="Widget.TimePicker">
+ <item name="legacyMode">true</item>
<item name="legacyLayout">@layout/time_picker_legacy_holo</item>
+ <!-- Non-legacy styling -->
<item name="internalLayout">@layout/time_picker_holo</item>
- <item name="disabledColor">@color/timepicker_default_disabled_color_holo_light</item>
- <item name="headerSelectedTextColor">@color/holo_blue_light</item>
- <item name="headerUnselectedTextColor">@color/timepicker_default_text_color_holo_light</item>
+ <item name="headerTimeTextAppearance">@style/TextAppearance.Holo.Light.TimePicker.TimeLabel</item>
+ <item name="headerAmPmTextAppearance">@style/TextAppearance.Holo.Light.TimePicker.AmPmLabel</item>
<item name="headerBackgroundColor">@color/timepicker_default_background_holo_light</item>
+ <item name="headerSelectedTextColor">@color/holo_blue_light</item>
<item name="numbersTextColor">@color/timepicker_default_text_color_holo_light</item>
<item name="numbersBackgroundColor">@color/timepicker_default_background_holo_light</item>
<item name="amPmTextColor">@color/timepicker_default_text_color_holo_light</item>
diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml
index 1d07c8d02843..6ae4f9001f19 100644
--- a/core/res/res/values/styles_material.xml
+++ b/core/res/res/values/styles_material.xml
@@ -343,13 +343,13 @@ please see styles_device_defaults.xml.
<style name="TextAppearance.Material.TimePicker.TimeLabel" parent="TextAppearance.Material">
<item name="textSize">@dimen/timepicker_time_label_size</item>
- <item name="textColor">?attr/textColorSecondary</item>
+ <item name="textColor">?attr/textColorPrimary</item>
</style>
<style name="TextAppearance.Material.TimePicker.AmPmLabel" parent="TextAppearance.Material">
<item name="textSize">@dimen/timepicker_ampm_label_size</item>
<item name="textAllCaps">true</item>
- <item name="textColor">?attr/textColorSecondary</item>
+ <item name="textColor">?attr/textColorPrimary</item>
<item name="textStyle">bold</item>
</style>
@@ -616,11 +616,11 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Material.TimePicker" parent="Widget.TimePicker">
- <item name="legacyLayout">@layout/time_picker_legacy_holo</item>
+ <item name="legacyMode">false</item>
<item name="internalLayout">@layout/time_picker_holo</item>
- <item name="disabledColor">@color/bright_foreground_disabled_material_dark</item>
+ <item name="headerTimeTextAppearance">@style/TextAppearance.Material.TimePicker.TimeLabel</item>
+ <item name="headerAmPmTextAppearance">@style/TextAppearance.Material.TimePicker.AmPmLabel</item>
<item name="headerSelectedTextColor">?attr/colorControlActivated</item>
- <item name="headerUnselectedTextColor">?attr/textColorPrimary</item>
<item name="headerBackgroundColor">@color/transparent</item>
<item name="numbersTextColor">?attr/textColorSecondary</item>
<item name="numbersBackgroundColor">@color/transparent</item>
@@ -956,12 +956,7 @@ please see styles_device_defaults.xml.
</style>
<style name="Widget.Material.Light.NumberPicker" parent="Widget.Material.NumberPicker"/>
-
- <style name="Widget.Material.Light.TimePicker" parent="Widget.Material.TimePicker">
- <item name="legacyLayout">@layout/time_picker_legacy_holo</item>
- <item name="internalLayout">@layout/time_picker_holo</item>
- <item name="disabledColor">@color/bright_foreground_disabled_material_light</item>
- </style>
+ <style name="Widget.Material.Light.TimePicker" parent="Widget.Material.TimePicker" />
<style name="Widget.Material.Light.DatePicker" parent="Widget.DatePicker">
<item name="legacyLayout">@layout/date_picker_legacy_holo</item>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index e19231b037ec..08d354c61dd0 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1846,17 +1846,13 @@
<!-- From the new TimePicker and DatePicker -->
<java-symbol type="attr" name="timePickerDialogTheme" />
- <java-symbol type="attr" name="timePickerHeaderTimeLabelTextAppearance" />
- <java-symbol type="attr" name="timePickerHeaderBackgroundColor" />
<java-symbol type="attr" name="headerSelectedTextColor" />
- <java-symbol type="attr" name="headerUnselectedTextColor" />
<java-symbol type="attr" name="numbersTextColor" />
<java-symbol type="attr" name="numbersBackgroundColor" />
<java-symbol type="attr" name="amPmTextColor" />
<java-symbol type="attr" name="amPmUnselectedBackgroundColor" />
<java-symbol type="attr" name="amPmSelectedBackgroundColor" />
<java-symbol type="attr" name="numbersSelectorColor" />
- <java-symbol type="attr" name="timePickerHeaderTimeLabelTextAppearance" />
<java-symbol type="attr" name="nestedScrollingEnabled" />
<java-symbol type="attr" name="datePickerDialogTheme" />
<java-symbol type="attr" name="datePickerHeaderSelectorBackgroundColor" />
@@ -1926,7 +1922,6 @@
<java-symbol type="dimen" name="datepicker_year_picker_padding_top" />
<java-symbol type="color" name="timepicker_default_text_color_holo_light" />
- <java-symbol type="color" name="timepicker_default_disabled_color_holo_light" />
<java-symbol type="color" name="timepicker_default_ampm_unselected_background_color_holo_light" />
<java-symbol type="color" name="timepicker_default_ampm_selected_background_color_holo_light" />
@@ -1955,7 +1950,6 @@
<java-symbol type="style" name="Animation.VolumePanel" />
<java-symbol type="transition" name="no_transition" />
<java-symbol type="color" name="timepicker_default_text_color_material" />
- <java-symbol type="color" name="timepicker_default_disabled_color_material" />
<java-symbol type="color" name="timepicker_default_ampm_unselected_background_color_material" />
<java-symbol type="color" name="timepicker_default_ampm_selected_background_color_material" />
<java-symbol type="color" name="timepicker_default_selector_color_material" />
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 0438ed1d3991..0d4a2bf79e4d 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -394,15 +394,6 @@ please see themes_device_defaults.xml.
<!-- TimePicker style -->
<item name="timePickerStyle">@style/Widget.TimePicker</item>
- <!-- TimePicker background color -->
- <item name="timePickerHeaderBackgroundColor">@color/darker_gray</item>
-
- <!-- TimePicker Header time label text appearance -->
- <item name="timePickerHeaderTimeLabelTextAppearance">@style/TextAppearance.TimePicker.TimeLabel</item>
-
- <!-- TimePicker Header am pm label text appearance -->
- <item name="timePickerHeaderAmPmLabelTextAppearance">@style/TextAppearance.TimePicker.AmPmLabel</item>
-
<!-- TimePicker dialog theme -->
<item name="timePickerDialogTheme">@style/Theme.Dialog.TimePicker</item>
diff --git a/core/res/res/values/themes_device_defaults.xml b/core/res/res/values/themes_device_defaults.xml
index 2febbef0502b..43381d6c0991 100644
--- a/core/res/res/values/themes_device_defaults.xml
+++ b/core/res/res/values/themes_device_defaults.xml
@@ -195,12 +195,6 @@ easier.
<!-- TimePicker style -->
<item name="timePickerStyle">@style/Widget.DeviceDefault.TimePicker</item>
- <!-- TimePicker Header time label text appearance -->
- <item name="timePickerHeaderTimeLabelTextAppearance">@style/TextAppearance.DeviceDefault.TimePicker.TimeLabel</item>
-
- <!-- TimePicker Header am pm label text appearance -->
- <item name="timePickerHeaderAmPmLabelTextAppearance">@style/TextAppearance.DeviceDefault.TimePicker.AmPmLabel</item>
-
<!-- TimePicker dialog theme -->
<item name="timePickerDialogTheme">@style/Theme.DeviceDefault.Dialog.TimePicker</item>
@@ -470,12 +464,6 @@ easier.
<!-- TimePicker style -->
<item name="timePickerStyle">@style/Widget.DeviceDefault.Light.TimePicker</item>
- <!-- TimePicker Header time label text appearance -->
- <item name="timePickerHeaderTimeLabelTextAppearance">@style/TextAppearance.DeviceDefault.TimePicker.TimeLabel</item>
-
- <!-- TimePicker Header am pm label text appearance -->
- <item name="timePickerHeaderAmPmLabelTextAppearance">@style/TextAppearance.DeviceDefault.TimePicker.AmPmLabel</item>
-
<!-- TimePicker dialog theme -->
<item name="timePickerDialogTheme">@style/Theme.DeviceDefault.Light.Dialog.TimePicker</item>
diff --git a/core/res/res/values/themes_holo.xml b/core/res/res/values/themes_holo.xml
index dda42c1ee9e4..f6c6b4c629d6 100644
--- a/core/res/res/values/themes_holo.xml
+++ b/core/res/res/values/themes_holo.xml
@@ -374,15 +374,6 @@ please see themes_device_defaults.xml.
<!-- TimePicker style -->
<item name="timePickerStyle">@style/Widget.Holo.TimePicker</item>
- <!-- TimePicker background color -->
- <item name="timePickerHeaderBackgroundColor">@color/timepicker_default_background_holo_dark</item>
-
- <!-- TimePicker Header time label text appearance -->
- <item name="timePickerHeaderTimeLabelTextAppearance">@style/TextAppearance.Holo.TimePicker.TimeLabel</item>
-
- <!-- TimePicker Header am pm label text appearance -->
- <item name="timePickerHeaderAmPmLabelTextAppearance">@style/TextAppearance.Holo.TimePicker.AmPmLabel</item>
-
<!-- TimePicker dialog theme -->
<item name="timePickerDialogTheme">@style/Theme.Holo.Dialog.TimePicker</item>
@@ -740,15 +731,6 @@ please see themes_device_defaults.xml.
<!-- TimePicker style -->
<item name="timePickerStyle">@style/Widget.Holo.Light.TimePicker</item>
- <!-- TimePicker Header background color -->
- <item name="timePickerHeaderBackgroundColor">@color/timepicker_default_background_holo_light</item>
-
- <!-- TimePicker Header time label text appearance -->
- <item name="timePickerHeaderTimeLabelTextAppearance">@style/TextAppearance.Holo.Light.TimePicker.TimeLabel</item>
-
- <!-- TimePicker Header am pm label text appearance -->
- <item name="timePickerHeaderAmPmLabelTextAppearance">@style/TextAppearance.Holo.Light.TimePicker.AmPmLabel</item>
-
<!-- TimePicker dialog theme -->
<item name="timePickerDialogTheme">@style/Theme.Holo.Light.Dialog.TimePicker</item>
diff --git a/core/res/res/values/themes_leanback.xml b/core/res/res/values/themes_leanback.xml
index 534e323aebe2..636216d2e680 100644
--- a/core/res/res/values/themes_leanback.xml
+++ b/core/res/res/values/themes_leanback.xml
@@ -31,6 +31,7 @@
</style>
<style name="Theme.Leanback.Dialog.TimePicker" parent="Theme.Material.Dialog.BaseTimePicker">
+ <item name="legacyMode">true</item>
<item name="colorBackground">@color/background_leanback_dark</item>
<item name="textColorPrimary">@color/primary_text_leanback_dark</item>
<item name="textColorSecondary">@color/secondary_text_leanback_dark</item>
@@ -40,6 +41,7 @@
</style>
<style name="Theme.Leanback.Light.Dialog.TimePicker" parent="Theme.Material.Light.Dialog.BaseTimePicker">
+ <item name="legacyMode">true</item>
<item name="colorBackground">@color/background_leanback_light</item>
<item name="textColorPrimary">@color/primary_text_leanback_light</item>
<item name="textColorSecondary">@color/secondary_text_leanback_light</item>
diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml
index bdaeb45dd8fb..741ffe6766ae 100644
--- a/core/res/res/values/themes_material.xml
+++ b/core/res/res/values/themes_material.xml
@@ -352,15 +352,6 @@ please see themes_device_defaults.xml.
<!-- TimePicker style -->
<item name="timePickerStyle">@style/Widget.Material.TimePicker</item>
- <!-- TimePicker background color -->
- <item name="timePickerHeaderBackgroundColor">?colorBackground</item>
-
- <!-- TimePicker Header time label text appearance -->
- <item name="timePickerHeaderTimeLabelTextAppearance">@style/TextAppearance.Material.TimePicker.TimeLabel</item>
-
- <!-- TimePicker Header am pm label text appearance -->
- <item name="timePickerHeaderAmPmLabelTextAppearance">@style/TextAppearance.Material.TimePicker.AmPmLabel</item>
-
<!-- TimePicker dialog theme -->
<item name="timePickerDialogTheme">@style/Theme.Material.Dialog.TimePicker</item>
@@ -727,15 +718,6 @@ please see themes_device_defaults.xml.
<!-- TimePicker style -->
<item name="timePickerStyle">@style/Widget.Material.Light.TimePicker</item>
- <!-- TimePicker Header background color -->
- <item name="timePickerHeaderBackgroundColor">?attr/colorBackground</item>
-
- <!-- TimePicker Header time label text appearance -->
- <item name="timePickerHeaderTimeLabelTextAppearance">@style/TextAppearance.Material.TimePicker.TimeLabel</item>
-
- <!-- TimePicker Header am pm label text appearance -->
- <item name="timePickerHeaderAmPmLabelTextAppearance">@style/TextAppearance.Material.TimePicker.AmPmLabel</item>
-
<!-- TimePicker dialog theme -->
<item name="timePickerDialogTheme">@style/Theme.Material.Light.Dialog.TimePicker</item>
@@ -1153,12 +1135,8 @@ please see themes_device_defaults.xml.
AlertDialog theme. -->
<style name="Theme.Material.Dialog.Alert" parent="Theme.Material.Dialog.BaseAlert"/>
- <style name="Theme.Material.Dialog.BaseTimePicker">
- <item name="windowBackground">@color/transparent</item>
- <item name="windowElevation">0dp</item>
- <item name="windowTitleStyle">@style/DialogWindowTitle.Material</item>
- <item name="windowContentOverlay">@null</item>
- </style>
+ <!-- Base theme used to prevent circular references in Leanback overrides. -->
+ <style name="Theme.Material.Dialog.BaseTimePicker" />
<!-- Material theme for the TimePicker dialog windows, which is used by the
{@link android.app.TimePickerDialog} class. -->
@@ -1282,16 +1260,12 @@ please see themes_device_defaults.xml.
AlertDialog theme. -->
<style name="Theme.Material.Light.Dialog.Alert" parent="Theme.Material.Light.Dialog.BaseAlert"/>
- <style name="Theme.Material.Light.Dialog.BaseTimePicker">
- <item name="windowBackground">@color/transparent</item>
- <item name="windowElevation">0dp</item>
- <item name="windowTitleStyle">@style/DialogWindowTitle.Material.Light</item>
- <item name="windowContentOverlay">@null</item>
- </style>
+ <!-- Base theme used to prevent circular references in Leanback overrides. -->
+ <style name="Theme.Material.Light.Dialog.BaseTimePicker" />
<!-- Material Light theme for the TimePicker dialog windows, which is used by the
{@link android.app.TimePickerDialog} class. -->
- <style name="Theme.Material.Light.Dialog.TimePicker" parent="Theme.Material.Light.Dialog.BaseTimePicker"/>
+ <style name="Theme.Material.Light.Dialog.TimePicker" parent="Theme.Material.Light.Dialog.BaseTimePicker" />
<style name="Theme.Material.Light.Dialog.BaseDatePicker">
<item name="windowBackground">@color/transparent</item>