Status Update
Comments
so...@google.com <so...@google.com> #3
After some brief poking around:
Relevant code in LayoutNode:
Ends up here:
If accessibility is off, looks like changing progress semantics a no op which would be a big improvement to performance.
Otherwise semantics does a remeasure / relayout, and walks the full semantics tree. This would likely have no immediate benefit if accessibility is turned on.
ma...@google.com <ma...@google.com>
ap...@google.com <ap...@google.com> #4
Would this suggestion also avoid recomposing, which seems like it would still be a problem even if it's a no-op in the guts of semantic node code.
co...@google.com <co...@google.com> #5
Indeed we could change the progressSemantics
API to be lambda-based like ScrollAxisRange, but I'm reluctant to add to our API for this. A number of properties are likely getting updated at high frequency by some application or other. Each one will add API clutter and add to the number of decisions developers have to make to optimize performance.
The semantics block is already a lambda, so we have been talking about being able to make it run separately from composition when one of its inputs changes, much like layout. Ralston is already starting to work on a performance-oriented rearchitecture to semantics and we can discuss how this might fit into that plan.
co...@google.com <co...@google.com> #6
The semantics block is already executed outside of composition. That change was made and landed in 1.5.
We honestly don't have to create a new API for this. Modifier.progressSemantics is just a convenience API around the already public progressBarRangeInfo API. Material3 could easily just use a plain Modifier.semantics call with the value resolved inside the lambda and this semantics property set and it would avoid composition and fix this issue.
ap...@google.com <ap...@google.com> #7
+1 to Leland's approach. That is aligned with my thinking here.
Description
Currently in aosp/1810198 suggests interface with new methods instead of adding this methods to TextFieldColors interface (because of b/198571248 ). Move these methods to TextFieldColors and deprecate
when it'll be possible