0

Im currently having a Drawer and a Bottombar in a Scaffold Also the drawer should only show when clicked on a button in a certain activity

The Scaffold itself cannot be part of the drawer class itself because it does push the buttons on the top of the screen, so my solution has been to just use the Scaffold in the Startscreen of the App (maybe you have a tip on how to improve here?)

Anyways, My problem now is, that I have googled quite a lot but haven't found a good way to resize the drawer (because currently it fills the screen fully from the left to the right, but I would like to make it e.g. only half of the screen). One way I found to resize it was especially frustrating, because it also resized the Bottombad since they are in the same scaffold. So I'm not sure what to search for at this point, any help would be appreciated. The important part of my code looks like this:

imports ...
class MainActivity : ComponentActivity(){ doing stuff here }

@Composable
fun startScreen() {

    //Remembering if the drawer is closed or open
    val remScaffState = rememberScaffoldState(rememberDrawerState(DrawerValue.Open))

    //To be able to open/close the Drawer
    val scope = rememberCoroutineScope()

    //Be able to navigate to the clicked View
    val navController = rememberNavController()
    Scaffold(

        modifier = Modifier,
        scaffoldState = currentscaffoldState,
        drawerBackgroundColor = e.g. blue,
        drawerContent = {
            Drawer(scope = scope, scaffoldState = current, navController = navController)
        },
        bottomBar = {Modifiers for the bottomBar}){}
}
Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
valoon
  • 1

1 Answers1

0

Try to use ModelDrawer(), add modifier to fullWidth(), you can follow this link.

Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
farhanroy
  • 9
  • 2