Skip to content

Commit

Permalink
Merge pull request #579 from KovalevAndrey/2.x-expose-android-lifecycle
Browse files Browse the repository at this point in the history
Expose AndroidLifecycle for Android targets + create a helper function
  • Loading branch information
KovalevAndrey authored Sep 1, 2023
2 parents aef36c2 + 0b0381b commit 69299f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Pending changes

-
### Fixed

- [#579](https://github.com/bumble-tech/appyx/pull/579) – Expose AndroidLifecycle in PlatformLifecycleRegistry for Android

## 2.0.0-alpha04

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.bumble.appyx.navigation.node

import com.bumble.appyx.navigation.platform.PlatformLifecycleRegistry

val Node.androidLifecycle: androidx.lifecycle.Lifecycle
get() = (lifecycle as PlatformLifecycleRegistry).androidLifecycleRegistry
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ actual class PlatformLifecycleRegistry(
androidx.lifecycle.LifecycleEventObserver {

private var lifecycleOwner: LifecycleOwner? = androidOwner
private val androidLifecycleRegistry = LifecycleRegistry(androidOwner)
val androidLifecycleRegistry = LifecycleRegistry(androidOwner)

private val managedDefaultLifecycleObservers: MutableList<DefaultPlatformLifecycleObserver> =
ArrayList()
Expand Down

0 comments on commit 69299f9

Please sign in to comment.