Brian Gardner

    Brian Gardner

    2 years ago
    Question about the
    ModalDrawerLayout
    . I added it to my sample project and it is getting drawn under the
    TopAppBar
    I have in the
    bodyContent
    of the drawer. I thought it was just clipping to that size but once I added some content to the drawer and had it fit the width and height it’s clear the drawer is just being drawn under the app bar. This seems like a bug since it goes agains the material design spec but I just wanted to make sure I wasn’t doing anything silly. Screenshots in thread
    empty drawer layout under app bar
    Drawer contents drawn under app bar as well
    I also found that the drawer does not prevent interactions with the body content. I can click on the share icons when the drawer is open and it will trigger the click listener instead of shutting the drawer
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    2 years ago
    You probably want to use
    Scaffold
    . It will make sure your app bars, drawers, FAVs, and content are laid out correctly. Not sure about the touch-through issue though.
    Brian Gardner

    Brian Gardner

    2 years ago
    Thanks! I’ll try it out
    Using the
    Scaffold
    worked perfectly! The drawer is drawn over the top app bar and the content is placed correctly. The touch issue is gone with it as well. Thanks!
    l

    Leland Richardson [G]

    2 years ago
    cc @matvei is there something we should change here for ModalDrawerLayout?
    matvei

    matvei

    2 years ago
    Yeah I think this issue is related to the reordering due to elevation (known issue in dev08). Basically, if drawer sheet has no elevation (it should have some, according to spec, but by default now it doesn't) and topAppBar has some non-zero elevation, we reorder topAppbar to appear on the higher z index
    It shouldn't be that magical, so it will work ok in the next release.
    Scaffold works, because it has different layout structure, so this issue with elevation doesn't occur
    (took a note to make Drawer elevation by default being proper value instead of 0)