Skip to content

Commit

Permalink
[DON-891] add annotated string to calendar day (#2158)
Browse files Browse the repository at this point in the history
* [DON-891] add annotated string to calendar day

* [DON-891] update string

* [DON-891] remove undesire changes

* Updated snapshots

* [DON-891] update test tag

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
peterInTown and github-actions[bot] authored Nov 29, 2024
1 parent 71e45fb commit 15f463c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/ktlint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ import androidx.compose.foundation.shape.CircleShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.selected
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.stateDescription
import androidx.compose.ui.semantics.testTagsAsResourceId
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
Expand All @@ -58,6 +61,7 @@ import net.skyscanner.backpack.compose.theme.BpkTheme
import net.skyscanner.backpack.compose.tokens.BpkSpacing
import net.skyscanner.backpack.compose.utils.RelativeRectangleShape

@OptIn(ExperimentalComposeUiApi::class)
@Composable
internal fun BpkCalendarDayCell(
model: CalendarCell.Day,
Expand All @@ -81,7 +85,9 @@ internal fun BpkCalendarDayCell(
onClickLabel = model.onClickLabel,
interactionSource = remember { MutableInteractionSource() },
)
.testTag(if (inactive) "inactive" else "active")
.semantics {
testTagsAsResourceId = true
if (model.stateDescription != null) {
stateDescription = model.stateDescription!!
} else {
Expand Down

0 comments on commit 15f463c

Please sign in to comment.