voyager icon indicating copy to clipboard operation
voyager copied to clipboard

Layout Inspector and Live Edit are not working

Open nvkleban opened this issue 10 months ago • 2 comments

Layout Inspector and Live Edit are not working properly. After I enable any of them l see an initial screen that I put into navigator constructor ( BlankScreen in my case) not the restored screen stack. But somehow it goes back to normal after I enable "Don't keep activities"

It's easier to test with Layout Inspector.

MainActivity looks like this:

class MainActivity : ComponentActivity() {

    private val viewModel: MainActivityViewModel by viewModels()

    @Inject
    lateinit var compositionLocalsProviders: Set<@JvmSuppressWildcards ProvidedValue<*>>

    override fun onCreate(savedInstanceState: Bundle?) {
        installSplashScreen().setKeepOnScreenCondition { viewModel.uiState.showSplashScreen }
        super.onCreate(savedInstanceState)

        setContent {
            CompositionLocalProvider(*compositionLocalsProviders.toTypedArray()) {
                Navigator(
                    BlankScreen(),
                    disposeBehavior = NavigatorDisposeBehavior(disposeNestedNavigators = false),
                ) { navigator ->
                    MainContentContainer(navigator) {
                        CurrentScreen()
                    }
                }
            }
        }
    }
}

nvkleban avatar Apr 17 '24 17:04 nvkleban

And I've checked - by default enabling Layout Inspector does not recreate the activity. So probably it somehow related to the fact that screens stack is also not restored properly.

nvkleban avatar Apr 17 '24 18:04 nvkleban

the same problem with live edit :( this behaviour renders live edit useless. Is any chance to fix it?

rovkinmax avatar Jul 26 '24 07:07 rovkinmax