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

Layout Inspector and Live Edit are not working #393

Open
nvkleban opened this issue Apr 17, 2024 · 1 comment
Open

Layout Inspector and Live Edit are not working #393

nvkleban opened this issue Apr 17, 2024 · 1 comment

Comments

@nvkleban
Copy link
Contributor

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
Copy link
Contributor Author

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.

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

No branches or pull requests

1 participant