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 demo scope provider for Activity #36

Closed
tonycosentini opened this issue Feb 8, 2017 · 7 comments · Fixed by #71
Closed

Add demo scope provider for Activity #36

tonycosentini opened this issue Feb 8, 2017 · 7 comments · Fixed by #71

Comments

@tonycosentini
Copy link
Contributor

No description provided.

@ZacSweers
Copy link
Collaborator

I think we should provide some examples of how to hook one up, but I don't think we should ship something first party. Especially with support library variants out there, kind of makes a mess and most people just implement it in their own base classes I think. Can revisit if Android APIs improve in the future for external observation.

@ZacSweers ZacSweers changed the title Add scope provider for Activity Add demo scope provider for Activity Mar 2, 2017
@tadfisher
Copy link

Activities have ActivityLifecycleCallbacks.

@ZacSweers
Copy link
Collaborator

True, but we can't query the current state of the activity for lifecycle resolution :/. Most we could do would basically be to dispose on destroy, but wouldn't be able to tell if we're already after the lifecycle

@tadfisher
Copy link

Do you need to query the current state of the activity? You should get all edges of the state machine in the callbacks instance, and infer state from that. Unless there are edge cases I'm not thinking of.

@ZacSweers
Copy link
Collaborator

Say you subscribe after onDestroy, how would you know since no callbacks would ever fire?

@microstudent
Copy link

I think some code in Glide do the similar things.
ManagerRetriever.java#319
It attach a Invisible fragment to activity or fragment, as it can receive the lifecycle callback form them.

@ZacSweers
Copy link
Collaborator

You can get callbacks, but you can't query the current state right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants