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

Implement SavedStateHandle in a working manner #96

Merged
merged 4 commits into from
Mar 10, 2023

Conversation

Syer10
Copy link
Contributor

@Syer10 Syer10 commented Nov 24, 2022

Closes #99
SavedStateHandle support didn't work since the outstate was always null or never got saved outside the screen lifecycle owner. I found a way to test SavedStateHandle to get it working how its meant to be used.

  1. Put the app in the background for a few seconds, at least until the activity hits the stop state
  2. Use the (old) android studio logcat's menu to use its unique terminate app button
  3. When starting up the app should try to return to its old state with SavedStateHandles and everything

Whats left to do for Android lifecycle integration(will happen in other PRs):

  • Attach the lifecycle to the parent lifecycle, so if the activity hits onStop, the ScreenLifecycle will as well

(cherry picked from commit ee57b4e)

# Conflicts:
#	voyager-androidx/src/main/java/cafe/adriel/voyager/androidx/AndroidScreenLifecycleOwner.kt
@MasterBin
Copy link

@adrielcafe Any plans to merge this?

@zakrodionov
Copy link

@adrielcafe Hello! It would be nice to fix it :)

@Syer10
Copy link
Contributor Author

Syer10 commented Dec 11, 2022

No need to spam him, if you need it so bad you can use my fork https://github.com/Syer10/voyager

@DevSrSouza DevSrSouza merged commit 71e9add into adrielcafe:main Mar 10, 2023
@Syer10 Syer10 deleted the saved_statte_handle branch March 11, 2023 00:25
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.

SavedStateHandle doesn't work
4 participants