feat: DCMAW-17333 create left aligned screen v3#396
Conversation
8dabcad to
135eca4
Compare
|
|
❌ The last analysis has failed. |
| fun LeftAlignedScreenV3( | ||
| title: @Composable (horizontalPadding: Dp) -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| body: @Composable ((horizontalItemPadding: Dp) -> Unit)? = null, |
There was a problem hiding this comment.
I'm concerned about removing the lazy-list performance optimisation. The reason being, this pattern needs to work performantly with long screens potentially with lots of images (example of a longer style screen).
Did we look into other ways to achieve this using Modifier.semantics configuration?
Also, taking a step back, are we sure we don't want the default talkback 'in-list' announcements that we get with the lazy list? In other areas (e.g. screen reader pronounciation) we prefer the defaults even though they seem unintuitive.
There was a problem hiding this comment.
The 'in-list' announcements are supposed to be for user facing lists, where they make sense, and less for areas where we have just used lazy-lists for other reasons (performance, convenience, etc).
I would argue that our accessibility requirements out-weigh the performance requirements, but I guess a compromise would be a variation on the LeftAlignedScreen instead of a complete replacement deprecating the old version?
My understanding is that the performance increases for using lazy-list is generally beneficial for things where the numbers enter the hundreds and / or have perpetual scrolling, and not a finite number making the screen long, but I could be wrong. In XML I definitely would have used a RecyclerView, but we had more control over the accessibility stuff.
There was a problem hiding this comment.
Yeah, the lazy scrolling is essential when there are hundreds of items or endless scroll. Up until now LeftAlignedScreen doesn't need to cope with that.
Having said that, the Compose Lists docs mention that Column is for use cases that don't require any scrolling and that we should consider using lazy lists in situations where we have an unknown number of items.
If we were to stick with lazy for any scrolling content, we know that we're doing the best we can to support cheaper, low powered devices with small screens (which is also an accessibility/inclusion concern).
Before we commit to an approach - do you mind if we see if there's anything we can do using the semantics config?
I discovered there's a CollectionInfo semantics property that lets us set the number of items in lists. In my testing I set rowCount to 0 and that seems to remove all the list announcements.
LazyColumn(
modifier = Modifier.semantics {
collectionInfo = CollectionInfo(rowCount = 0, columnCount = 0)
}
) { ... }If that works, maybe we can satisfy both performance and accessibility?
There was a problem hiding this comment.
Edited: for this to work, rowCount needs to be 0, not -1
There was a problem hiding this comment.
If collectionInfo is satisfying all new a11y requirements for wallet, yes - it's preferred and simpler change. Otherwise, we might have 2 versions of layout: one based on simple column, second on lazy column. (LeftAlignedScreenV3 and LazyLeftAlignedScreenV3?)
There was a problem hiding this comment.
I've tested with LeftAlignedScreen and
LazyColumn(
modifier = Modifier.semantics {
collectionInfo = CollectionInfo(rowCount = 0, columnCount = 0)
}
) { ... }
Result: in list is still announced, the same to @JacksonJ2W results.
There was a problem hiding this comment.
I've just tried making the change in LeftAlignedScreen and tested (with rowCount = 0) and it seems to work:
Before
Screen_recording_20260223_152647.webm
After
Screen_recording_20260223_153400.webm
There was a problem hiding this comment.
Oh yes you're totally right, setting to 0 instead of -1 does work, sorry I misread your message earlier.
This would save a lot of time! Thanks @jonnyandrew
There was a problem hiding this comment.
@JacksonJ2W @jonnyandrew I've tested with a new LazyColumn and collectionInfo configured with zeroes -> there is no extra in list.
There was a problem hiding this comment.
Sorry, I'd originally written -1 before editing it. Sorry about that confusion!
|
Closing as setting collection info to "0" instead of "-1" achieves the talkback behaviour without sacrificing |



DCMAW-17333: create Left Aligned Screen v3
Ticket
LazyColumntoColumnitemwrapping over elements that are only compatible withLazyColumnEvidence of the change
Note: this evidence is applied to the Wallet
DocumentInformationScreenbut these changes are just here to highlight behaviour, and are not production changes17333Defect.mp4
17333Fix.mp4
17333EvidenceDoesntBreakScrollingCompressed.mp4
Checklist
Before creating the pull request
draftpull request if it's not ready for review.Before the CODEOWNERS review the pull request
Before merging the pull request