https://kotlinlang.org logo
#compose
Title
# compose
j

JD

09/01/2020, 6:16 PM
Using scaffold API if we use a drawer. is it expected that the drawer would be opened when scrolled from midway in the screen? Example Video: I have enabled the screen taps to showcase where the drag was being made from. Is this expected behavior. I understand that now since the edge of the screen is used for gesture navigation however if the drawer opens from anywhere wouldn't it be a wrong behavior? Note: Pasting code in comments
Copy code
val scaffoldState = rememberScaffoldState()
Scaffold(
    topBar = {
        TopAppBar(
            title = {
                Text(text = "Layouts Codelab")
            },
            navigationIcon = {
                IconButton(onClick = {
                    scaffoldState.drawerState.open()
                }) {
                    Icon(asset = <http://Icons.Filled.Menu|Icons.Filled.Menu>)
                }
            },
            actions = {
                IconButton(onClick = {}) {
                    Icon(Icons.Filled.Favorite)
                }
            }
        )
    },
    drawerContent = {
        Text(text = "Content of the drawer")
    },
    scaffoldState = scaffoldState
) { innerPadding ->
    BodyContent(Modifier.padding(innerPadding))
}
m

matvei

09/01/2020, 6:37 PM
Hey! Good questions. This is a known issue and will be fixed in the near future. Filed a bug: http://issuetracker.google.com/issues/167408603
👍 2
2 Views