-
- All Implemented Interfaces:
-
autodispose2.ScopeProvider,autodispose2.lifecycle.LifecycleScopeProvider
public final class AndroidLifecycleScopeProvider implements LifecycleScopeProvider<Lifecycle.Event>
A LifecycleScopeProvider that can provide scoping for Android Lifecycle and LifecycleOwner classes.
AutoDispose.autoDisposable(AndroidLifecycleScopeProvider.from(lifecycleOwner))
-
-
Method Summary
-
-
Method Detail
-
from
static AndroidLifecycleScopeProvider from(LifecycleOwner owner)
Creates a AndroidLifecycleScopeProvider for Android LifecycleOwners.
- Parameters:
owner- the owner to scope for.
-
from
static AndroidLifecycleScopeProvider from(LifecycleOwner owner, Lifecycle.Event untilEvent)
Creates a AndroidLifecycleScopeProvider for Android LifecycleOwners.
- Parameters:
owner- the owner to scope for.untilEvent- the event until the scope is valid.
-
from
static AndroidLifecycleScopeProvider from(Lifecycle lifecycle)
Creates a AndroidLifecycleScopeProvider for Android Lifecycles.
- Parameters:
lifecycle- the lifecycle to scope for.
-
from
static AndroidLifecycleScopeProvider from(Lifecycle lifecycle, Lifecycle.Event untilEvent)
Creates a AndroidLifecycleScopeProvider for Android Lifecycles.
- Parameters:
lifecycle- the lifecycle to scope for.untilEvent- the event until the scope is valid.
-
from
static AndroidLifecycleScopeProvider from(LifecycleOwner owner, CorrespondingEventsFunction<Lifecycle.Event> boundaryResolver)
Creates a AndroidLifecycleScopeProvider for Android Lifecycles.
- Parameters:
owner- the owner to scope for.boundaryResolver- function that resolves the event boundary.
-
from
static AndroidLifecycleScopeProvider from(Lifecycle lifecycle, CorrespondingEventsFunction<Lifecycle.Event> boundaryResolver)
Creates a AndroidLifecycleScopeProvider for Android Lifecycles.
- Parameters:
lifecycle- the lifecycle to scope for.boundaryResolver- function that resolves the event boundary.
-
lifecycle
Observable<Lifecycle.Event> lifecycle()
-
correspondingEvents
CorrespondingEventsFunction<Lifecycle.Event> correspondingEvents()
-
peekLifecycle
Lifecycle.Event peekLifecycle()
-
requestScope
CompletableSource requestScope()
-
-
-
-