Skip to content

Add support for LazyItemScope scoped modifiers #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dfabulich
Copy link
Contributor

The ComposeContext now tracks an additional variable, scope, which users can use in ComposeView or ComposeModifierView to access scoped modifiers. https://developer.android.com/develop/ui/compose/modifiers#scope-safety

I've also added a new variant of .composeModifier(scope:) that allows users to declare a class to which their (Modifier) -> Modifier function will be scoped, making it easy to access modifiers scoped to that class.

Finally, I've set the scope variable in LazyHStack, LazyVStack, LazyHGrid, and LazyVGrid. There are probably a lot more places where this could be set.

Thank you for contributing to the Skip project! Please use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

The `ComposeContext` now tracks an additional variable, `scope`, which users can use in `ComposeView` or `ComposeModifierView` to access scoped modifiers. https://developer.android.com/develop/ui/compose/modifiers#scope-safety

I've also added a new variant of `.composeModifier(scope:)` that allows users to declare a class to which their `(Modifier) -> Modifier` function will be scoped, making it easy to access modifiers scoped to that class.

Finally, I've set the `scope` variable in `LazyHStack`, `LazyVStack`, `LazyHGrid`, and `LazyVGrid`. There are probably a lot more places where this could be set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant