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

Bind viewModel to composable lifecycle #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AntonMishanin
Copy link

Create a viewModelStore for each screen
When you click on back button, viewModelStore of this screen cleans their viewModels
It's works for version 0.6.4

But now it doesn't work - your click on back button - viewModel cleared and right away viewModel is creating again.
If you delete content: RendererContent value when you create ComposeRenderImpl in AppActivity and will use defaultRendererContent - it works good
I think we have a problem with content: RendererContent implementation

ScreenTransition( transitionSpec = { if (transitionType == ScreenTransitionType.Replace) { scaleIn(initialScale = 2f) + fadeIn() with fadeOut() } else { val (initialOffset, targetOffset) = when (transitionType) { ScreenTransitionType.Pop -> ({ size: Int -> -size }) to ({ size: Int -> size }) else -> ({ size: Int -> size }) to ({ size: Int -> -size }) } slideInHorizontally(initialOffsetX = initialOffset) with slideOutHorizontally(targetOffsetX = targetOffset) } } )

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.

None yet

1 participant