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

Commit 485e78b4 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "1/N The road to Material NEXT (bouncer and shade)"

parents 4ccbda59 7b8636fd
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -5932,8 +5932,7 @@ public class Notification implements Parcelable
            }

            int color;
            int background = mContext.getColor(
                    com.android.internal.R.color.notification_material_background_color);
            int background = obtainBackgroundColor();
            if (rawColor == COLOR_DEFAULT) {
                ensureColors(p);
                color = ContrastColorUtil.resolveDefaultColor(mContext, background, mInNightMode);
@@ -5966,8 +5965,7 @@ public class Notification implements Parcelable
            if (mNeutralColor != COLOR_INVALID) {
                return mNeutralColor;
            }
            int background = mContext.getColor(
                    com.android.internal.R.color.notification_material_background_color);
            int background = obtainBackgroundColor();
            mNeutralColor = ContrastColorUtil.resolveDefaultColor(mContext, background,
                    mInNightMode);
            if (Color.alpha(mNeutralColor) < 255) {
@@ -6118,6 +6116,21 @@ public class Notification implements Parcelable
            return mN;
        }

        private @ColorInt int obtainBackgroundColor() {
            int defaultColor = mInNightMode ? Color.BLACK : Color.WHITE;
            Resources.Theme theme = mContext.getTheme();
            if (theme == null) {
                return defaultColor;
            }
            TypedArray ta = theme.obtainStyledAttributes(new int[]{R.attr.colorBackground});
            if (ta == null) {
                return defaultColor;
            }
            int background = ta.getColor(0, defaultColor);
            ta.recycle();
            return background;
        }

        /**
         * Apply this Builder to an existing {@link Notification} object.
         *
@@ -6251,8 +6264,7 @@ public class Notification implements Parcelable
        private int resolveBackgroundColor(StandardTemplateParams p) {
            int backgroundColor = getBackgroundColor(p);
            if (backgroundColor == COLOR_DEFAULT) {
                backgroundColor = mContext.getColor(
                        com.android.internal.R.color.notification_material_background_color);
                backgroundColor = obtainBackgroundColor();
            }
            return backgroundColor;
        }
+14 −0
Original line number Diff line number Diff line
@@ -1090,6 +1090,20 @@ public class LockPatternView extends View {
        }
    }

    /**
     * Change theme colors
     * @param regularColor The dot color
     * @param successColor Color used when pattern is correct
     * @param errorColor Color used when authentication fails
     */
    public void setColors(int regularColor, int successColor, int errorColor) {
        mRegularColor = regularColor;
        mErrorColor = errorColor;
        mSuccessColor = successColor;
        mPathPaint.setColor(regularColor);
        invalidate();
    }

    private float getCenterXForColumn(int column) {
        return mPaddingLeft + column * mSquareWidth + mSquareWidth / 2f;
    }
+0 −3
Original line number Diff line number Diff line
@@ -26,9 +26,6 @@

    <color name="notification_default_color_dark">#ddffffff</color>

    <!-- The background color of a notification card. -->
    <color name="notification_material_background_color">@color/black</color>

    <color name="chooser_row_divider">@color/list_divider_color_dark</color>
    <color name="chooser_gradient_background">@color/loading_gradient_background_color_dark</color>
    <color name="chooser_gradient_highlight">@color/loading_gradient_highlight_color_dark</color>
+0 −2
Original line number Diff line number Diff line
@@ -143,8 +143,6 @@
    <color name="notification_default_color_dark">@color/primary_text_default_material_light</color>
    <color name="notification_default_color_light">#a3202124</color>

    <color name="notification_material_background_color">#ffffffff</color>

    <color name="notification_default_color">#757575</color> <!-- Gray 600 -->

    <color name="notification_action_button_text_color">@color/notification_default_color</color>
+4 −4
Original line number Diff line number Diff line
@@ -37,10 +37,10 @@
    <color name="accent_device_default_dark">@color/accent_material_dark</color>
    <color name="accent_device_default">@color/accent_device_default_light</color>

    <color name="background_device_default_dark">@color/background_material_dark</color>
    <color name="background_device_default_light">@color/background_material_light</color>
    <color name="background_floating_device_default_dark">@color/background_floating_material_dark</color>
    <color name="background_floating_device_default_light">@color/background_floating_material_light</color>
    <color name="background_device_default_dark">#1A1A1A</color>
    <color name="background_device_default_light">#F2F2F2</color>
    <color name="background_floating_device_default_dark">#0D0D0D</color>
    <color name="background_floating_device_default_light">#CCCCCC</color>

    <!-- Error color -->
    <color name="error_color_device_default_dark">@color/error_color_material_dark</color>
Loading