I've made this component using SubcomposeLayout. H...
# compose
d
I've made this component using SubcomposeLayout. How would I implement a good talkback experience for it? By default it iterates left to right on each row, but top to bottom on each column and then right would be better, and reading out a whole column at a time would be even better. I see that the semantics docs uses a calendar as example but does not give any further guidance on how to properly implement semantics for such complex composables.
j
You can use
CollectionInfo
&
CollectionItemInfo
:
Copy code
Modifier.semantics {
    collectionInfo = CollectionInfo(
        rowCount = list.size,
        columnCount = 1
    )
Copy code
.semantics {
    collectionItemInfo = CollectionItemInfo(
        rowIndex = index,
        rowSpan = 1,
        columnIndex = 0,
        columnSpan = 1
    )
}
https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/CollectionInfo https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/CollectionItemInfo Apart from that, there is apparently not much you can customise.
d
Ooo, thank you, I didn't know about that, will check it out!