[Styles API] Refactor the Styles API
This change refactors the experimental Styles API into two independent pieces: the Styles DSL and the modifiers that are configured by the DSL. Follow-up CLs will deprecate the previous API and remove it before the Styles API becomes stable. Relnote: """ This change refactors the Styles API into two independent pieces: the Styles DSL and the modifiers that are configured by the DSL. The previous `Style`-based implementation was re-implemented on the new system. Existing uses of `styleable` and `Style` should move to the new API as `Style` and `styleable` will be deprecated and removed. Key components introduced: - `CustomStyle` & `CommonStyle`: Base interfaces and merging helpers for declaring composable styles. - `StyleResolver`: Resolves style properties in composition and binds to layout nodes via `Modifier.styleResolver`. - Modifier scopes: `Modifier.appearance`, `Modifier.placement`, and dynamic callback-based `Modifier.padding` and `Modifier.graphicsLayer`. - Property primitives: `stylePropertyOf`, `styleLocalOf`. - Types useful for style properties: `Breadth`, `Fill`, and `Shadows`. The new modifiers are useful for implementing a design system using the Styles API but are not required. A design system may use these modifiers or provide its own. """ Fixes: 549921960 Test: ./gradlew :compose:foundation:foundation:test :compose:foundation:foundation:connectedAndroidTest Change-Id: Ie7d3f42ebb556d60fa7aef061699801cdf5faf19
C
Chuck Jazdzewski committed
ce642ab0a2efaf0f0483d032273f4b34fff2c535
Parent: 876ed71