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

Commit f86df994 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Fix colors in QS Header

Fixes icon and text colors in QS Header to be darker in Light mode.
Also, makes sure that all colors in the icons match.

Does this by implementing the following:
* A new theme that overrides darkIconTheme in Theme.SystemUI by one with
darker colors.
* QuickStatusBarHeader applies that theme and passes is onto its
children, in particular StatusIconContainer/StatusBarMobileView
and BatteryMeterView.
* StatusBarMobileView and BatteryMeterView retrieve the colors from the
theme and apply them accordingly.
* Also applies to QSCarrierGroup
* Additionally, the single color is used for the other icons.

Also invalidates SignalDrawable after setColors is called if at least
one of the colors changed. This is a real issue.

For more info:
* Text and icons set to 70% black on light mode, white in dark mode.
* Dual tone set for background overlaid with fill match single tone.

Test: visual
Fixes: 124466915

Change-Id: Ia6cb28fca90a07c8936726334502e7accf534df6
parent 7aa5752b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -203,8 +203,11 @@ public class SignalDrawable extends Drawable {
    }

    public void setColors(int background, int foreground) {
        int colorBackground = mPaint.getColor();
        int colorForeground = mForegroundPaint.getColor();
        mPaint.setColor(background);
        mForegroundPaint.setColor(foreground);
        if (colorBackground != background || colorForeground != foreground) invalidateSelf();
    }

    public void setDarkIntensity(float darkIntensity) {
+2 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@
    android:clipToPadding="false"
    android:minHeight="20dp"
    android:clickable="false"
    android:focusable="true">
    android:focusable="true"
    android:theme="@style/QSHeaderTheme">

    <com.android.systemui.statusbar.policy.DateView
        android:id="@+id/date"
+2 −3
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@
    android:layout_height="@dimen/qs_header_tooltip_height"
    android:layout_below="@id/quick_status_bar_system_icons"
    android:paddingStart="@dimen/status_bar_padding_start"
    android:paddingEnd="@dimen/status_bar_padding_end">
    android:paddingEnd="@dimen/status_bar_padding_end"
    android:theme="@style/QSHeaderTheme">

    <LinearLayout
        android:layout_width="wrap_content"
@@ -50,7 +51,6 @@
                    android:layout_width="@dimen/qs_header_alarm_icon_size"
                    android:layout_height="@dimen/qs_header_alarm_icon_size"
                    android:src="@drawable/ic_alarm"
                    android:tint="?android:attr/textColorPrimary"
                    android:contentDescription="@string/accessibility_quick_settings_alarm_set"
                    android:visibility="gone"/>

@@ -85,7 +85,6 @@
                    android:id="@+id/ringer_mode_icon"
                    android:layout_width="@dimen/qs_header_alarm_icon_size"
                    android:layout_height="@dimen/qs_header_alarm_icon_size"
                    android:tint="?android:attr/textColorPrimary"
                    android:visibility="gone"/>

                <TextView
+5 −0
Original line number Diff line number Diff line
@@ -24,4 +24,9 @@
        <item name="android:windowIsFloating">true</item>
    </style>

    <style name="TextAppearance.QS.Status" parent="TextAppearance.QS.TileLabel.Secondary">
        <item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
        <item name="android:textColor">?android:attr/textColorPrimary</item>
    </style>

</resources>
+5 −0
Original line number Diff line number Diff line
@@ -118,6 +118,11 @@
    <color name="light_mode_icon_color_dual_tone_background">#4dffffff</color>
    <color name="light_mode_icon_color_dual_tone_fill">#ffffff</color>

    <color name="dark_mode_qs_icon_color_single_tone">#B3000000</color><!-- 70% black -->
    <color name="dark_mode_qs_icon_color_dual_tone_background">#3d000000</color>
    <!-- Chosen so fill over background matches single tone -->
    <color name="dark_mode_qs_icon_color_dual_tone_fill">#99000000</color>

    <color name="docked_divider_background">#ff000000</color>
    <color name="docked_divider_handle">#ffffff</color>
    <drawable name="forced_resizable_background">#59000000</drawable>
Loading