Hey everyone. <M3 Expressive update for Navigation...
# compose
d
Hey everyone. M3 Expressive update for NavigationDrawer says to use "expanded navigation rail" instead of navigation drawer. So I am trying to use
ModalWideNavigationRail
in place of a
ModalNavigationDrawer
. However, I fail to align my
TopAppBar
navigation icon, to the one of the
ModalWideNavigationRail
. The latter takes a nullable
header
, but despite I pass
null
it allocates some space for it (see attached video). If I try to put something in the header, then I get big padding above my header content. However, when you look at the pictures of the M3 Expressive update for NavigationRail, there isn't such a padding above the header. Does anyone have a hint on what I am doing wrong? Or is this a bug?
The code of the scaffold shown above (in the attached video, we are in the case where
modalNavigationRail == true
and
hideOnCollapse == true
):
Copy code
Row(modifier = modifier.fillMaxSize()) {
            if (modalNavigationRail) {
                ModalWideNavigationRail(
                    state = state.navigationRailState,
                    hideOnCollapse = hideOnCollapse,
                    header = null,
                    expandedShape = RoundedCornerShape(
                        topStart = 0.dp,
                        topEnd = 16.dp,
                        bottomStart = 0.dp,
                        bottomEnd = 16.dp
                    ),
                    collapsedShape = RectangleShape,
                    expandedHeaderTopPadding = 0.dp,
                ) {
                    navigationContent()
                }
            } else {
                WideNavigationRail(
                    state = state.navigationRailState,
                    header = null,
                    shape = RectangleShape
                ) {
                    navigationContent()
                }
            }

            Column {
                content()
            }
        }