Skip to content

Bind viewModel to composable lifecycle#19

Closed
AntonMishanin wants to merge 1 commit intoikarenkov:masterfrom
AntonMishanin:feature/bind-viewmodel-to-composable-lifecycle
Closed

Bind viewModel to composable lifecycle#19
AntonMishanin wants to merge 1 commit intoikarenkov:masterfrom
AntonMishanin:feature/bind-viewmodel-to-composable-lifecycle

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) } } )

@ikarenkov ikarenkov deleted the branch ikarenkov:master January 27, 2026 05:54
@ikarenkov ikarenkov closed this Jan 27, 2026
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.

2 participants