Skip to content
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

Add lifecycle parameter to AmbientAware #2481

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

yschimke
Copy link
Collaborator

@yschimke yschimke commented Dec 9, 2024

WHAT

This change adds an optional lifecycle parameter to the AmbientAware composable function, allowing developers to specify a custom lifecycle instead of relying on the LocalLifecycleOwner.

This provides more flexibility when using AmbientAware in different contexts, such as within individual screens in navigation routes. If not specified, it defaults to the current LocalLifecycleOwner's lifecycle.

WHY

HOW

Checklist 📋

  • Add explicit visibility modifier and explicit return types for public declarations
  • Run spotless check
  • Run tests
  • Update metalava's signature text files

@yschimke yschimke requested a review from kul3r4 December 9, 2024 13:48
@yschimke yschimke closed this Dec 9, 2024
@yschimke yschimke reopened this Dec 9, 2024
@yschimke yschimke closed this Dec 9, 2024
@yschimke yschimke reopened this Dec 9, 2024
Copy link
Collaborator

@kul3r4 kul3r4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we backport those to latest stable version of Horologist?

@yschimke yschimke merged commit 4cceb8d into google:main Dec 9, 2024
6 checks passed
yschimke added a commit to yschimke/horologist that referenced this pull request Dec 10, 2024
---------

Co-authored-by: yschimke <[email protected]>
(cherry picked from commit 4cceb8d)
yschimke added a commit that referenced this pull request Dec 10, 2024
* Add lifecycle parameter to AmbientAware (#2481)

---------

Co-authored-by: yschimke <[email protected]>
(cherry picked from commit 4cceb8d)

* Cherry pick #2476

Ceil padding to 1px

* Update ScalingLazyColumnDefaults.kt

* 🤖 Updates screenshots

---------

Co-authored-by: yschimke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants