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

Commit 81141a45 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Set FontWeight.ExtraBold for bundle header title" into main

parents 6419901d 30be1d8a
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -43,12 +43,14 @@ import androidx.compose.ui.graphics.CompositingStrategy
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.Layout
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.constrainHeight
@@ -197,9 +199,17 @@ private fun ContentScope.BundleHeaderContent(
                    // Has to be a shared element because we may have a semi-transparent background
                    .element(NotificationRowPrimitives.Elements.NotificationIconBackground),
        )

        // Set FontWeight.ExtraBold if bold text adjustment is enabled
        // because titleMediumEmphasized is already bold
        val config = LocalConfiguration.current
        val isBoldTextEnabled = config.fontWeightAdjustment > 0
        Text(
            text = stringResource(viewModel.titleText),
            style = MaterialTheme.typography.titleMediumEmphasized,
            style =
                MaterialTheme.typography.titleMediumEmphasized.copy(
                    fontWeight = if (isBoldTextEnabled) FontWeight.ExtraBold else FontWeight.Bold
                ),
            color = MaterialTheme.colorScheme.primary,
            overflow = TextOverflow.Ellipsis,
            maxLines = 1,