diff options
34 files changed, 585 insertions, 660 deletions
diff --git a/api/current.txt b/api/current.txt index a356307c0400..7eeecd405551 100644 --- a/api/current.txt +++ b/api/current.txt @@ -38846,6 +38846,7 @@ package android.widget { method public void addRule(int); method public void addRule(int, int); method public java.lang.String debug(java.lang.String); + method public int getRule(int); method public int[] getRules(); method public void removeRule(int); field public boolean alignWithParent; diff --git a/api/system-current.txt b/api/system-current.txt index 7db9c54aff09..d3752ef23c35 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -41305,6 +41305,7 @@ package android.widget { method public void addRule(int); method public void addRule(int, int); method public java.lang.String debug(java.lang.String); + method public int getRule(int); method public int[] getRules(); method public void removeRule(int); field public boolean alignWithParent; diff --git a/core/java/android/app/TimePickerDialog.java b/core/java/android/app/TimePickerDialog.java index 3a2c21b13dfd..a3b3022fc69c 100644 --- a/core/java/android/app/TimePickerDialog.java +++ b/core/java/android/app/TimePickerDialog.java @@ -31,20 +31,21 @@ import android.widget.TimePicker.ValidationCallback; import com.android.internal.R; /** - * A dialog that prompts the user for the time of day using a {@link TimePicker}. + * A dialog that prompts the user for the time of day using a + * {@link TimePicker}. * - * <p>See the <a href="{@docRoot}guide/topics/ui/controls/pickers.html">Pickers</a> - * guide.</p> + * <p> + * See the <a href="{@docRoot}guide/topics/ui/controls/pickers.html">Pickers</a> + * guide. */ public class TimePickerDialog extends AlertDialog implements OnClickListener, OnTimeChangedListener { - private static final String HOUR = "hour"; private static final String MINUTE = "minute"; private static final String IS_24_HOUR = "is24hour"; private final TimePicker mTimePicker; - private final OnTimeSetListener mTimeSetCallback; + private final OnTimeSetListener mTimeSetListener; private final int mInitialHourOfDay; private final int mInitialMinute; @@ -52,59 +53,70 @@ public class TimePickerDialog extends AlertDialog implements OnClickListener, /** * The callback interface used to indicate the user is done filling in - * the time (they clicked on the 'Done' button). + * the time (e.g. they clicked on the 'OK' button). */ public interface OnTimeSetListener { - /** - * @param view The view associated with this listener. - * @param hourOfDay The hour that was set. - * @param minute The minute that was set. + * Called when the user is done setting a new time and the dialog has + * closed. + * + * @param view the view associated with this listener + * @param hourOfDay the hour that was set + * @param minute the minute that was set */ - void onTimeSet(TimePicker view, int hourOfDay, int minute); + public void onTimeSet(TimePicker view, int hourOfDay, int minute); } /** - * @param context Parent. - * @param callBack How parent is notified. - * @param hourOfDay The initial hour. - * @param minute The initial minute. - * @param is24HourView Whether this is a 24 hour view, or AM/PM. + * Creates a new time picker dialog. + * + * @param context the parent context + * @param listener the listener to call when the time is set + * @param hourOfDay the initial hour + * @param minute the initial minute + * @param is24HourView whether this is a 24 hour view or AM/PM */ - public TimePickerDialog(Context context, - OnTimeSetListener callBack, - int hourOfDay, int minute, boolean is24HourView) { - this(context, 0, callBack, hourOfDay, minute, is24HourView); + public TimePickerDialog(Context context, OnTimeSetListener listener, int hourOfDay, int minute, + boolean is24HourView) { + this(context, 0, listener, hourOfDay, minute, is24HourView); } - static int resolveDialogTheme(Context context, int resid) { - if (resid == 0) { + static int resolveDialogTheme(Context context, int resId) { + if (resId == 0) { final TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(R.attr.timePickerDialogTheme, outValue, true); return outValue.resourceId; } else { - return resid; + return resId; } } /** - * @param context Parent. - * @param theme the theme to apply to this dialog - * @param callBack How parent is notified. - * @param hourOfDay The initial hour. - * @param minute The initial minute. + * Creates a new time picker dialog with the specified theme. + * + * @param context the parent context + * @param themeResId the resource ID of the theme to apply to this dialog + * @param listener the listener to call when the time is set + * @param hourOfDay the initial hour + * @param minute the initial minute * @param is24HourView Whether this is a 24 hour view, or AM/PM. */ - public TimePickerDialog(Context context, int theme, OnTimeSetListener callBack, int hourOfDay, - int minute, boolean is24HourView) { - super(context, resolveDialogTheme(context, theme)); + public TimePickerDialog(Context context, int themeResId, OnTimeSetListener listener, + int hourOfDay, int minute, boolean is24HourView) { + super(context, resolveDialogTheme(context, themeResId)); - mTimeSetCallback = callBack; + mTimeSetListener = listener; mInitialHourOfDay = hourOfDay; mInitialMinute = minute; mIs24HourView = is24HourView; final Context themeContext = getContext(); + + + final TypedValue outValue = new TypedValue(); + context.getTheme().resolveAttribute(R.attr.timePickerDialogTheme, outValue, true); + final int layoutResId = outValue.resourceId; + final LayoutInflater inflater = LayoutInflater.from(themeContext); final View view = inflater.inflate(R.layout.time_picker_dialog, null); setView(view); @@ -129,8 +141,8 @@ public class TimePickerDialog extends AlertDialog implements OnClickListener, public void onClick(DialogInterface dialog, int which) { switch (which) { case BUTTON_POSITIVE: - if (mTimeSetCallback != null) { - mTimeSetCallback.onTimeSet(mTimePicker, mTimePicker.getCurrentHour(), + if (mTimeSetListener != null) { + mTimeSetListener.onTimeSet(mTimePicker, mTimePicker.getCurrentHour(), mTimePicker.getCurrentMinute()); } break; diff --git a/core/java/android/content/res/ColorStateList.java b/core/java/android/content/res/ColorStateList.java index b42d8bcb9c4e..ace402a2b1f7 100644 --- a/core/java/android/content/res/ColorStateList.java +++ b/core/java/android/content/res/ColorStateList.java @@ -462,46 +462,6 @@ public class ColorStateList implements Parcelable { return mColors; } - /** - * If the color state list does not already have an entry matching the - * specified state, prepends a state set and color pair to a color state - * list. - * <p> - * This is a workaround used in TimePicker and DatePicker until we can - * add support for theme attributes in ColorStateList. - * - * @param colorStateList the source color state list - * @param state the state to prepend - * @param color the color to use for the given state - * @return a new color state list, or the source color state list if there - * was already a matching state set - * - * @hide Remove when we can support theme attributes. - */ - public static ColorStateList addFirstIfMissing( - ColorStateList colorStateList, int state, int color) { - final int[][] inputStates = colorStateList.getStates(); - for (int i = 0; i < inputStates.length; i++) { - final int[] inputState = inputStates[i]; - for (int j = 0; j < inputState.length; j++) { - if (inputState[j] == state) { - return colorStateList; - } - } - } - - final int[][] outputStates = new int[inputStates.length + 1][]; - System.arraycopy(inputStates, 0, outputStates, 1, inputStates.length); - outputStates[0] = new int[] { state }; - - final int[] inputColors = colorStateList.getColors(); - final int[] outputColors = new int[inputColors.length + 1]; - System.arraycopy(inputColors, 0, outputColors, 1, inputColors.length); - outputColors[0] = color; - - return new ColorStateList(outputStates, outputColors); - } - @Override public String toString() { return "ColorStateList{" + diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 502d5eefaca6..4472782f6418 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -10047,6 +10047,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * @return The measured width of this view as a bit mask. */ + @ViewDebug.ExportedProperty(category = "measurement", flagMapping = { + @ViewDebug.FlagToString(mask = MEASURED_STATE_MASK, equals = MEASURED_STATE_TOO_SMALL, + name = "MEASURED_STATE_TOO_SMALL"), + }) public final int getMeasuredWidthAndState() { return mMeasuredWidth; } @@ -10071,6 +10075,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * @return The measured width of this view as a bit mask. */ + @ViewDebug.ExportedProperty(category = "measurement", flagMapping = { + @ViewDebug.FlagToString(mask = MEASURED_STATE_MASK, equals = MEASURED_STATE_TOO_SMALL, + name = "MEASURED_STATE_TOO_SMALL"), + }) public final int getMeasuredHeightAndState() { return mMeasuredHeight; } diff --git a/core/java/android/widget/DatePickerCalendarDelegate.java b/core/java/android/widget/DatePickerCalendarDelegate.java index a053901f0d69..969c0735ae74 100644 --- a/core/java/android/widget/DatePickerCalendarDelegate.java +++ b/core/java/android/widget/DatePickerCalendarDelegate.java @@ -154,34 +154,23 @@ class DatePickerCalendarDelegate extends DatePicker.AbstractDatePickerDelegate i dateLayout.setBackground(a.getDrawable(R.styleable.DatePicker_headerBackground)); - final int headerSelectedTextColor = a.getColor( - R.styleable.DatePicker_headerSelectedTextColor, defaultHighlightColor); final int monthTextAppearanceResId = a.getResourceId( R.styleable.DatePicker_headerMonthTextAppearance, 0); if (monthTextAppearanceResId != 0) { mHeaderMonthTextView.setTextAppearance(context, monthTextAppearanceResId); } - mHeaderMonthTextView.setTextColor(ColorStateList.addFirstIfMissing( - mHeaderMonthTextView.getTextColors(), R.attr.state_selected, - headerSelectedTextColor)); final int dayOfMonthTextAppearanceResId = a.getResourceId( R.styleable.DatePicker_headerDayOfMonthTextAppearance, 0); if (dayOfMonthTextAppearanceResId != 0) { mHeaderDayOfMonthTextView.setTextAppearance(context, dayOfMonthTextAppearanceResId); } - mHeaderDayOfMonthTextView.setTextColor(ColorStateList.addFirstIfMissing( - mHeaderDayOfMonthTextView.getTextColors(), R.attr.state_selected, - headerSelectedTextColor)); final int headerYearTextAppearanceResId = a.getResourceId( R.styleable.DatePicker_headerYearTextAppearance, 0); if (headerYearTextAppearanceResId != 0) { mHeaderYearTextView.setTextAppearance(context, headerYearTextAppearanceResId); } - mHeaderYearTextView.setTextColor(ColorStateList.addFirstIfMissing( - mHeaderYearTextView.getTextColors(), R.attr.state_selected, - headerSelectedTextColor)); mDayPickerView = new DayPickerView(mContext); mDayPickerView.setFirstDayOfWeek(mFirstDayOfWeek); diff --git a/core/java/android/widget/RadialTimePickerView.java b/core/java/android/widget/RadialTimePickerView.java index dc4d93201d88..28b4db251302 100644 --- a/core/java/android/widget/RadialTimePickerView.java +++ b/core/java/android/widget/RadialTimePickerView.java @@ -157,6 +157,7 @@ public class RadialTimePickerView extends View { private boolean mIsOnInnerCircle; private int mSelectorRadius; + private int mSelectorStroke; private int mSelectorDotRadius; private int mCenterDotRadius; @@ -377,6 +378,7 @@ public class RadialTimePickerView extends View { mPaintBackground.setAntiAlias(true); mSelectorRadius = res.getDimensionPixelSize(R.dimen.timepicker_selector_radius); + mSelectorStroke = res.getDimensionPixelSize(R.dimen.timepicker_selector_stroke); mSelectorDotRadius = res.getDimensionPixelSize(R.dimen.timepicker_selector_dot_radius); mCenterDotRadius = res.getDimensionPixelSize(R.dimen.timepicker_center_dot_radius); @@ -772,6 +774,7 @@ public class RadialTimePickerView extends View { alpha = (int) (mAlphaSelector[index % 2][SELECTOR_LINE].getValue() * alphaMod + 0.5f); paint = mPaintSelector[index % 2][SELECTOR_LINE]; paint.setColor(color); + paint.setStrokeWidth(mSelectorStroke); paint.setAlpha(getMultipliedAlpha(color, alpha)); canvas.drawLine(mXCenter, mYCenter, pointX, pointY, paint); } diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index fef56b888e2b..6166c02e231e 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -1358,6 +1358,7 @@ public class RelativeLayout extends ViewGroup { * {@link android.widget.RelativeLayout RelativeLayout}, such as * ALIGN_WITH_PARENT_LEFT. * @see #addRule(int, int) + * @see #getRule(int) */ public void addRule(int verb) { mRules[verb] = TRUE; @@ -1378,6 +1379,7 @@ public class RelativeLayout extends ViewGroup { * for true or 0 for false). For verbs that don't refer to another sibling * (for example, ALIGN_WITH_PARENT_BOTTOM) just use -1. * @see #addRule(int) + * @see #getRule(int) */ public void addRule(int verb, int anchor) { mRules[verb] = anchor; @@ -1393,6 +1395,7 @@ public class RelativeLayout extends ViewGroup { * ALIGN_WITH_PARENT_LEFT. * @see #addRule(int) * @see #addRule(int, int) + * @see #getRule(int) */ public void removeRule(int verb) { mRules[verb] = 0; @@ -1400,6 +1403,22 @@ public class RelativeLayout extends ViewGroup { mRulesChanged = true; } + /** + * Returns the layout rule associated with a specific verb. + * + * @param verb one of the verbs defined by {@link RelativeLayout}, such + * as ALIGN_WITH_PARENT_LEFT + * @return the id of another view to use as an anchor, a boolean value + * (represented as {@link RelativeLayout#TRUE} for true + * or 0 for false), or -1 for verbs that don't refer to another + * sibling (for example, ALIGN_WITH_PARENT_BOTTOM) + * @see #addRule(int) + * @see #addRule(int, int) + */ + public int getRule(int verb) { + return mRules[verb]; + } + private boolean hasRelativeRules() { return (mInitialRules[START_OF] != 0 || mInitialRules[END_OF] != 0 || mInitialRules[ALIGN_START] != 0 || mInitialRules[ALIGN_END] != 0 || diff --git a/core/java/android/widget/TimePickerClockDelegate.java b/core/java/android/widget/TimePickerClockDelegate.java index ed052afc4cf1..3b88b21656d1 100644 --- a/core/java/android/widget/TimePickerClockDelegate.java +++ b/core/java/android/widget/TimePickerClockDelegate.java @@ -132,19 +132,19 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl mPmText = amPmStrings[1]; final int layoutResourceId = a.getResourceId(R.styleable.TimePicker_internalLayout, - R.layout.time_picker_holo); + R.layout.time_picker_material); final View mainView = inflater.inflate(layoutResourceId, delegator); mHeaderView = mainView.findViewById(R.id.time_header); mHeaderView.setBackground(a.getDrawable(R.styleable.TimePicker_headerBackground)); // Set up hour/minute labels. - mHourView = (TextView) mHeaderView.findViewById(R.id.hours); + mHourView = (TextView) mainView.findViewById(R.id.hours); mHourView.setOnClickListener(mClickListener); mHourView.setAccessibilityDelegate( new ClickActionDelegate(context, R.string.select_hours)); - mSeparatorView = (TextView) mHeaderView.findViewById(R.id.separator); - mMinuteView = (TextView) mHeaderView.findViewById(R.id.minutes); + mSeparatorView = (TextView) mainView.findViewById(R.id.separator); + mMinuteView = (TextView) mainView.findViewById(R.id.minutes); mMinuteView.setOnClickListener(mClickListener); mMinuteView.setAccessibilityDelegate( new ClickActionDelegate(context, R.string.select_minutes)); @@ -162,17 +162,8 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl mHourView.setMinWidth(computeStableWidth(mHourView, 24)); mMinuteView.setMinWidth(computeStableWidth(mMinuteView, 60)); - // TODO: This can be removed once we support themed color state lists. - final int headerSelectedTextColor = a.getColor( - R.styleable.TimePicker_headerSelectedTextColor, - res.getColor(R.color.timepicker_default_selector_color_material)); - mHourView.setTextColor(ColorStateList.addFirstIfMissing(mHourView.getTextColors(), - R.attr.state_selected, headerSelectedTextColor)); - mMinuteView.setTextColor(ColorStateList.addFirstIfMissing(mMinuteView.getTextColors(), - R.attr.state_selected, headerSelectedTextColor)); - // Set up AM/PM labels. - mAmPmLayout = mHeaderView.findViewById(R.id.ampm_layout); + mAmPmLayout = mainView.findViewById(R.id.ampm_layout); mAmLabel = (CheckedTextView) mAmPmLayout.findViewById(R.id.am_label); mAmLabel.setText(amPmStrings[0]); mAmLabel.setOnClickListener(mClickListener); @@ -304,12 +295,15 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl final RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mAmPmLayout.getLayoutParams(); - if (isAmPmAtStart) { - params.removeRule(RelativeLayout.RIGHT_OF); - params.addRule(RelativeLayout.LEFT_OF, mHourView.getId()); - } else { - params.removeRule(RelativeLayout.LEFT_OF); - params.addRule(RelativeLayout.RIGHT_OF, mMinuteView.getId()); + if (params.getRule(RelativeLayout.RIGHT_OF) != 0 || + params.getRule(RelativeLayout.LEFT_OF) != 0) { + if (isAmPmAtStart) { + params.removeRule(RelativeLayout.RIGHT_OF); + params.addRule(RelativeLayout.LEFT_OF, mHourView.getId()); + } else { + params.removeRule(RelativeLayout.LEFT_OF); + params.addRule(RelativeLayout.RIGHT_OF, mMinuteView.getId()); + } } mAmPmLayout.setLayoutParams(params); @@ -613,11 +607,11 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl private void updateAmPmLabelStates(int amOrPm) { final boolean isAm = amOrPm == AM; mAmLabel.setChecked(isAm); - mAmLabel.setAlpha(isAm ? 1 : mDisabledAlpha); + mAmLabel.setSelected(isAm); final boolean isPm = amOrPm == PM; mPmLabel.setChecked(isPm); - mPmLabel.setAlpha(isPm ? 1 : mDisabledAlpha); + mPmLabel.setSelected(isPm); } /** diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java index 20d209f081dd..9dabb4e6a1b0 100644 --- a/core/java/com/android/internal/app/AlertController.java +++ b/core/java/com/android/internal/app/AlertController.java @@ -20,6 +20,7 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import com.android.internal.R; +import android.annotation.Nullable; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; @@ -38,7 +39,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; -import android.view.ViewTreeObserver; +import android.view.ViewStub; import android.view.Window; import android.view.WindowInsets; import android.view.WindowManager; @@ -450,27 +451,107 @@ public class AlertController { } } + /** + * Resolves whether a custom or default panel should be used. Removes the + * default panel if a custom panel should be used. If the resolved panel is + * a view stub, inflates before returning. + * + * @param customPanel the custom panel + * @param defaultPanel the default panel + * @return the panel to use + */ + @Nullable + private ViewGroup resolvePanel(@Nullable View customPanel, @Nullable View defaultPanel) { + if (customPanel == null) { + // Inflate the default panel, if needed. + if (defaultPanel instanceof ViewStub) { + defaultPanel = ((ViewStub) defaultPanel).inflate(); + } + + return (ViewGroup) defaultPanel; + } + + // Remove the default panel entirely. + if (defaultPanel != null) { + final ViewParent parent = defaultPanel.getParent(); + if (parent instanceof ViewGroup) { + ((ViewGroup) parent).removeView(defaultPanel); + } + } + + // Inflate the custom panel, if needed. + if (customPanel instanceof ViewStub) { + customPanel = ((ViewStub) customPanel).inflate(); + } + + return (ViewGroup) customPanel; + } + private void setupView() { - final ViewGroup contentPanel = (ViewGroup) mWindow.findViewById(R.id.contentPanel); - setupContent(contentPanel); - final boolean hasButtons = setupButtons(); + final View parentPanel = mWindow.findViewById(R.id.parentPanel); + final View defaultTopPanel = parentPanel.findViewById(R.id.topPanel); + final View defaultContentPanel = parentPanel.findViewById(R.id.contentPanel); + final View defaultButtonPanel = parentPanel.findViewById(R.id.buttonPanel); - final ViewGroup topPanel = (ViewGroup) mWindow.findViewById(R.id.topPanel); - final TypedArray a = mContext.obtainStyledAttributes( - null, R.styleable.AlertDialog, R.attr.alertDialogStyle, 0); - final boolean hasTitle = setupTitle(topPanel); + // Install custom content before setting up the title or buttons so + // that we can handle panel overrides. + final ViewGroup customPanel = (ViewGroup) parentPanel.findViewById(R.id.customPanel); + setupCustomContent(customPanel); - final View buttonPanel = mWindow.findViewById(R.id.buttonPanel); - if (!hasButtons) { - buttonPanel.setVisibility(View.GONE); - final View spacer = mWindow.findViewById(R.id.textSpacerNoButtons); - if (spacer != null) { - spacer.setVisibility(View.VISIBLE); + final View customTopPanel = customPanel.findViewById(R.id.topPanel); + final View customContentPanel = customPanel.findViewById(R.id.contentPanel); + final View customButtonPanel = customPanel.findViewById(R.id.buttonPanel); + + // Resolve the correct panels and remove the defaults, if needed. + final ViewGroup topPanel = resolvePanel(customTopPanel, defaultTopPanel); + final ViewGroup contentPanel = resolvePanel(customContentPanel, defaultContentPanel); + final ViewGroup buttonPanel = resolvePanel(customButtonPanel, defaultButtonPanel); + + setupContent(contentPanel); + setupButtons(buttonPanel); + setupTitle(topPanel); + + final boolean hasCustomPanel = customPanel != null + && customPanel.getVisibility() != View.GONE; + final boolean hasTopPanel = topPanel != null + && topPanel.getVisibility() != View.GONE; + final boolean hasButtonPanel = buttonPanel != null + && buttonPanel.getVisibility() != View.GONE; + + // Only display the text spacer if we don't have buttons. + if (!hasButtonPanel) { + if (contentPanel != null) { + final View spacer = contentPanel.findViewById(R.id.textSpacerNoButtons); + if (spacer != null) { + spacer.setVisibility(View.VISIBLE); + } } mWindow.setCloseOnTouchOutsideIfNotSet(true); } - final FrameLayout customPanel = (FrameLayout) mWindow.findViewById(R.id.customPanel); + // Only display the divider if we have a title and a custom view or a + // message. + if (hasTopPanel) { + final View divider; + if (mMessage != null || hasCustomPanel || mListView != null) { + divider = topPanel.findViewById(R.id.titleDivider); + } else { + divider = topPanel.findViewById(R.id.titleDividerTop); + } + + if (divider != null) { + divider.setVisibility(View.VISIBLE); + } + } + + final TypedArray a = mContext.obtainStyledAttributes( + null, R.styleable.AlertDialog, R.attr.alertDialogStyle, 0); + setBackground(a, topPanel, contentPanel, customPanel, buttonPanel, + hasTopPanel, hasCustomPanel, hasButtonPanel); + a.recycle(); + } + + private void setupCustomContent(ViewGroup customPanel) { final View customView; if (mView != null) { customView = mView; @@ -502,30 +583,9 @@ public class AlertController { } else { customPanel.setVisibility(View.GONE); } - - // Only display the divider if we have a title and a custom view or a - // message. - if (hasTitle) { - final View divider; - if (mMessage != null || customView != null || mListView != null) { - divider = mWindow.findViewById(R.id.titleDivider); - } else { - divider = mWindow.findViewById(R.id.titleDividerTop); - } - - if (divider != null) { - divider.setVisibility(View.VISIBLE); - } - } - - setBackground(a, topPanel, contentPanel, customPanel, buttonPanel, hasTitle, hasCustomView, - hasButtons); - a.recycle(); } - private boolean setupTitle(ViewGroup topPanel) { - boolean hasTitle = true; - + private void setupTitle(ViewGroup topPanel) { if (mCustomTitleView != null) { // Add the custom title view directly to the topPanel layout LayoutParams lp = new LayoutParams( @@ -567,18 +627,16 @@ public class AlertController { titleTemplate.setVisibility(View.GONE); mIconView.setVisibility(View.GONE); topPanel.setVisibility(View.GONE); - hasTitle = false; } } - return hasTitle; } private void setupContent(ViewGroup contentPanel) { - mScrollView = (ScrollView) mWindow.findViewById(R.id.scrollView); + mScrollView = (ScrollView) contentPanel.findViewById(R.id.scrollView); mScrollView.setFocusable(false); // Special case for users that only want to display a String - mMessageView = (TextView) mWindow.findViewById(R.id.message); + mMessageView = (TextView) contentPanel.findViewById(R.id.message); if (mMessageView == null) { return; } @@ -601,8 +659,8 @@ public class AlertController { } // Set up scroll indicators (if present). - final View indicatorUp = mWindow.findViewById(R.id.scrollIndicatorUp); - final View indicatorDown = mWindow.findViewById(R.id.scrollIndicatorDown); + final View indicatorUp = contentPanel.findViewById(R.id.scrollIndicatorUp); + final View indicatorDown = contentPanel.findViewById(R.id.scrollIndicatorDown); if (indicatorUp != null || indicatorDown != null) { if (mMessage != null) { // We're just showing the ScrollView, set up listener. @@ -663,12 +721,12 @@ public class AlertController { } } - private boolean setupButtons() { + private void setupButtons(ViewGroup buttonPanel) { int BIT_BUTTON_POSITIVE = 1; int BIT_BUTTON_NEGATIVE = 2; int BIT_BUTTON_NEUTRAL = 4; int whichButtons = 0; - mButtonPositive = (Button) mWindow.findViewById(R.id.button1); + mButtonPositive = (Button) buttonPanel.findViewById(R.id.button1); mButtonPositive.setOnClickListener(mButtonHandler); if (TextUtils.isEmpty(mButtonPositiveText)) { @@ -679,7 +737,7 @@ public class AlertController { whichButtons = whichButtons | BIT_BUTTON_POSITIVE; } - mButtonNegative = (Button) mWindow.findViewById(R.id.button2); + mButtonNegative = (Button) buttonPanel.findViewById(R.id.button2); mButtonNegative.setOnClickListener(mButtonHandler); if (TextUtils.isEmpty(mButtonNegativeText)) { @@ -691,7 +749,7 @@ public class AlertController { whichButtons = whichButtons | BIT_BUTTON_NEGATIVE; } - mButtonNeutral = (Button) mWindow.findViewById(R.id.button3); + mButtonNeutral = (Button) buttonPanel.findViewById(R.id.button3); mButtonNeutral.setOnClickListener(mButtonHandler); if (TextUtils.isEmpty(mButtonNeutralText)) { @@ -717,7 +775,10 @@ public class AlertController { } } - return whichButtons != 0; + final boolean hasButtons = whichButtons != 0; + if (!hasButtons) { + buttonPanel.setVisibility(View.GONE); + } } private void centerButton(Button button) { diff --git a/core/res/res/color/date_picker_calendar_holo_light.xml b/core/res/res/color/date_picker_calendar_holo_light.xml deleted file mode 100644 index 0aa116a87924..000000000000 --- a/core/res/res/color/date_picker_calendar_holo_light.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - - <item android:state_enabled="false" - android:color="@color/datepicker_default_disabled_text_color_holo_light" /> - <item android:state_activated="true" - android:color="@color/holo_blue_light" /> - <item android:color="@color/datepicker_default_normal_text_color_holo_light" /> - -</selector>
\ No newline at end of file diff --git a/core/res/res/color/date_picker_header_text_material.xml b/core/res/res/color/date_picker_header_text_material.xml new file mode 100644 index 000000000000..cda894bc2252 --- /dev/null +++ b/core/res/res/color/date_picker_header_text_material.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:state_selected="true" + android:color="?attr/textColorPrimaryInverse" /> + <item + android:color="?attr/textColorSecondaryInverse" /> +</selector>
\ No newline at end of file diff --git a/core/res/res/color/date_picker_selector_holo_dark.xml b/core/res/res/color/date_picker_selector_holo_dark.xml deleted file mode 100644 index 9e5a5bdf4a77..000000000000 --- a/core/res/res/color/date_picker_selector_holo_dark.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - - <item android:state_pressed="true" - android:color="@color/datepicker_default_pressed_text_color_holo_dark"/> - <item android:state_pressed="false" android:state_selected="true" - android:color="@color/datepicker_default_selected_text_color_holo_dark"/> - <item android:state_pressed="false" android:state_selected="false" - android:color="@color/datepicker_default_normal_text_color_holo_dark"/> - -</selector>
\ No newline at end of file diff --git a/core/res/res/color/date_picker_selector_holo_light.xml b/core/res/res/color/date_picker_selector_holo_light.xml deleted file mode 100644 index bf8667c245de..000000000000 --- a/core/res/res/color/date_picker_selector_holo_light.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - - <item android:state_pressed="true" - android:color="@color/datepicker_default_pressed_text_color_holo_light"/> - <item android:state_pressed="false" android:state_selected="true" - android:color="@color/datepicker_default_selected_text_color_holo_light"/> - <item android:state_pressed="false" android:state_selected="false" - android:color="@color/datepicker_default_normal_text_color_holo_light"/> - -</selector>
\ No newline at end of file diff --git a/core/res/res/color/date_picker_year_selector_holo_dark.xml b/core/res/res/color/date_picker_year_selector_holo_dark.xml deleted file mode 100644 index ce519b2812ee..000000000000 --- a/core/res/res/color/date_picker_year_selector_holo_dark.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - - <item android:state_pressed="true" - android:color="@color/datepicker_default_pressed_text_color_holo_dark"/> - <item android:state_pressed="false" android:state_selected="false" - android:color="@color/datepicker_default_normal_text_color_holo_dark"/> - -</selector>
\ No newline at end of file diff --git a/core/res/res/color/date_picker_year_selector_holo_light.xml b/core/res/res/color/date_picker_year_selector_holo_light.xml deleted file mode 100644 index c228711bcb25..000000000000 --- a/core/res/res/color/date_picker_year_selector_holo_light.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - - <item android:state_pressed="true" - android:color="@color/datepicker_default_pressed_text_color_holo_light"/> - <item android:state_pressed="false" android:state_selected="false" - android:color="@color/datepicker_default_normal_text_color_holo_light"/> - -</selector>
\ No newline at end of file diff --git a/core/res/res/color/time_picker_header_text_material.xml b/core/res/res/color/time_picker_header_text_material.xml new file mode 100644 index 000000000000..cda894bc2252 --- /dev/null +++ b/core/res/res/color/time_picker_header_text_material.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:state_selected="true" + android:color="?attr/textColorPrimaryInverse" /> + <item + android:color="?attr/textColorSecondaryInverse" /> +</selector>
\ No newline at end of file diff --git a/core/res/res/layout-land/time_picker_holo.xml b/core/res/res/layout-land/time_picker_holo.xml deleted file mode 100644 index f6923eefd9c7..000000000000 --- a/core/res/res/layout-land/time_picker_holo.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -** -** Copyright 2013, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="horizontal"> - <FrameLayout - android:layout_width="0dp" - android:layout_height="match_parent" - android:layout_weight="1" - android:minWidth="@dimen/timepicker_left_side_width" - android:orientation="vertical"> - <include - layout="@layout/time_header_label" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_gravity="center" /> - </FrameLayout> - <android.widget.RadialTimePickerView - android:id="@+id/radial_picker" - android:layout_width="@dimen/timepicker_radial_picker_dimen" - android:layout_height="match_parent" - android:layout_gravity="center" /> -</LinearLayout> diff --git a/core/res/res/layout-land/time_picker_material.xml b/core/res/res/layout-land/time_picker_material.xml new file mode 100644 index 000000000000..1b85e8f3bb9f --- /dev/null +++ b/core/res/res/layout-land/time_picker_material.xml @@ -0,0 +1,155 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<GridLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <View + android:id="@+id/time_header" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_column="0" + android:layout_row="0" + android:layout_rowSpan="3" + android:layout_gravity="center|fill" + tools:background="@color/accent_material_light" /> + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_column="0" + android:layout_row="1" + android:layout_gravity="center|fill" + android:paddingStart="?attr/dialogPreferredPadding" + android:paddingEnd="?attr/dialogPreferredPadding"> + + <LinearLayout + android:id="@+id/time_layout" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:layout_centerInParent="true" + android:paddingTop="@dimen/timepicker_radial_picker_top_margin"> + + <!-- The hour should always be to the left of the separator, + regardless of the current locale's layout direction. --> + <TextView + android:id="@+id/hours" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="none" + android:gravity="right" + tools:text="23" + tools:textSize="@dimen/timepicker_time_label_size" + tools:textColor="@color/white" /> + + <TextView + android:id="@+id/separator" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:importantForAccessibility="no" + tools:text=":" + tools:textSize="@dimen/timepicker_time_label_size" + tools:textColor="@color/white" /> + + <!-- The minutes should always be to the right of the separator, + regardless of the current locale's layout direction. --> + <TextView + android:id="@+id/minutes" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="none" + android:gravity="left" + tools:text="59" + tools:textSize="@dimen/timepicker_time_label_size" + tools:textColor="@color/white" /> + </LinearLayout> + + <!-- The layout alignment of this view will switch between toRightOf + @id/minutes and toLeftOf @id/hours depending on the locale. --> + <LinearLayout + android:id="@+id/ampm_layout" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/time_layout" + android:layout_centerHorizontal="true" + android:orientation="vertical"> + + <CheckedTextView + android:id="@+id/am_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingStart="@dimen/timepicker_ampm_horizontal_padding" + android:paddingEnd="@dimen/timepicker_ampm_horizontal_padding" + android:paddingTop="@dimen/timepicker_am_top_padding" + android:lines="1" + android:ellipsize="none" + android:includeFontPadding="false" + tools:text="AM" + tools:textSize="@dimen/timepicker_ampm_label_size" + tools:textColor="@color/white" /> + + <CheckedTextView + android:id="@+id/pm_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingStart="@dimen/timepicker_ampm_horizontal_padding" + android:paddingEnd="@dimen/timepicker_ampm_horizontal_padding" + android:paddingTop="@dimen/timepicker_pm_top_padding" + android:lines="1" + android:ellipsize="none" + android:includeFontPadding="false" + tools:text="PM" + tools:textSize="@dimen/timepicker_ampm_label_size" + tools:textColor="@color/white" /> + </LinearLayout> + </RelativeLayout> + + <ViewStub + android:id="@id/topPanel" + android:layout="@layout/alert_dialog_title_material" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_column="1" + android:layout_row="0" + android:layout_gravity="top|fill_horizontal" /> + + <android.widget.RadialTimePickerView + android:id="@+id/radial_picker" + android:layout_width="@dimen/timepicker_radial_picker_dimen" + android:layout_height="@dimen/timepicker_radial_picker_dimen" + android:layout_column="1" + android:layout_row="1" + android:layout_rowWeight="1" + android:layout_gravity="center|fill" + android:layout_marginTop="@dimen/timepicker_radial_picker_top_margin" + android:layout_marginStart="@dimen/timepicker_radial_picker_horizontal_margin" + android:layout_marginEnd="@dimen/timepicker_radial_picker_horizontal_margin" /> + + <ViewStub + android:id="@id/buttonPanel" + android:layout="@layout/alert_dialog_button_bar_material" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_column="1" + android:layout_row="2" + android:layout_gravity="bottom|fill_horizontal" /> +</GridLayout> diff --git a/core/res/res/layout/alert_dialog_material.xml b/core/res/res/layout/alert_dialog_material.xml index c8735b14e3db..bf1e383ed72f 100644 --- a/core/res/res/layout/alert_dialog_material.xml +++ b/core/res/res/layout/alert_dialog_material.xml @@ -22,34 +22,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <LinearLayout android:id="@+id/topPanel" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical"> - <LinearLayout android:id="@+id/title_template" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:gravity="center_vertical|start" - android:paddingStart="?attr/dialogPreferredPadding" - android:paddingEnd="?attr/dialogPreferredPadding" - android:paddingTop="@dimen/dialog_padding_top_material"> - <ImageView android:id="@+id/icon" - android:layout_width="32dip" - android:layout_height="32dip" - android:layout_marginEnd="8dip" - android:scaleType="fitCenter" - android:src="@null" /> - <com.android.internal.widget.DialogTitle android:id="@+id/alertTitle" - style="?attr/windowTitleStyle" - android:singleLine="true" - android:ellipsize="end" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:textAlignment="viewStart" /> - </LinearLayout> - <!-- If the client uses a customTitle, it will be added here. --> - </LinearLayout> + <include layout="@layout/alert_dialog_title_material" /> <FrameLayout android:id="@+id/contentPanel" android:layout_width="match_parent" diff --git a/core/res/res/layout/alert_dialog_title_material.xml b/core/res/res/layout/alert_dialog_title_material.xml new file mode 100644 index 000000000000..f61b90b3550d --- /dev/null +++ b/core/res/res/layout/alert_dialog_title_material.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/topPanel" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <LinearLayout + android:id="@+id/title_template" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical|start" + android:paddingStart="?attr/dialogPreferredPadding" + android:paddingEnd="?attr/dialogPreferredPadding" + android:paddingTop="@dimen/dialog_padding_top_material"> + + <ImageView + android:id="@+id/icon" + android:layout_width="32dip" + android:layout_height="32dip" + android:layout_marginEnd="8dip" + android:scaleType="fitCenter" + android:src="@null" /> + + <com.android.internal.widget.DialogTitle + android:id="@+id/alertTitle" + style="?attr/windowTitleStyle" + android:singleLine="true" + android:ellipsize="end" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAlignment="viewStart" /> + </LinearLayout> + + <!-- If the client uses a customTitle, it will be added here. --> +</LinearLayout>
\ No newline at end of file diff --git a/core/res/res/layout/time_header_label.xml b/core/res/res/layout/time_picker_header_material.xml index 46e7c5454cf1..0ef404d8ebfa 100644 --- a/core/res/res/layout/time_header_label.xml +++ b/core/res/res/layout/time_picker_header_material.xml @@ -16,12 +16,13 @@ --> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/time_header" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="center" - android:orientation="horizontal" - android:padding="@dimen/timepicker_separator_padding"> + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/time_header" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="horizontal" + android:padding="@dimen/timepicker_separator_padding" + tools:background="@color/accent_material_light"> <!-- The hour should always be to the left of the separator, regardless of the current locale's layout direction. --> @@ -31,7 +32,12 @@ android:layout_height="wrap_content" android:layout_toLeftOf="@+id/separator" android:layout_alignBaseline="@+id/separator" - android:gravity="right" /> + android:singleLine="true" + android:ellipsize="none" + android:gravity="right" + tools:text="23" + tools:textSize="@dimen/timepicker_time_label_size" + tools:textColor="@color/white" /> <TextView android:id="@+id/separator" @@ -40,7 +46,10 @@ android:layout_marginLeft="@dimen/timepicker_separator_padding" android:layout_marginRight="@dimen/timepicker_separator_padding" android:layout_centerInParent="true" - android:importantForAccessibility="no" /> + android:importantForAccessibility="no" + tools:text=":" + tools:textSize="@dimen/timepicker_time_label_size" + tools:textColor="@color/white" /> <!-- The minutes should always be to the left of the separator, regardless of the current locale's layout direction. --> @@ -50,7 +59,12 @@ android:layout_height="wrap_content" android:layout_toRightOf="@+id/separator" android:layout_alignBaseline="@+id/separator" - android:gravity="left" /> + android:singleLine="true" + android:ellipsize="none" + android:gravity="left" + tools:text="59" + tools:textSize="@dimen/timepicker_time_label_size" + tools:textColor="@color/white" /> <!-- The layout alignment of this view will switch between toRightOf @id/minutes and toLeftOf @id/hours depending on the locale. --> @@ -68,9 +82,12 @@ android:layout_height="wrap_content" android:paddingStart="@dimen/timepicker_ampm_horizontal_padding" android:paddingEnd="@dimen/timepicker_ampm_horizontal_padding" - android:paddingTop="@dimen/timepicker_ampm_vertical_padding" + android:paddingTop="@dimen/timepicker_am_top_padding" android:lines="1" - android:ellipsize="none" /> + android:ellipsize="none" + tools:text="AM" + tools:textSize="@dimen/timepicker_ampm_label_size" + tools:textColor="@color/white" /> <CheckedTextView android:id="@+id/pm_label" android:layout_width="wrap_content" @@ -79,6 +96,9 @@ android:paddingEnd="@dimen/timepicker_ampm_horizontal_padding" android:paddingTop="@dimen/timepicker_pm_top_padding" android:lines="1" - android:ellipsize="none" /> + android:ellipsize="none" + tools:text="PM" + tools:textSize="@dimen/timepicker_ampm_label_size" + tools:textColor="@color/white" /> </LinearLayout> </RelativeLayout> diff --git a/core/res/res/layout/time_picker_legacy_holo.xml b/core/res/res/layout/time_picker_legacy_material.xml index c6b7d3a70d97..c6b7d3a70d97 100644 --- a/core/res/res/layout/time_picker_legacy_holo.xml +++ b/core/res/res/layout/time_picker_legacy_material.xml diff --git a/core/res/res/layout/time_picker_holo.xml b/core/res/res/layout/time_picker_material.xml index cb25dbecd4e9..37a7384608ce 100644 --- a/core/res/res/layout/time_picker_holo.xml +++ b/core/res/res/layout/time_picker_material.xml @@ -22,7 +22,7 @@ android:layout_height="match_parent" android:orientation="vertical"> <include - layout="@layout/time_header_label" + layout="@layout/time_picker_header_material" android:layout_width="match_parent" android:layout_height="@dimen/timepicker_header_height" android:layout_gravity="center" /> @@ -31,7 +31,7 @@ android:layout_width="wrap_content" android:layout_height="@dimen/timepicker_radial_picker_dimen" android:layout_gravity="center" - android:layout_marginTop="?attr/dialogPreferredPadding" - android:layout_marginStart="?attr/dialogPreferredPadding" - android:layout_marginEnd="?attr/dialogPreferredPadding" /> + android:layout_marginTop="@dimen/timepicker_radial_picker_top_margin" + android:layout_marginStart="@dimen/timepicker_radial_picker_horizontal_margin" + android:layout_marginEnd="@dimen/timepicker_radial_picker_horizontal_margin" /> </LinearLayout> diff --git a/core/res/res/values-h320dp/bools.xml b/core/res/res/values-h320dp/bools.xml index 8dbc2e15e020..3bbfe9643b38 100644 --- a/core/res/res/values-h320dp/bools.xml +++ b/core/res/res/values-h320dp/bools.xml @@ -1,21 +1,20 @@ <?xml version="1.0" encoding="utf-8"?> <!-- -/* -** Copyright 2015, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. --> + <resources> <bool name="allow_stacked_button_bar">true</bool> </resources> diff --git a/core/res/res/color/date_picker_calendar_holo_dark.xml b/core/res/res/values-h320dp/dimens.xml index 6749ea1ab891..d0de6a11d64c 100644 --- a/core/res/res/color/date_picker_calendar_holo_dark.xml +++ b/core/res/res/values-h320dp/dimens.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 The Android Open Source Project +<!-- + Copyright (C) 2015 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,12 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. --> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_enabled="false" - android:color="@color/datepicker_default_disabled_text_color_holo_dark" /> - <item android:state_activated="true" - android:color="@color/holo_blue_light" /> - <item android:color="@color/datepicker_default_normal_text_color_holo_dark" /> +<resources> + <!-- Used by RadialTimePicker in clock-style TimePicker. --> + <dimen name="timepicker_text_inset_inner">58dp</dimen> + <dimen name="timepicker_radial_picker_dimen">224dp</dimen> + <integer name="timepicker_title_visibility">2</integer> -</selector>
\ No newline at end of file + <dimen name="floating_window_margin_left">16dp</dimen> + <dimen name="floating_window_margin_top">8dp</dimen> + <dimen name="floating_window_margin_right">16dp</dimen> + <dimen name="floating_window_margin_bottom">32dp</dimen> +</resources> diff --git a/core/res/res/values-land/dimens_material.xml b/core/res/res/values-land/dimens_material.xml index 77719a67ea92..379ccf6a0ed5 100644 --- a/core/res/res/values-land/dimens_material.xml +++ b/core/res/res/values-land/dimens_material.xml @@ -24,4 +24,28 @@ <!-- Default text size for action bar subtitle.--> <dimen name="text_size_subtitle_material_toolbar">12dp</dimen> + <!-- Floating window margins are small until we hit sw380dp-land. --> + <dimen name="floating_window_margin_left">16dp</dimen> + <dimen name="floating_window_margin_top">4dp</dimen> + <dimen name="floating_window_margin_right">16dp</dimen> + <dimen name="floating_window_margin_bottom">16dp</dimen> + + <!-- Material time picker dimensions. --> + <!-- Text size for the time picker header HH:MM label. This value is large + enough that we don't need to use scaled pixels, dp is fine. --> + <dimen name="timepicker_time_label_size">48dp</dimen> + <dimen name="timepicker_ampm_label_size">16sp</dimen> + <dimen name="timepicker_am_top_padding">8dp</dimen> + <dimen name="timepicker_pm_top_padding">3dp</dimen> + <!-- Radial picker is small until we hit sw380dp-land. --> + <dimen name="timepicker_radial_picker_dimen">180dp</dimen> + <dimen name="timepicker_radial_picker_top_margin">16dp</dimen> + <dimen name="timepicker_radial_picker_horizontal_margin">24dp</dimen> + + <!-- Used by RadialTimePicker in clock-style TimePicker. --> + <dimen name="timepicker_text_inset_normal">22dp</dimen> + <!-- Landscape inset is small until we hit sw380dp-land. --> + <dimen name="timepicker_text_inset_inner">46dp</dimen> + <dimen name="timepicker_text_size_normal">14sp</dimen> + <dimen name="timepicker_text_size_inner">12sp</dimen> </resources> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 09103e3c5e6a..6292b98ffa60 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -4471,10 +4471,6 @@ <attr name="headerYearTextAppearance" format="reference" /> <!-- The background for the date selector. --> <attr name="headerBackground" /> - <!-- @hide The selected text color for the date selector. Used as a - backup if the text appearance does not explicitly have a color - set for the selected state. --> - <attr name="headerSelectedTextColor" /> <!-- The list year's text appearance in the list. --> <attr name="yearListItemTextAppearance" format="reference" /> <!-- The list year's selected circle color in the list. --> @@ -4774,10 +4770,6 @@ <attr name="headerAmPmTextAppearance" format="reference" /> <!-- The text appearance for the time header. --> <attr name="headerTimeTextAppearance" format="reference" /> - <!-- @hide The text color for selected time header of the TimePicker. - This will override the value from the text appearance if it does - not explicitly have a color set for the selected state. --> - <attr name="headerSelectedTextColor" format="color" /> <!-- The background for the header containing the currently selected time. --> <attr name="headerBackground" /> <!-- The color for the hours/minutes numbers. --> @@ -4790,10 +4782,6 @@ <attr name="amPmTextColor" format="color" /> <!-- The background color state list for the AM/PM selectors. --> <attr name="amPmBackgroundColor" format="color" /> - <!-- @hide The background color for the AM/PM selectors of the - TimePicker when selected. Used if the background color does not - explicitly have a color set for the selected state. --> - <attr name="amPmSelectedBackgroundColor" format="color" /> <!-- The color for the hours/minutes selector. --> <attr name="numbersSelectorColor" format="color" /> <!-- Defines the look of the widget. Prior to the L release, the only choice was diff --git a/core/res/res/values/colors_holo.xml b/core/res/res/values/colors_holo.xml index eab1e3f84242..c29fec652652 100644 --- a/core/res/res/values/colors_holo.xml +++ b/core/res/res/values/colors_holo.xml @@ -103,46 +103,4 @@ <color name="group_button_dialog_pressed_holo_light">#ffffffff</color> <color name="group_button_dialog_focused_holo_light">#4699cc00</color> - <!-- Time picker --> - <eat-comment /> - - <color name="timepicker_default_background_holo_light">@color/white</color> - <color name="timepicker_default_background_holo_dark">#ff303030</color> - - <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_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> - - <color name="timepicker_default_ampm_unselected_background_color_holo_light">@color/white</color> - <color name="timepicker_default_ampm_unselected_background_color_holo_dark">@color/transparent</color> - - <!-- DatePicker colors --> - <eat-comment /> - - <color name="datepicker_default_header_selector_background_holo_light">@android:color/white</color> - <color name="datepicker_default_header_selector_background_holo_dark">#ff303030</color> - - <color name="datepicker_default_header_dayofweek_background_color_holo_light">#999999</color> - <color name="datepicker_default_header_dayofweek_background_color_holo_dark">@android:color/white</color> - - <color name="datepicker_default_normal_text_color_holo_light">#ff999999</color> - <color name="datepicker_default_normal_text_color_holo_dark">@android:color/white</color> - - <color name="datepicker_default_disabled_text_color_holo_light">#80999999</color> - <color name="datepicker_default_disabled_text_color_holo_dark">#80999999</color> - - <color name="datepicker_default_selected_text_color_holo_light">#33b5e5</color> - <color name="datepicker_default_selected_text_color_holo_dark">#33b5e5</color> - - <color name="datepicker_default_pressed_text_color_holo_light">#0099cc</color> - <color name="datepicker_default_pressed_text_color_holo_dark">#0099cc</color> - - <color name="datepicker_default_circle_background_color_holo_light">@android:color/holo_blue_light</color> - <color name="datepicker_default_circle_background_color_holo_dark">@android:color/holo_blue_light</color> - - <color name="datepicker_default_view_animator_color_holo_light">#f2f2f2</color> - <color name="datepicker_default_view_animator_color_holo_dark">#ff303030</color> - </resources> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index d240047e874e..e8a249e7320f 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -356,44 +356,6 @@ <!-- Outline width for video subtitles. --> <dimen name="subtitle_outline_width">2dp</dimen> - <!-- New TimePicker dimensions. --> - <dimen name="timepicker_selector_radius">24dp</dimen> - <dimen name="timepicker_center_dot_radius">4dp</dimen> - <dimen name="timepicker_selector_dot_radius">4dp</dimen> - <dimen name="timepicker_text_inset_normal">26dp</dimen> - <dimen name="timepicker_text_inset_inner">58dp</dimen> - <dimen name="timepicker_text_size_normal">14sp</dimen> - <dimen name="timepicker_text_size_inner">12sp</dimen> - - <!-- Text size for the time picker header HH:MM label. This value is large - enough that we don't need to use scaled pixels, dp is fine. --> - <dimen name="timepicker_time_label_size">60dp</dimen> - <dimen name="timepicker_ampm_label_size">16sp</dimen> - <dimen name="timepicker_ampm_horizontal_padding">12dp</dimen> - <dimen name="timepicker_ampm_vertical_padding">16dp</dimen> - <dimen name="timepicker_pm_top_padding">3dp</dimen> - <dimen name="timepicker_separator_padding">4dp</dimen> - <dimen name="timepicker_header_height">96dp</dimen> - <dimen name="timepicker_radial_picker_dimen">270dp</dimen> - - <!-- Used by SimpleMonthView --> - <dimen name="datepicker_day_number_size">12sp</dimen> - <dimen name="datepicker_month_label_size">14sp</dimen> - <dimen name="datepicker_month_day_label_text_size">12sp</dimen> - <dimen name="datepicker_month_list_item_header_height">48dp</dimen> - <dimen name="datepicker_view_animator_height">226dp</dimen> - - <dimen name="datepicker_year_picker_padding_top">8dp</dimen> - <dimen name="datepicker_year_label_height">64dp</dimen> - <dimen name="datepicker_year_label_text_size">22dp</dimen> - <dimen name="datepicker_component_width">260dp</dimen> - <dimen name="datepicker_dialog_width">520dp</dimen> - <dimen name="datepicker_selected_date_day_size">88dp</dimen> - <dimen name="datepicker_selected_date_month_size">24dp</dimen> - <dimen name="datepicker_selected_date_year_size">24dp</dimen> - <dimen name="datepicker_header_height">30dp</dimen> - <dimen name="datepicker_header_text_size">14dp</dimen> - <!-- Minimum size of the fast scroller thumb's touch target. --> <dimen name="fast_scroller_minimum_touch_target">48dp</dimen> diff --git a/core/res/res/values/dimens_material.xml b/core/res/res/values/dimens_material.xml index b84249a9fe4e..8d2afde07fa6 100644 --- a/core/res/res/values/dimens_material.xml +++ b/core/res/res/values/dimens_material.xml @@ -117,4 +117,47 @@ <dimen name="scrubber_track_height_material">2dp</dimen> <dimen name="progress_bar_height_material">4dp</dimen> + + <!-- Material time picker dimensions. --> + <!-- Text size for the time picker header HH:MM label. This value is large + enough that we don't need to use scaled pixels, dp is fine. --> + <dimen name="timepicker_time_label_size">60dp</dimen> + <dimen name="timepicker_ampm_label_size">16sp</dimen> + <dimen name="timepicker_ampm_horizontal_padding">16dp</dimen> + <dimen name="timepicker_am_top_padding">4dp</dimen> + <dimen name="timepicker_pm_top_padding">4dp</dimen> + <dimen name="timepicker_separator_padding">2dp</dimen> + <dimen name="timepicker_header_height">96dp</dimen> + <dimen name="timepicker_radial_picker_dimen">296dp</dimen> + <dimen name="timepicker_radial_picker_top_margin">16dp</dimen> + <dimen name="timepicker_radial_picker_horizontal_margin">16dp</dimen> + + <!-- Used by RadialTimePicker in clock-style TimePicker. --> + <dimen name="timepicker_selector_radius">20dp</dimen> + <dimen name="timepicker_selector_stroke">2dp</dimen> + <dimen name="timepicker_center_dot_radius">3dp</dimen> + <dimen name="timepicker_selector_dot_radius">3dp</dimen> + <dimen name="timepicker_text_inset_normal">22dp</dimen> + <dimen name="timepicker_text_inset_inner">58dp</dimen> + <dimen name="timepicker_text_size_normal">16sp</dimen> + <dimen name="timepicker_text_size_inner">12sp</dimen> + + <!-- Material date picker dimensions. --> + <dimen name="datepicker_year_picker_padding_top">8dp</dimen> + <dimen name="datepicker_year_label_height">64dp</dimen> + <dimen name="datepicker_year_label_text_size">22dp</dimen> + <dimen name="datepicker_component_width">260dp</dimen> + <dimen name="datepicker_dialog_width">520dp</dimen> + <dimen name="datepicker_selected_date_day_size">88dp</dimen> + <dimen name="datepicker_selected_date_month_size">24dp</dimen> + <dimen name="datepicker_selected_date_year_size">24dp</dimen> + <dimen name="datepicker_header_height">30dp</dimen> + <dimen name="datepicker_header_text_size">14dp</dimen> + + <!-- Used by Material-style SimpleMonthView --> + <dimen name="datepicker_day_number_size">12sp</dimen> + <dimen name="datepicker_month_label_size">14sp</dimen> + <dimen name="datepicker_month_day_label_text_size">12sp</dimen> + <dimen name="datepicker_month_list_item_header_height">48dp</dimen> + <dimen name="datepicker_view_animator_height">226dp</dimen> </resources> diff --git a/core/res/res/values/styles_holo.xml b/core/res/res/values/styles_holo.xml index 4589fa3b50d5..686106951b63 100644 --- a/core/res/res/values/styles_holo.xml +++ b/core/res/res/values/styles_holo.xml @@ -463,40 +463,14 @@ please see styles_device_defaults.xml. <item name="virtualButtonPressedDrawable">?attr/selectableItemBackground</item> </style> - <style name="Widget.Holo.TimePicker" parent="Widget.TimePicker"> + <style name="Widget.Holo.TimePicker" parent="Widget.Material.TimePicker"> + <!-- If the developer chooses "clock", they get the Material picker. --> <item name="timePickerMode">spinner</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="headerTimeTextAppearance">@style/TextAppearance.Holo.TimePicker.TimeLabel</item> - <item name="headerAmPmTextAppearance">@style/TextAppearance.Holo.TimePicker.AmPmLabel</item> - <item name="headerBackground">@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> - <item name="amPmBackgroundColor">@color/timepicker_default_background_holo_dark</item> - <item name="amPmSelectedBackgroundColor">@color/holo_blue_light</item> - <item name="numbersSelectorColor">@color/holo_blue_light</item> - </style> - - <style name="Widget.Holo.DatePicker" parent="Widget.DatePicker"> + </style> + + <style name="Widget.Holo.DatePicker" parent="Widget.Material.DatePicker"> + <!-- If the developer chooses "calendar", they get the Material picker. --> <item name="datePickerMode">spinner</item> - <item name="legacyLayout">@layout/date_picker_legacy_holo</item> - <item name="internalLayout">@layout/date_picker_holo</item> - <item name="calendarViewShown">true</item> - <!-- New-style date picker attributes. --> - <item name="dayOfWeekBackground">@color/datepicker_default_header_dayofweek_background_color_holo_dark</item> - <item name="dayOfWeekTextAppearance">@style/TextAppearance.Holo.DatePicker.DayOfWeekLabel</item> - <item name="headerBackground">@color/datepicker_default_header_selector_background_holo_dark</item> - <item name="headerMonthTextAppearance">@style/TextAppearance.Holo.DatePicker.Selector.MonthLabel</item> - <item name="headerDayOfMonthTextAppearance">@style/TextAppearance.Holo.DatePicker.Selector.DayOfMonthLabel</item> - <item name="headerYearTextAppearance">@style/TextAppearance.Holo.DatePicker.Selector.YearLabel</item> - <item name="headerSelectedTextColor">@color/holo_blue_light</item> - <item name="yearListItemTextAppearance">@style/TextAppearance.Holo.DatePicker.List.YearLabel</item> - <item name="yearListSelectorColor">@color/datepicker_default_circle_background_color_holo_dark</item> - <item name="calendarTextColor">@color/date_picker_calendar_holo_dark</item> - <item name="calendarDayBackgroundColor">@color/holo_blue_dark</item> </style> <style name="Widget.Holo.ActivityChooserView" parent="Widget.ActivityChooserView" /> @@ -888,40 +862,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"> + <style name="Widget.Holo.Light.TimePicker" parent="Widget.Material.Light.TimePicker"> + <!-- If the developer chooses "clock", they get the Material picker. --> <item name="timePickerMode">spinner</item> - <item name="legacyLayout">@layout/time_picker_legacy_holo</item> - <!-- Non-legacy styling --> - <item name="internalLayout">@layout/time_picker_holo</item> - <item name="headerTimeTextAppearance">@style/TextAppearance.Holo.Light.TimePicker.TimeLabel</item> - <item name="headerAmPmTextAppearance">@style/TextAppearance.Holo.Light.TimePicker.AmPmLabel</item> - <item name="headerBackground">@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> - <item name="amPmBackgroundColor">@color/timepicker_default_background_holo_light</item> - <item name="amPmSelectedBackgroundColor">@color/holo_blue_light</item> - <item name="numbersSelectorColor">@color/holo_blue_light</item> - </style> - - <style name="Widget.Holo.Light.DatePicker" parent="Widget.DatePicker"> + </style> + + <style name="Widget.Holo.Light.DatePicker" parent="Widget.Material.Light.DatePicker"> + <!-- If the developer chooses "calendar", they get the Material picker. --> <item name="datePickerMode">spinner</item> - <item name="legacyLayout">@layout/date_picker_legacy_holo</item> - <item name="internalLayout">@layout/date_picker_holo</item> - <item name="calendarViewShown">true</item> - <!-- New-style date picker attributes. --> - <item name="dayOfWeekBackground">@color/datepicker_default_header_dayofweek_background_color_holo_light</item> - <item name="dayOfWeekTextAppearance">@style/TextAppearance.Holo.Light.DatePicker.DayOfWeekLabel</item> - <item name="headerMonthTextAppearance">@style/TextAppearance.Holo.Light.DatePicker.Selector.MonthLabel</item> - <item name="headerDayOfMonthTextAppearance">@style/TextAppearance.Holo.Light.DatePicker.Selector.DayOfMonthLabel</item> - <item name="headerYearTextAppearance">@style/TextAppearance.Holo.Light.DatePicker.Selector.YearLabel</item> - <item name="headerBackground">@color/datepicker_default_header_selector_background_holo_light</item> - <item name="headerSelectedTextColor">@color/holo_blue_light</item> - <item name="yearListItemTextAppearance">@style/TextAppearance.Holo.Light.DatePicker.List.YearLabel</item> - <item name="yearListSelectorColor">@color/datepicker_default_circle_background_color_holo_light</item> - <item name="calendarTextColor">@color/date_picker_calendar_holo_light</item> - <item name="calendarDayBackgroundColor">@color/holo_blue_light</item> </style> <style name="Widget.Holo.Light.ActivityChooserView" parent="Widget.Holo.ActivityChooserView"> @@ -1221,86 +1169,6 @@ please see styles_device_defaults.xml. <item name="externalRouteEnabledDrawable">@drawable/ic_media_route_holo_light</item> </style> - <style name="TextAppearance.Holo.TimePicker.TimeLabel" parent="TextAppearance.Holo"> - <item name="textSize">@dimen/timepicker_time_label_size</item> - <item name="textColor">@color/timepicker_default_text_color_holo_dark</item> - </style> - - <style name="TextAppearance.Holo.TimePicker.AmPmLabel" parent="TextAppearance.Holo"> - <item name="textSize">@dimen/timepicker_ampm_label_size</item> - <item name="textAllCaps">true</item> - <item name="textColor">@color/timepicker_default_text_color_holo_dark</item> - <item name="textStyle">bold</item> - </style> - - <style name="TextAppearance.Holo.Light.TimePicker.TimeLabel" parent="TextAppearance.Holo.Light"> - <item name="textSize">@dimen/timepicker_time_label_size</item> - <item name="textColor">@color/timepicker_default_text_color_holo_light</item> - </style> - - <style name="TextAppearance.Holo.Light.TimePicker.AmPmLabel" parent="TextAppearance.Holo.Light"> - <item name="textSize">@dimen/timepicker_ampm_label_size</item> - <item name="textAllCaps">true</item> - <item name="textColor">@color/timepicker_default_text_color_holo_light</item> - <item name="textStyle">bold</item> - </style> - - <style name="TextAppearance.Holo.DatePicker.DayOfWeekLabel" parent="TextAppearance.Holo"> - <item name="includeFontPadding">false</item> - <item name="textColor">@color/black</item> - <item name="textSize">@dimen/datepicker_header_text_size</item> - </style> - - <style name="TextAppearance.Holo.DatePicker.Selector" parent="TextAppearance.Holo"> - <item name="includeFontPadding">false</item> - <item name="textColor">@color/date_picker_selector_holo_dark</item> - </style> - - <style name="TextAppearance.Holo.DatePicker.Selector.MonthLabel" parent="TextAppearance.Holo.DatePicker.Selector"> - <item name="textSize">@dimen/datepicker_selected_date_month_size</item> - </style> - - <style name="TextAppearance.Holo.DatePicker.Selector.DayOfMonthLabel" parent="TextAppearance.Holo.DatePicker.Selector"> - <item name="textSize">@dimen/datepicker_selected_date_day_size</item> - </style> - - <style name="TextAppearance.Holo.DatePicker.Selector.YearLabel" parent="TextAppearance.Holo.DatePicker.Selector"> - <item name="textSize">@dimen/datepicker_selected_date_year_size</item> - </style> - - <style name="TextAppearance.Holo.DatePicker.List.YearLabel" parent="TextAppearance.Holo"> - <item name="textColor">@color/date_picker_year_selector_holo_dark</item> - <item name="textSize">@dimen/datepicker_year_label_text_size</item> - </style> - - <style name="TextAppearance.Holo.Light.DatePicker.DayOfWeekLabel" parent="TextAppearance.Holo"> - <item name="includeFontPadding">false</item> - <item name="textColor">@color/white</item> - <item name="textSize">@dimen/datepicker_header_text_size</item> - </style> - - <style name="TextAppearance.Holo.Light.DatePicker.Selector" parent="TextAppearance.Holo"> - <item name="includeFontPadding">false</item> - <item name="textColor">@color/date_picker_selector_holo_light</item> - </style> - - <style name="TextAppearance.Holo.Light.DatePicker.Selector.MonthLabel" parent="TextAppearance.Holo.Light.DatePicker.Selector"> - <item name="textSize">@dimen/datepicker_selected_date_month_size</item> - </style> - - <style name="TextAppearance.Holo.Light.DatePicker.Selector.DayOfMonthLabel" parent="TextAppearance.Holo.Light.DatePicker.Selector"> - <item name="textSize">@dimen/datepicker_selected_date_day_size</item> - </style> - - <style name="TextAppearance.Holo.Light.DatePicker.Selector.YearLabel" parent="TextAppearance.Holo.Light.DatePicker.Selector"> - <item name="textSize">@dimen/datepicker_selected_date_year_size</item> - </style> - - <style name="TextAppearance.Holo.Light.DatePicker.List.YearLabel" parent="TextAppearance.Holo"> - <item name="textColor">@color/date_picker_year_selector_holo_light</item> - <item name="textSize">@dimen/datepicker_year_label_text_size</item> - </style> - <style name="Widget.Holo.FastScroll" parent="Widget.FastScroll"> <item name="thumbMinWidth">0dp</item> <item name="thumbMinHeight">0dp</item> diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml index 9a64dec9b9ce..a8ab18dbf7f4 100644 --- a/core/res/res/values/styles_material.xml +++ b/core/res/res/values/styles_material.xml @@ -37,7 +37,7 @@ please see styles_device_defaults.xml. </style> <style name="PreferenceFragment.Material"> - <item name="layout">@android:layout/preference_list_fragment_material</item> + <item name="layout">@layout/preference_list_fragment_material</item> <item name="paddingStart">@dimen/preference_fragment_padding_side_material</item> <item name="paddingEnd">@dimen/preference_fragment_padding_side_material</item> </style> @@ -72,7 +72,7 @@ please see styles_device_defaults.xml. </style> <style name="Preference.Material.SeekBarPreference"> - <item name="layout">@android:layout/preference_widget_seekbar_material</item> + <item name="layout">@layout/preference_widget_seekbar_material</item> </style> <style name="Preference.Material.PreferenceScreen"/> @@ -379,14 +379,12 @@ 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/textColorSecondaryInverse</item> + <item name="textColor">@color/time_picker_header_text_material</item> </style> - <style name="TextAppearance.Material.TimePicker.AmPmLabel" parent="TextAppearance.Material"> + <style name="TextAppearance.Material.TimePicker.AmPmLabel" parent="TextAppearance.Material.Button"> <item name="textSize">@dimen/timepicker_ampm_label_size</item> - <item name="textAllCaps">true</item> - <item name="textColor">?attr/textColorSecondaryInverse</item> - <item name="textStyle">bold</item> + <item name="textColor">@color/time_picker_header_text_material</item> </style> <style name="TextAppearance.Material.DatePicker.DayOfWeekLabel" parent="TextAppearance.Material"> @@ -397,19 +395,19 @@ please see styles_device_defaults.xml. <style name="TextAppearance.Material.DatePicker.MonthLabel" parent="TextAppearance.Material"> <item name="includeFontPadding">false</item> - <item name="textColor">?attr/textColorSecondaryInverse</item> + <item name="textColor">@color/date_picker_header_text_material</item> <item name="textSize">@dimen/datepicker_selected_date_month_size</item> </style> <style name="TextAppearance.Material.DatePicker.DayOfMonthLabel" parent="TextAppearance.Material"> <item name="includeFontPadding">false</item> - <item name="textColor">?attr/textColorSecondaryInverse</item> + <item name="textColor">@color/date_picker_header_text_material</item> <item name="textSize">@dimen/datepicker_selected_date_day_size</item> </style> <style name="TextAppearance.Material.DatePicker.YearLabel" parent="TextAppearance.Material"> <item name="includeFontPadding">false</item> - <item name="textColor">?attr/textColorSecondaryInverse</item> + <item name="textColor">@color/date_picker_header_text_material</item> <item name="textSize">@dimen/datepicker_selected_date_year_size</item> </style> @@ -642,36 +640,32 @@ please see styles_device_defaults.xml. <item name="virtualButtonPressedDrawable">?attr/selectableItemBackground</item> </style> - <style name="Widget.Material.TimePicker" parent="Widget.TimePicker"> + <style name="Widget.Material.TimePicker"> <item name="timePickerMode">clock</item> - <item name="legacyLayout">@layout/time_picker_legacy_holo</item> + <item name="legacyLayout">@layout/time_picker_legacy_material</item> <!-- Attributes for new-style TimePicker. --> - <item name="internalLayout">@layout/time_picker_holo</item> + <item name="internalLayout">@layout/time_picker_material</item> <item name="headerTimeTextAppearance">@style/TextAppearance.Material.TimePicker.TimeLabel</item> <item name="headerAmPmTextAppearance">@style/TextAppearance.Material.TimePicker.AmPmLabel</item> - <item name="headerSelectedTextColor">?attr/textColorPrimaryInverse</item> <item name="headerBackground">@drawable/time_picker_header_material</item> <item name="numbersTextColor">?attr/textColorPrimaryActivated</item> <item name="numbersInnerTextColor">?attr/textColorSecondaryActivated</item> <item name="numbersBackgroundColor">#10ffffff</item> <item name="numbersSelectorColor">?attr/colorControlActivated</item> <item name="amPmTextColor">?attr/textColorSecondary</item> - <item name="amPmBackgroundColor">@color/transparent</item> - <item name="amPmSelectedBackgroundColor">?attr/colorControlActivated</item> </style> - <style name="Widget.Material.DatePicker" parent="Widget.DatePicker"> + <style name="Widget.Material.DatePicker"> <item name="datePickerMode">calendar</item> <item name="legacyLayout">@layout/date_picker_legacy_holo</item> + <item name="calendarViewShown">true</item> <!-- Attributes for new-style DatePicker. --> <item name="internalLayout">@layout/date_picker_holo</item> - <item name="calendarViewShown">true</item> <item name="dayOfWeekBackground">#10000000</item> <item name="dayOfWeekTextAppearance">@style/TextAppearance.Material.DatePicker.DayOfWeekLabel</item> <item name="headerMonthTextAppearance">@style/TextAppearance.Material.DatePicker.MonthLabel</item> <item name="headerDayOfMonthTextAppearance">@style/TextAppearance.Material.DatePicker.DayOfMonthLabel</item> <item name="headerYearTextAppearance">@style/TextAppearance.Material.DatePicker.YearLabel</item> - <item name="headerSelectedTextColor">?attr/textColorPrimaryInverse</item> <item name="headerBackground">?attr/colorAccent</item> <item name="yearListItemTextAppearance">@style/TextAppearance.Material.DatePicker.List.YearLabel</item> <item name="yearListSelectorColor">?attr/colorControlActivated</item> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 39c0e8f9f3ab..86e46f6b0fc2 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1975,10 +1975,8 @@ <java-symbol type="attr" name="nestedScrollingEnabled" /> - <java-symbol type="style" name="TextAppearance.Holo.TimePicker.TimeLabel" /> - - <java-symbol type="layout" name="time_picker_holo" /> - <java-symbol type="layout" name="time_header_label" /> + <java-symbol type="layout" name="time_picker_material" /> + <java-symbol type="layout" name="time_picker_header_material" /> <java-symbol type="layout" name="year_label_text_view" /> <java-symbol type="layout" name="date_picker_holo" /> @@ -2045,22 +2043,6 @@ <java-symbol type="dimen" name="datepicker_year_label_height" /> <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_ampm_unselected_background_color_holo_light" /> - <java-symbol type="color" name="timepicker_default_ampm_selected_background_color_holo_light" /> - - <java-symbol type="color" name="datepicker_default_normal_text_color_holo_light" /> - <java-symbol type="color" name="datepicker_default_disabled_text_color_holo_light" /> - <java-symbol type="color" name="datepicker_default_circle_background_color_holo_light" /> - <java-symbol type="color" name="datepicker_default_header_dayofweek_background_color_holo_light" /> - <java-symbol type="color" name="datepicker_default_header_selector_background_holo_light" /> - - <java-symbol type="color" name="datepicker_default_normal_text_color_material_light" /> - <java-symbol type="color" name="datepicker_default_disabled_text_color_material_light" /> - <java-symbol type="color" name="datepicker_default_circle_background_color_material_light" /> - <java-symbol type="color" name="datepicker_default_header_dayofweek_background_color_material_light" /> - <java-symbol type="color" name="datepicker_default_header_selector_background_material_light" /> - <java-symbol type="array" name="config_clockTickVibePattern" /> <java-symbol type="array" name="config_calendarDateVibePattern" /> @@ -2106,8 +2088,6 @@ <java-symbol type="attr" name="ambientShadowAlpha" /> <java-symbol type="attr" name="spotShadowAlpha" /> <java-symbol type="array" name="config_cdma_home_system" /> - <java-symbol type="attr" name="headerSelectedTextColor" /> - <java-symbol type="attr" name="amPmSelectedBackgroundColor" /> <java-symbol type="bool" name="config_sms_decode_gsm_8bit_data" /> <java-symbol type="dimen" name="text_size_small_material" /> <java-symbol type="attr" name="checkMarkGravity" /> @@ -2169,4 +2149,5 @@ <java-symbol type="integer" name="config_screen_magnification_multi_tap_adjustment" /> <java-symbol type="dimen" name="config_screen_magnification_scaling_threshold" /> + <java-symbol type="dimen" name="timepicker_selector_stroke"/> </resources> |