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

Commit 8e171e1f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Background color for notification shade should change with day/night mode."

parents 680c5aea 956c4825
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,9 @@
    <color name="status_bar_background_color">#ff000000</color>
    <color name="status_bar_background_color">#ff000000</color>
    <color name="system_bar_background_opaque">#ff0c1013</color>
    <color name="system_bar_background_opaque">#ff0c1013</color>


    <!-- The background color of the notification shade -->
    <color name="notification_shade_background_color">#E0000000</color>
    
    <!-- The color of the ripples on the untinted notifications -->
    <!-- The color of the ripples on the untinted notifications -->
    <color name="notification_ripple_untinted_color">@color/ripple_material_dark</color>
    <color name="notification_ripple_untinted_color">@color/ripple_material_dark</color>
</resources>
</resources>
+1 −1
Original line number Original line Diff line number Diff line
@@ -35,7 +35,7 @@
    <drawable name="system_bar_background">@android:color/transparent</drawable>
    <drawable name="system_bar_background">@android:color/transparent</drawable>


    <!-- The background color of the notification shade -->
    <!-- The background color of the notification shade -->
    <color name="notification_shade_background_color">#DD000000</color>
    <color name="notification_shade_background_color">#D6000000</color>


    <!-- The background color of the car volume dialog -->
    <!-- The background color of the car volume dialog -->
    <color name="car_volume_dialog_background_color">@color/system_bar_background_opaque</color>
    <color name="car_volume_dialog_background_color">@color/system_bar_background_opaque</color>
+16 −0
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@ import android.car.drivingstate.CarDrivingStateEvent;
import android.car.drivingstate.CarUxRestrictionsManager;
import android.car.drivingstate.CarUxRestrictionsManager;
import android.car.hardware.power.CarPowerManager.CarPowerStateListener;
import android.car.hardware.power.CarPowerManager.CarPowerStateListener;
import android.content.Context;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable;
@@ -1078,6 +1079,21 @@ public class CarStatusBar extends StatusBar implements
        }
        }
    }
    }


    @Override
    public void onConfigChanged(Configuration newConfig) {
        super.onConfigChanged(newConfig);

        int uiModeNightMask = (newConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK);

        boolean dayNightModeChanged = uiModeNightMask == Configuration.UI_MODE_NIGHT_YES
                || uiModeNightMask == Configuration.UI_MODE_NIGHT_NO;

        if (dayNightModeChanged) {
            mNotificationView.setBackgroundColor(
                    mContext.getColor(R.color.notification_shade_background_color));
        }
    }

    private void calculatePercentageFromBottom(float height) {
    private void calculatePercentageFromBottom(float height) {
        if (mNotificationView.getHeight() > 0) {
        if (mNotificationView.getHeight() > 0) {
            mPercentageFromBottom = (int) Math.abs(
            mPercentageFromBottom = (int) Math.abs(