Jetpack Compose Navigation dialog configuration

Viewed 268

I have a NavHost that looks something like this:

NavHost(
    navController = navController,
    startDestination = Screen.MAIN.route,
    modifier = modifier
) {
    dialog(
        Screen.LOGIN.route,
        dialogProperties = DialogProperties(
            usePlatformDefaultWidth = false,
            dismissOnBackPress = false,
            dismissOnClickOutside = false
        )
    ) { LoginScreen() }
    composable(Screen.MAIN.route) { MainScreen() }
}

For composable screen I can configure my MainActivity's windowSoftInputMode to adjustResize as well as other parameters like:

WindowCompat.setDecorFitsSystemWindows(window, false) 

But I can't seem to find a way to configure the way my dialog is displayed. It seems to use adjustPan functionality, as I can see, that when keyboard appears it pushes status bar up. How can I configure this dialog, or how can I at least change windowSoftInputMode of mentioned dialog?

EDIT I tried accessing window from context and explicitly setting required parameters, but it doesn't seem to have any effect

val context = LocalContext.current
SideEffect {
    val window = context.findWindow()!!
    WindowCompat.setDecorFitsSystemWindows(window, false)
    window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
}
0 Answers
Related