Skip to content

Commit

Permalink
Add semantics for create baselineProfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hiraok committed Sep 24, 2022
1 parent 4c85d08 commit 015f7ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import io.github.droidkaigi.confsched2022.designsystem.theme.montserratFonts
import io.github.droidkaigi.confsched2022.model.DroidKaigi2022Day
import io.github.droidkaigi.confsched2022.model.DroidKaigi2022Day.Day2

@Composable
internal fun SessionDayTab(
Expand All @@ -38,7 +41,11 @@ internal fun SessionDayTab(
Tab(
selected = selected,
onClick = { onTabClicked(index) },
modifier = Modifier.height(height).padding(end = 8.dp).clip(CircleShape)
modifier = Modifier.height(height).padding(end = 8.dp).clip(CircleShape).semantics {
if (day == Day2) {
testTag = "sessionDayTab"
}
}
) {
Column(
modifier = Modifier.fillMaxSize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalLayoutDirection
Expand All @@ -53,6 +54,7 @@ import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.customActions
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.semantics.testTagsAsResourceId
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
Expand Down Expand Up @@ -395,7 +397,7 @@ fun SessionsList(

data class DurationTime(val startAt: String, val endAt: String)

@OptIn(ExperimentalPagerApi::class)
@OptIn(ExperimentalPagerApi::class, ExperimentalComposeUiApi::class)
@Composable
fun SessionsTopBar(
pagerContentsScrollState: PagerContentsScrollState,
Expand Down Expand Up @@ -466,7 +468,7 @@ fun SessionsTopBar(
.padding(16.dp)
.windowInsetsPadding(
WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal)
),
).semantics { testTagsAsResourceId = true },
containerColor = MaterialTheme.colorScheme
.surfaceColorAtElevation(2.dp),
indicator = {
Expand Down

0 comments on commit 015f7ac

Please sign in to comment.