Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.semantics.heading
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -196,7 +198,10 @@ fun SmallTopAppBarExample() {
titleContentColor = MaterialTheme.colorScheme.primary,
),
title = {
Text("Small Top App Bar")
Text(
"Small Top App Bar",
modifier = Modifier.semantics { heading() },
)
}
)
},
Expand Down Expand Up @@ -226,7 +231,8 @@ fun CenterAlignedTopAppBarExample() {
Text(
"Centered Top App Bar",
maxLines = 1,
overflow = TextOverflow.Ellipsis
overflow = TextOverflow.Ellipsis,
modifier = Modifier.semantics { heading() },
)
},
navigationIcon = {
Expand Down Expand Up @@ -273,7 +279,8 @@ fun MediumTopAppBarExample() {
Text(
"Medium Top App Bar",
maxLines = 1,
overflow = TextOverflow.Ellipsis
overflow = TextOverflow.Ellipsis,
modifier = Modifier.semantics { heading() },
)
},
navigationIcon = {
Expand Down Expand Up @@ -320,7 +327,8 @@ fun LargeTopAppBarExample() {
Text(
"Large Top App Bar",
maxLines = 1,
overflow = TextOverflow.Ellipsis
overflow = TextOverflow.Ellipsis,
modifier = Modifier.semantics { heading() },
)
},
navigationIcon = {
Expand Down Expand Up @@ -360,6 +368,7 @@ fun TopBarNavigationExample(
title = {
Text(
"Navigation example",
modifier = Modifier.semantics { heading() },
)
},
navigationIcon = {
Expand Down Expand Up @@ -413,7 +422,10 @@ fun AppBarSelectionActions(

TopAppBar(
title = {
Text(topBarText)
Text(
topBarText,
modifier = Modifier.semantics { heading() },
)
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = MaterialTheme.colorScheme.primaryContainer,
Expand Down