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

Sourabh Rawat

09/12/2020, 5:46 PM
Getting external padding for topAppBar. Using MaterialTheme -> Surface -> Scaffold with topAppBar = TopAppBar(). (screenshot in the thread). Please help.
m

manueldidonna

09/12/2020, 5:49 PM
What is the external padding? It seems an elevated top bar with a translucent background
s

Sourabh Rawat

09/12/2020, 5:53 PM
Its set to default.I basically have
Copy code
Scaffold(
        topBar = {
            TopAppBar {

            }
        },
    ) {
    }
So, I have this color palette
Copy code
lightColors(
    primary = Color(0xFFFFFF),
    primaryVariant = Color(0xCCCCCC),
    secondary = Color.White,
    secondaryVariant = Color(0xCCCCCC),
    surface = Color.White,
    onPrimary = Color(0x000000),
    onSecondary = Color.Black,
    onBackground = Color.Black,
    onSurface = Color.Black,
    onError = Color.Black,
    error = Color.Red,
)
if I set
primary
to
Color(0xFFFFFF)
, then I get the extra padding. But not for
Color.White
. I guess its because of the extra FF for in `Color.White`(=Color(0xFFFFFFFF)). Hmm, but can't understand the exact reason for the padding thing.
m

manueldidonna

09/12/2020, 6:07 PM
It's not an extra padding, it's the shadow of the top bar. You can see it because you created the
Color
omitting the lightness
☝️ 1
🤯 1
s

Sourabh Rawat

09/12/2020, 6:10 PM
Oh got it. Thanks a lot!
😁 1