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

Commit c17ff175 authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Android (Google) Code Review
Browse files

Merge changes Iae726e8f,I1bf7e9d0 into main

* changes:
  [DesktopStatusBar] Fix ChipHighlight colors
  [DesktopStatusBar] Fix legacy status icon tint
parents 060df6a5 0b7ebe8f
Loading
Loading
Loading
Loading
+35 −37
Original line number Diff line number Diff line
@@ -34,11 +34,11 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.layout.onLayoutRectChanged
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
import com.android.settingslib.Utils
import com.android.systemui.clock.ui.composable.ClockLegacy
import com.android.systemui.clock.ui.viewmodel.AmPmStyle
import com.android.systemui.clock.ui.viewmodel.ClockViewModel
@@ -152,16 +152,17 @@ fun DesktopStatusBar(

@Composable
private fun NotificationsChip(viewModel: HomeStatusBarViewModel, modifier: Modifier = Modifier) {
    val chipHighlightModel =
        if (viewModel.isNotificationsChipHighlighted) {
            ChipHighlightModel.Strong
        } else {
            ChipHighlightModel.Transparent
        }
    ShadeHighlightChip(
        modifier = modifier,
        onClick = { viewModel.onNotificationIconChipClicked() },
        backgroundColor =
            if (viewModel.isNotificationsChipHighlighted) {
                ChipHighlightModel.Strong.backgroundColor
            } else {
                Color.Transparent
            },
        onHoveredBackgroundColor = ChipHighlightModel.Transparent.onHoveredBackgroundColor,
        backgroundColor = chipHighlightModel.backgroundColor,
        onHoveredBackgroundColor = chipHighlightModel.onHoveredBackgroundColor,
        horizontalArrangement =
            Arrangement.spacedBy(DesktopStatusBar.Dimensions.ChipInternalSpacing, Alignment.Start),
    ) {
@@ -187,16 +188,17 @@ private fun QuickSettingsChip(
    iconManagerFactory: TintedIconManager.Factory,
    modifier: Modifier = Modifier,
) {
    val chipHighlightModel =
        if (viewModel.isQuickSettingsChipHighlighted) {
            ChipHighlightModel.Strong
        } else {
            ChipHighlightModel.Transparent
        }
    ShadeHighlightChip(
        modifier = modifier,
        onClick = { viewModel.onQuickSettingsChipClicked() },
        backgroundColor =
            if (viewModel.isQuickSettingsChipHighlighted) {
                ChipHighlightModel.Strong.backgroundColor
            } else {
                Color.Transparent
            },
        onHoveredBackgroundColor = ChipHighlightModel.Transparent.onHoveredBackgroundColor,
        backgroundColor = chipHighlightModel.backgroundColor,
        onHoveredBackgroundColor = chipHighlightModel.onHoveredBackgroundColor,
        horizontalArrangement =
            Arrangement.spacedBy(DesktopStatusBar.Dimensions.ChipInternalSpacing, Alignment.Start),
    ) {
@@ -213,15 +215,6 @@ private fun QuickSettingsChip(
            }
        } else {
            val localContext = LocalContext.current
            val themedContext = ContextThemeWrapper(localContext, R.style.Theme_SystemUI)
            val foregroundColor =
                Utils.getColorAttrDefaultColor(themedContext, android.R.attr.textColorPrimary)
            val backgroundColor =
                Utils.getColorAttrDefaultColor(
                    themedContext,
                    android.R.attr.textColorPrimaryInverse,
                )

            val iconContainer =
                remember(localContext, iconManagerFactory) {
                    StatusIconContainer(
@@ -234,13 +227,17 @@ private fun QuickSettingsChip(
                    iconManagerFactory.create(iconContainer, StatusBarLocation.HOME)
                }

            WithAdaptiveTint(
                isHighlighted = viewModel.isQuickSettingsChipHighlighted,
                isDarkProvider = { bounds -> viewModel.areaDark.isDarkTheme(bounds) },
            ) { tint ->
                SystemStatusIconsLegacy(
                    statusBarIconController = statusBarIconController,
                    iconContainer = iconContainer,
                    iconManager = iconManager,
                    useExpandedFormat = true,
                foregroundColor = foregroundColor,
                backgroundColor = backgroundColor,
                    foregroundColor = tint.toArgb(),
                    backgroundColor = ChipHighlightModel.Strong.backgroundColor.toArgb(),
                    isSingleCarrier = true,
                    isMicCameraIndicationEnabled = true,
                    isPrivacyChipEnabled = true,
@@ -248,6 +245,7 @@ private fun QuickSettingsChip(
                    isLocationIndicationEnabled = true,
                )
            }
        }

        val batteryHeight =
            with(LocalDensity.current) {