google-developer-training / basic-android-kotlin-compose-training-lemonade

Apache License 2.0
53 stars 27 forks source link

E2E and removing scaffold innerpaddig #34

Closed android-dev-lxl closed 7 months ago

android-dev-lxl commented 1 year ago

Issues that we are trying to address in this PR:


To resolve Content is not being drawn behind the bottom system bars, we removed the surface padding and setting it to child elements. But this may not be ideal since child elements may need custom padding.

Q1) Is it ideal to not use surface padding and suppress the lint warning UnusedMaterial3ScaffoldPaddingParameter or setting it to child elements?


To resolve Bottom bar is opaque on SDK version 30 we changed the window.navigationBarColor to Color(0xFF, 0xFF, 0xFF, 0x63).toArgb() instead of Color.Transparent.toArgb().

Q2) Why is Color.Transparent.toArgb() not working for SDK version 29 and higher?

    val navigationBarColor = when {
//        Build.VERSION.SDK_INT >= 29 -> Color.Transparent.toArgb()
        Build.VERSION.SDK_INT >= 26 -> Color(0xFF, 0xFF, 0xFF, 0x63).toArgb()
        // Min sdk version for this app is 24, this block is for SDK versions 24 and 25
        else -> Color(0x00,0x00, 0x00, 0x50).toArgb()
    }
    window.navigationBarColor = navigationBarColor

Before After
image image

Q3) What the reason for setting the alpha to 0x63 vs 0x50?


Q4) Could we have translucent white or black bottom navigation/ system bar depending on the app theme or this is SDK specific?