Skip to content

Commit

Permalink
chore/drop emphasis (#1277)
Browse files Browse the repository at this point in the history
* Window size class for position of chip

* Drop emphasis on text

---------

Co-authored-by: Ashley Davies <[email protected]>
  • Loading branch information
ashdavies and ashdavies authored Oct 28, 2024
1 parent f9f5cb9 commit 4552937
Showing 1 changed file with 4 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ internal fun EventsScreen(

items(itemCount) { index ->
EventSection(
emphasis = when (index) {
0 -> TextEmphasis.Significant
1 -> TextEmphasis.Moderate
else -> TextEmphasis.Standard
},
modifier = Modifier.animateItem(),
event = state.pagingItems.getOrNull(index),
)
Expand All @@ -124,17 +119,10 @@ private fun <T : Any> LazyPagingItems<T>.getOrNull(index: Int): T? {
return if (index < itemCount) get(index) else null
}

private enum class TextEmphasis {
Significant,
Moderate,
Standard,
}

@Composable
@ExperimentalMaterialApi
private fun EventSection(
event: Event?,
emphasis: TextEmphasis,
modifier: Modifier = Modifier,
windowClassSize: WindowSizeClass = LocalWindowSizeClass.current,
) {
Expand Down Expand Up @@ -167,11 +155,8 @@ private fun EventSection(
Row {
PlaceholderText(
text = event?.name,
style = when (emphasis) {
TextEmphasis.Significant -> MaterialTheme.typography.headlineLarge
TextEmphasis.Moderate -> MaterialTheme.typography.headlineMedium
TextEmphasis.Standard -> MaterialTheme.typography.headlineSmall
},
style = MaterialTheme.typography.headlineSmall,

)

if (windowClassSize.widthSizeClass == WindowWidthSizeClass.Expanded) {
Expand All @@ -186,11 +171,8 @@ private fun EventSection(
PlaceholderText(
text = event?.location,
modifier = Modifier.align(Alignment.Start),
style = when (emphasis) {
TextEmphasis.Significant -> MaterialTheme.typography.titleLarge
TextEmphasis.Moderate -> MaterialTheme.typography.titleMedium
TextEmphasis.Standard -> MaterialTheme.typography.titleSmall
},
style = MaterialTheme.typography.titleSmall,

)

if (windowClassSize.widthSizeClass == WindowWidthSizeClass.Compact) {
Expand Down

0 comments on commit 4552937

Please sign in to comment.