Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cb07a46 authored by Alan Viverette's avatar Alan Viverette
Browse files

DO NOT MERGE Material theme

BUG: 15467097
Change-Id: I15191362e104a902895418fc615892c21db64c35
parent f2dc2d14
Loading
Loading
Loading
Loading
+201 −201

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Original line Diff line number Diff line
@@ -68,7 +68,7 @@ import java.util.Map;
 * select items accessible directly from the action bar as "action items". You can also
 * select items accessible directly from the action bar as "action items". You can also
 * modify various characteristics of the action bar or remove it completely.</p>
 * modify various characteristics of the action bar or remove it completely.</p>
 *
 *
 * <p>When using the Quantum themes (default in API 21 or newer) the navigation button
 * <p>When using the Material themes (default in API 21 or newer) the navigation button
 * (formerly "Home") takes over the space previously occupied by the application icon.
 * (formerly "Home") takes over the space previously occupied by the application icon.
 * Apps wishing to express a stronger branding should use their brand colors heavily
 * Apps wishing to express a stronger branding should use their brand colors heavily
 * in the action bar and other application chrome or use a {@link #setLogo(int) logo}
 * in the action bar and other application chrome or use a {@link #setLogo(int) logo}
+11 −11
Original line number Original line Diff line number Diff line
@@ -2499,7 +2499,7 @@ public class Notification implements Parcelable


        /**
        /**
         * @return Whether we are currently building a notification from a legacy (an app that
         * @return Whether we are currently building a notification from a legacy (an app that
         *         doesn't create quantum notifications by itself) app.
         *         doesn't create material notifications by itself) app.
         */
         */
        private boolean isLegacy() {
        private boolean isLegacy() {
            return mColorUtil != null;
            return mColorUtil != null;
@@ -2719,31 +2719,31 @@ public class Notification implements Parcelable




        private int getBaseLayoutResource() {
        private int getBaseLayoutResource() {
            return R.layout.notification_template_quantum_base;
            return R.layout.notification_template_material_base;
        }
        }


        private int getBigBaseLayoutResource() {
        private int getBigBaseLayoutResource() {
            return R.layout.notification_template_quantum_big_base;
            return R.layout.notification_template_material_big_base;
        }
        }


        private int getBigPictureLayoutResource() {
        private int getBigPictureLayoutResource() {
            return R.layout.notification_template_quantum_big_picture;
            return R.layout.notification_template_material_big_picture;
        }
        }


        private int getBigTextLayoutResource() {
        private int getBigTextLayoutResource() {
            return R.layout.notification_template_quantum_big_text;
            return R.layout.notification_template_material_big_text;
        }
        }


        private int getInboxLayoutResource() {
        private int getInboxLayoutResource() {
            return R.layout.notification_template_quantum_inbox;
            return R.layout.notification_template_material_inbox;
        }
        }


        private int getActionLayoutResource() {
        private int getActionLayoutResource() {
            return R.layout.notification_quantum_action;
            return R.layout.notification_material_action;
        }
        }


        private int getActionTombstoneLayoutResource() {
        private int getActionTombstoneLayoutResource() {
            return R.layout.notification_quantum_action_tombstone;
            return R.layout.notification_material_action_tombstone;
        }
        }
    }
    }


@@ -3238,7 +3238,7 @@ public class Notification implements Parcelable
        private RemoteViews generateMediaActionButton(Action action) {
        private RemoteViews generateMediaActionButton(Action action) {
            final boolean tombstone = (action.actionIntent == null);
            final boolean tombstone = (action.actionIntent == null);
            RemoteViews button = new RemoteViews(mBuilder.mContext.getPackageName(),
            RemoteViews button = new RemoteViews(mBuilder.mContext.getPackageName(),
                    R.layout.notification_quantum_media_action);
                    R.layout.notification_material_media_action);
            button.setImageViewResource(R.id.action0, action.icon);
            button.setImageViewResource(R.id.action0, action.icon);
            if (!tombstone) {
            if (!tombstone) {
                button.setOnClickPendingIntent(R.id.action0, action.actionIntent);
                button.setOnClickPendingIntent(R.id.action0, action.actionIntent);
@@ -3249,7 +3249,7 @@ public class Notification implements Parcelable


        private RemoteViews makeMediaContentView() {
        private RemoteViews makeMediaContentView() {
            RemoteViews view = mBuilder.applyStandardTemplate(
            RemoteViews view = mBuilder.applyStandardTemplate(
                    R.layout.notification_template_quantum_media, true /* 1U */);
                    R.layout.notification_template_material_media, true /* 1U */);


            final int numActions = mBuilder.mActions.size();
            final int numActions = mBuilder.mActions.size();
            final int N = mActionsToShowInCompact == null
            final int N = mActionsToShowInCompact == null
@@ -3274,7 +3274,7 @@ public class Notification implements Parcelable


        private RemoteViews makeMediaBigContentView() {
        private RemoteViews makeMediaBigContentView() {
            RemoteViews big = mBuilder.applyStandardTemplate(
            RemoteViews big = mBuilder.applyStandardTemplate(
                    R.layout.notification_template_quantum_big_media, false);
                    R.layout.notification_template_material_big_media, false);


            final int N = Math.min(mBuilder.mActions.size(), MAX_MEDIA_BUTTONS);
            final int N = Math.min(mBuilder.mActions.size(), MAX_MEDIA_BUTTONS);
            if (N > 0) {
            if (N > 0) {
+12 −12
Original line number Original line Diff line number Diff line
@@ -317,13 +317,13 @@ public class RadialTimePickerView extends View implements View.OnTouchListener {
        final Resources res = getResources();
        final Resources res = getResources();


        mAmPmUnselectedColor = a.getColor(R.styleable.TimePicker_amPmUnselectedBackgroundColor,
        mAmPmUnselectedColor = a.getColor(R.styleable.TimePicker_amPmUnselectedBackgroundColor,
                res.getColor(R.color.timepicker_default_ampm_unselected_background_color_quantum));
                res.getColor(R.color.timepicker_default_ampm_unselected_background_color_material));


        mAmPmSelectedColor = a.getColor(R.styleable.TimePicker_amPmSelectedBackgroundColor,
        mAmPmSelectedColor = a.getColor(R.styleable.TimePicker_amPmSelectedBackgroundColor,
                res.getColor(R.color.timepicker_default_ampm_selected_background_color_quantum));
                res.getColor(R.color.timepicker_default_ampm_selected_background_color_material));


        mAmPmTextColor = a.getColor(R.styleable.TimePicker_amPmTextColor,
        mAmPmTextColor = a.getColor(R.styleable.TimePicker_amPmTextColor,
                res.getColor(R.color.timepicker_default_text_color_quantum));
                res.getColor(R.color.timepicker_default_text_color_material));


        mTypeface = Typeface.create("sans-serif", Typeface.NORMAL);
        mTypeface = Typeface.create("sans-serif", Typeface.NORMAL);


@@ -338,7 +338,7 @@ public class RadialTimePickerView extends View implements View.OnTouchListener {
        }
        }


        final int numbersTextColor = a.getColor(R.styleable.TimePicker_numbersTextColor,
        final int numbersTextColor = a.getColor(R.styleable.TimePicker_numbersTextColor,
                res.getColor(R.color.timepicker_default_text_color_quantum));
                res.getColor(R.color.timepicker_default_text_color_material));


        mPaint[HOURS] = new Paint();
        mPaint[HOURS] = new Paint();
        mPaint[HOURS].setAntiAlias(true);
        mPaint[HOURS].setAntiAlias(true);
@@ -358,39 +358,39 @@ public class RadialTimePickerView extends View implements View.OnTouchListener {
        mPaintSelector[HOURS][SELECTOR_CIRCLE].setAntiAlias(true);
        mPaintSelector[HOURS][SELECTOR_CIRCLE].setAntiAlias(true);
        mColorSelector[HOURS][SELECTOR_CIRCLE] = a.getColor(
        mColorSelector[HOURS][SELECTOR_CIRCLE] = a.getColor(
                R.styleable.TimePicker_numbersSelectorColor,
                R.styleable.TimePicker_numbersSelectorColor,
                R.color.timepicker_default_selector_color_quantum);
                R.color.timepicker_default_selector_color_material);


        mPaintSelector[HOURS][SELECTOR_DOT] = new Paint();
        mPaintSelector[HOURS][SELECTOR_DOT] = new Paint();
        mPaintSelector[HOURS][SELECTOR_DOT].setAntiAlias(true);
        mPaintSelector[HOURS][SELECTOR_DOT].setAntiAlias(true);
        mColorSelector[HOURS][SELECTOR_DOT] = a.getColor(
        mColorSelector[HOURS][SELECTOR_DOT] = a.getColor(
                R.styleable.TimePicker_numbersSelectorColor,
                R.styleable.TimePicker_numbersSelectorColor,
                R.color.timepicker_default_selector_color_quantum);
                R.color.timepicker_default_selector_color_material);


        mPaintSelector[HOURS][SELECTOR_LINE] = new Paint();
        mPaintSelector[HOURS][SELECTOR_LINE] = new Paint();
        mPaintSelector[HOURS][SELECTOR_LINE].setAntiAlias(true);
        mPaintSelector[HOURS][SELECTOR_LINE].setAntiAlias(true);
        mPaintSelector[HOURS][SELECTOR_LINE].setStrokeWidth(2);
        mPaintSelector[HOURS][SELECTOR_LINE].setStrokeWidth(2);
        mColorSelector[HOURS][SELECTOR_LINE] = a.getColor(
        mColorSelector[HOURS][SELECTOR_LINE] = a.getColor(
                R.styleable.TimePicker_numbersSelectorColor,
                R.styleable.TimePicker_numbersSelectorColor,
                R.color.timepicker_default_selector_color_quantum);
                R.color.timepicker_default_selector_color_material);


        mPaintSelector[MINUTES][SELECTOR_CIRCLE] = new Paint();
        mPaintSelector[MINUTES][SELECTOR_CIRCLE] = new Paint();
        mPaintSelector[MINUTES][SELECTOR_CIRCLE].setAntiAlias(true);
        mPaintSelector[MINUTES][SELECTOR_CIRCLE].setAntiAlias(true);
        mColorSelector[MINUTES][SELECTOR_CIRCLE] = a.getColor(
        mColorSelector[MINUTES][SELECTOR_CIRCLE] = a.getColor(
                R.styleable.TimePicker_numbersSelectorColor,
                R.styleable.TimePicker_numbersSelectorColor,
                R.color.timepicker_default_selector_color_quantum);
                R.color.timepicker_default_selector_color_material);


        mPaintSelector[MINUTES][SELECTOR_DOT] = new Paint();
        mPaintSelector[MINUTES][SELECTOR_DOT] = new Paint();
        mPaintSelector[MINUTES][SELECTOR_DOT].setAntiAlias(true);
        mPaintSelector[MINUTES][SELECTOR_DOT].setAntiAlias(true);
        mColorSelector[MINUTES][SELECTOR_DOT] = a.getColor(
        mColorSelector[MINUTES][SELECTOR_DOT] = a.getColor(
                R.styleable.TimePicker_numbersSelectorColor,
                R.styleable.TimePicker_numbersSelectorColor,
                R.color.timepicker_default_selector_color_quantum);
                R.color.timepicker_default_selector_color_material);


        mPaintSelector[MINUTES][SELECTOR_LINE] = new Paint();
        mPaintSelector[MINUTES][SELECTOR_LINE] = new Paint();
        mPaintSelector[MINUTES][SELECTOR_LINE].setAntiAlias(true);
        mPaintSelector[MINUTES][SELECTOR_LINE].setAntiAlias(true);
        mPaintSelector[MINUTES][SELECTOR_LINE].setStrokeWidth(2);
        mPaintSelector[MINUTES][SELECTOR_LINE].setStrokeWidth(2);
        mColorSelector[MINUTES][SELECTOR_LINE] = a.getColor(
        mColorSelector[MINUTES][SELECTOR_LINE] = a.getColor(
                R.styleable.TimePicker_numbersSelectorColor,
                R.styleable.TimePicker_numbersSelectorColor,
                R.color.timepicker_default_selector_color_quantum);
                R.color.timepicker_default_selector_color_material);


        mPaintAmPmText.setColor(mAmPmTextColor);
        mPaintAmPmText.setColor(mAmPmTextColor);
        mPaintAmPmText.setTypeface(mTypeface);
        mPaintAmPmText.setTypeface(mTypeface);
@@ -403,11 +403,11 @@ public class RadialTimePickerView extends View implements View.OnTouchListener {
        mPaintAmPmCircle[PM].setAntiAlias(true);
        mPaintAmPmCircle[PM].setAntiAlias(true);


        mPaintBackground.setColor(a.getColor(R.styleable.TimePicker_numbersBackgroundColor,
        mPaintBackground.setColor(a.getColor(R.styleable.TimePicker_numbersBackgroundColor,
                res.getColor(R.color.timepicker_default_numbers_background_color_quantum)));
                res.getColor(R.color.timepicker_default_numbers_background_color_material)));
        mPaintBackground.setAntiAlias(true);
        mPaintBackground.setAntiAlias(true);


        mPaintDisabled.setColor(a.getColor(R.styleable.TimePicker_disabledColor,
        mPaintDisabled.setColor(a.getColor(R.styleable.TimePicker_disabledColor,
                res.getColor(R.color.timepicker_default_disabled_color_quantum)));
                res.getColor(R.color.timepicker_default_disabled_color_material)));
        mPaintDisabled.setAntiAlias(true);
        mPaintDisabled.setAntiAlias(true);


        if (DEBUG) {
        if (DEBUG) {
+4 −4
Original line number Original line Diff line number Diff line
@@ -140,12 +140,12 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
        mSelectMinutes = res.getString(R.string.select_minutes);
        mSelectMinutes = res.getString(R.string.select_minutes);


        mHeaderSelectedColor = a.getColor(R.styleable.TimePicker_headerSelectedTextColor,
        mHeaderSelectedColor = a.getColor(R.styleable.TimePicker_headerSelectedTextColor,
                R.color.timepicker_default_selector_color_quantum);
                R.color.timepicker_default_selector_color_material);


        mHeaderUnSelectedColor = getUnselectedColor(R.color.timepicker_default_text_color_quantum);
        mHeaderUnSelectedColor = getUnselectedColor(R.color.timepicker_default_text_color_material);
        if (mHeaderUnSelectedColor == -1) {
        if (mHeaderUnSelectedColor == -1) {
            mHeaderUnSelectedColor = a.getColor(R.styleable.TimePicker_headerUnselectedTextColor,
            mHeaderUnSelectedColor = a.getColor(R.styleable.TimePicker_headerUnselectedTextColor,
                    R.color.timepicker_default_text_color_quantum);
                    R.color.timepicker_default_text_color_material);
        }
        }


        final int headerBackgroundColor = a.getColor(
        final int headerBackgroundColor = a.getColor(
@@ -295,7 +295,7 @@ class TimePickerDelegate extends TimePicker.AbstractTimePickerDelegate implement
        TypedArray a = mContext.obtainStyledAttributes(TEXT_APPEARANCE_TIME_LABEL_ATTR);
        TypedArray a = mContext.obtainStyledAttributes(TEXT_APPEARANCE_TIME_LABEL_ATTR);
        final int textAppearanceResId = a.getResourceId(0, 0);
        final int textAppearanceResId = a.getResourceId(0, 0);
        tempView.setTextAppearance(mContext, (textAppearanceResId != 0) ?
        tempView.setTextAppearance(mContext, (textAppearanceResId != 0) ?
                textAppearanceResId : R.style.TextAppearance_Quantum_TimePicker_TimeLabel);
                textAppearanceResId : R.style.TextAppearance_Material_TimePicker_TimeLabel);
        a.recycle();
        a.recycle();
        ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
        ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);
                ViewGroup.LayoutParams.WRAP_CONTENT);
Loading