I can have Navigation Drawer in JetpackCompose by using Scaffold.
But when I change the size of drawbleShape, it set fixed width as default size.
Scaffold(
drawerContent = { DrawableCompose() },
drawableShape = MaterialTheme.shapes.small
) {}
I reference this post, How to set the Scaffold Drawer Width in JetpackCompose?
But it cut child compose like,
Scaffold(
drawerContent = { DrawableCompose() },
drawableShape = customShape()
) {}
@Composable
fun customShape() = object : Shape {
override fun createOutline(
size: Size,
layoutDirection: LayoutDirection,
density: Density
): Outline {
return Outline.Rectangle(Rect(left = 0f, top = 0f, right = size.width * 2 / 3, bottom = size.height))
}
DrawerCompose
@Composable
fun DrawerCompose(
id: String
) {
val focusManager = LocalFocusManager.current
val keyboardController = LocalSoftwareKeyboardController.current
Column(modifier = Modifier.fillMaxSize()) {
OutlinedTextField(value = id, onValueChange = { onChangeEmpNo(it) }, modifier = Modifier.fillMaxWidth())
}
}
As shown in the picture above, some parts are cut off. Is there any way to set width drawer compose width?