From 53eb598b638a1520e1f97ca2d691e54c4e9d04c8 Mon Sep 17 00:00:00 2001 From: Michael W Date: Tue, 4 Mar 2025 18:51:50 +0100 Subject: [PATCH] Messaging: Good news: we can tint the status bar properly! * 80% opacity is not what we want anymore * The status bar in the conversation list is also supposed to be tinted properly - so why not do it? Change-Id: I03c05595cd7f5a3f8f7dea120e14f3f3e0fff0b5 --- src/com/android/messaging/ui/BugleActionBarActivity.java | 3 +++ src/com/android/messaging/util/UiUtils.java | 9 +-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/com/android/messaging/ui/BugleActionBarActivity.java b/src/com/android/messaging/ui/BugleActionBarActivity.java index 80f591d..a095f57 100644 --- a/src/com/android/messaging/ui/BugleActionBarActivity.java +++ b/src/com/android/messaging/ui/BugleActionBarActivity.java @@ -72,6 +72,9 @@ public class BugleActionBarActivity extends AppCompatActivity implements ImeUtil if (LogUtil.isLoggable(LogUtil.BUGLE_TAG, LogUtil.VERBOSE)) { LogUtil.v(LogUtil.BUGLE_TAG, this.getLocalClassName() + ".onCreate"); } + + getWindow().setStatusBarColor(getResources().getColor(R.color.action_bar_background_color, + getTheme())); } @Override diff --git a/src/com/android/messaging/util/UiUtils.java b/src/com/android/messaging/util/UiUtils.java index b01f0d7..49c00f6 100644 --- a/src/com/android/messaging/util/UiUtils.java +++ b/src/com/android/messaging/util/UiUtils.java @@ -249,14 +249,7 @@ public class UiUtils { } public static void setStatusBarColor(final Activity activity, final int color) { - // To achieve the appearance of an 80% opacity blend against a black background, - // each color channel is reduced in value by 20%. - final int blendedRed = (int) Math.floor(0.8 * Color.red(color)); - final int blendedGreen = (int) Math.floor(0.8 * Color.green(color)); - final int blendedBlue = (int) Math.floor(0.8 * Color.blue(color)); - - activity.getWindow().setStatusBarColor( - Color.rgb(blendedRed, blendedGreen, blendedBlue)); + activity.getWindow().setStatusBarColor(color); } public static boolean isRtlMode() {