mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Fix bug where status bar was not set properly.
- Need to check both alpha of the view, and alpha of the background color.
Bug: 187467559
Test: check status bar colors when using:
- on white wallpaper,
- on black wallpaper,
- on wallpaper with white text
- on wallpaper with dark text
Change-Id: Ie6f34d34dfa9dea716f95bd6a95125fbd650fc29
This commit is contained in:
@@ -97,8 +97,10 @@ public class ScrimView extends View implements Insettable {
|
||||
private void updateSysUiColors() {
|
||||
// Use a light system UI (dark icons) if all apps is behind at least half of the
|
||||
// status bar.
|
||||
boolean forceChange =
|
||||
getVisibility() == VISIBLE && getAlpha() > STATUS_BAR_COLOR_FORCE_UPDATE_THRESHOLD;
|
||||
final float threshold = STATUS_BAR_COLOR_FORCE_UPDATE_THRESHOLD;
|
||||
boolean forceChange = getVisibility() == VISIBLE
|
||||
&& getAlpha() > threshold
|
||||
&& (Color.alpha(mBackgroundColor) / 255f) > threshold;
|
||||
if (forceChange) {
|
||||
getSystemUiController().updateUiState(UI_STATE_SCRIM_VIEW, !isScrimDark());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user