hey everyone, why does TopAppBar M3 have a left/st...
# compose
h
hey everyone, why does TopAppBar M3 have a left/start invisible padding Code in 🧵
Copy code
val topAppBarScrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior()

Scaffold(
    contentWindowInsets = WindowInsets(0),
    modifier = Modifier
        .fillMaxSize()
        .nestedScroll(topAppBarScrollBehavior.nestedScrollConnection),
    topBar = {
        Box(
            Modifier
                .fillMaxWidth()
                .padding(top = 16.dp)
        ) {
            TopAppBar(
                colors = TopAppBarDefaults.topAppBarColors(
                    scrolledContainerColor = Color.Transparent,
                    containerColor = Color.Transparent
                ),
                scrollBehavior = topAppBarScrollBehavior,
                windowInsets = WindowInsets(0, 0, 0, 0),
                title = {
                    Box(
                        Modifier.fillMaxWidth()
                            .height(60.dp)
                            .background(Color.Red)
                    )
                },
            )
        }
    },
    content = {} }
Copy code
// A title inset when the App-Bar is a Medium or Large one. Also used to size a spacer when the // navigation icon is missing. private val TopAppBarTitleInset = 16.dp - TopAppBarHorizontalPadding

private val TopAppBarHorizontalPadding = 4.dp
😓