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

Commit e9768cd1 authored by Shawn Lee's avatar Shawn Lee
Browse files

[flexiglass] Fix Shade Header element colors in light theme

Bug: 322373411
Test: manual
Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Change-Id: Ib349b8203ceaef826a62e18f7e8af92c967f4f5a
parent 2f1213a1
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.material3.ColorScheme
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
@@ -40,6 +41,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.TransformOrigin
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.layout.Layout
@@ -97,6 +99,11 @@ object ShadeHeader {
        val CollapsedHeight = 48.dp
        val ExpandedHeight = 120.dp
    }

    object Colors {
        val ColorScheme.shadeHeaderText: Color
            get() = Color.White
    }
}

@Composable
@@ -325,7 +332,10 @@ private fun SceneScope.Clock(
        val animatedScale by animateElementFloatAsState(scale, ClockScale, canOverflow = false)
        AndroidView(
            factory = { context ->
                Clock(ContextThemeWrapper(context, R.style.TextAppearance_QS_Status), null)
                Clock(
                    ContextThemeWrapper(context, R.style.Theme_SystemUI_QuickSettings_Header),
                    null,
                )
            },
            modifier =
                modifier
@@ -430,11 +440,16 @@ private fun SceneScope.StatusIcons(

    AndroidView(
        factory = { context ->
            val iconContainer = StatusIconContainer(context, null)
            val themedContext =
                ContextThemeWrapper(context, R.style.Theme_SystemUI_QuickSettings_Header)
            val iconContainer = StatusIconContainer(themedContext, null)
            val iconManager = createTintedIconManager(iconContainer, StatusBarLocation.QS)
            iconManager.setTint(
                Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary),
                Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimaryInverse),
                Utils.getColorAttrDefaultColor(themedContext, android.R.attr.textColorPrimary),
                Utils.getColorAttrDefaultColor(
                    themedContext,
                    android.R.attr.textColorPrimaryInverse
                ),
            )
            statusBarIconController.addIconGroup(iconManager)

+5 −5
Original line number Diff line number Diff line
@@ -4,9 +4,9 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.Layout
import com.android.systemui.shade.ui.composable.ShadeHeader.Colors.shadeHeaderText
import com.android.systemui.shade.ui.viewmodel.ShadeHeaderViewModel

@Composable
@@ -23,16 +23,16 @@ fun VariableDayDate(
                {
                    Text(
                        text = longerText.value,
                        style = MaterialTheme.typography.titleSmall,
                        color = MaterialTheme.colorScheme.onBackground,
                        style = MaterialTheme.typography.bodyMedium,
                        color = MaterialTheme.colorScheme.shadeHeaderText,
                        maxLines = 1,
                    )
                },
                {
                    Text(
                        text = shorterText.value,
                        style = MaterialTheme.typography.titleSmall,
                        color = MaterialTheme.colorScheme.onBackground,
                        style = MaterialTheme.typography.bodyMedium,
                        color = MaterialTheme.colorScheme.shadeHeaderText,
                        maxLines = 1,
                    )
                },