adeo-opensource / kviewmodel--mpp

Library to sharing view model
Apache License 2.0
48 stars 4 forks source link

Screen Rotation Handling #21

Open lordsxrom opened 1 year ago

lordsxrom commented 1 year ago

Could you explain how a ViewModel can survive screen rotation please?

Does it could help me? LocalRootController.current.setupWithViewModels()

Skeptick commented 1 year ago

Hello. To handle screen rotation you need to save viewmodel when changing configuration, which requires integration with navigation (to receive a callback on the screen close event and delete saved viewmodel). At the moment the library only supports navigation with Odyssey, in a separate kviewmodel-odyssey artifact