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

Commit 92403a1e authored by Jeffrey Young's avatar Jeffrey Young Committed by Android (Google) Code Review
Browse files

Merge "Set clock and date color in ShadeHeader" into main

parents a2281319 16c25962
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.CubicBezierEasing
import androidx.compose.animation.core.tween
import androidx.compose.foundation.clickable
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@@ -72,7 +73,6 @@ import com.android.compose.animation.scene.ValueKey
import com.android.compose.animation.scene.animateElementFloatAsState
import com.android.compose.animation.scene.content.state.TransitionState
import com.android.compose.modifiers.thenIf
import com.android.compose.theme.colorAttr
import com.android.internal.policy.SystemBarUtils
import com.android.settingslib.Utils
import com.android.systemui.battery.BatteryMeterView
@@ -212,6 +212,8 @@ fun ContentScope.CollapsedShadeHeader(
            }
        }

    val textColor = if (isSystemInDarkTheme()) Color.White else Color.Black

    // This layout assumes it is globally positioned at (0, 0) and is the same size as the screen.
    CutoutAwareShadeHeader(
        modifier = modifier.sysuiResTag(ShadeHeader.TestTags.Root),
@@ -221,11 +223,11 @@ fun ContentScope.CollapsedShadeHeader(
                horizontalArrangement = Arrangement.spacedBy(5.dp),
                modifier = Modifier.padding(horizontal = horizontalPadding),
            ) {
                Clock(onClick = viewModel::onClockClicked)
                Clock(onClick = viewModel::onClockClicked, textColor = textColor)
                VariableDayDate(
                    longerDateText = viewModel.longerDateText,
                    shorterDateText = viewModel.shorterDateText,
                    textColor = colorAttr(android.R.attr.textColorPrimary),
                    textColor = textColor,
                    modifier = Modifier.element(ShadeHeader.Elements.CollapsedContentStart),
                )
            }
@@ -271,7 +273,7 @@ fun ContentScope.CollapsedShadeHeader(
                            showIcon = true,
                            useExpandedFormat = useExpandedTextFormat,
                            modifier = Modifier.padding(vertical = 8.dp),
                            textColor = Color.White, // Single shade is always in Dark theme
                            textColor = textColor,
                        )
                    }
                }
@@ -311,6 +313,7 @@ fun ContentScope.ExpandedShadeHeader(
                    onClick = viewModel::onClockClicked,
                    modifier = Modifier.align(Alignment.CenterStart),
                    scale = 2.57f,
                    textColor = MaterialTheme.colorScheme.onSurface,
                )
                Box(
                    modifier =
@@ -330,7 +333,7 @@ fun ContentScope.ExpandedShadeHeader(
                VariableDayDate(
                    longerDateText = viewModel.longerDateText,
                    shorterDateText = viewModel.shorterDateText,
                    textColor = colorAttr(android.R.attr.textColorPrimary),
                    textColor = MaterialTheme.colorScheme.onSurface,
                    modifier = Modifier.widthIn(max = 90.dp),
                )
                ShadeHighlightChip {
@@ -347,7 +350,7 @@ fun ContentScope.ExpandedShadeHeader(
                        viewModel = viewModel,
                        showIcon = true,
                        useExpandedFormat = useExpandedFormat,
                        textColor = Color.White, // Single shade is always in Dark theme
                        textColor = MaterialTheme.colorScheme.onSurface,
                    )
                }
            }