n

    nglauber

    1 year ago
    I’m trying to change the status bar color using accompanist library, but no success… 😕
    val systemUiController = rememberSystemUiController()
    val useDarkIcons = MaterialTheme.colors.isLight
    
    SideEffect {
        systemUiController.setStatusBarColor(
            color = Color.Red,
            darkIcons = useDarkIcons
        )
    }
    MyComposable()
    cc: @cb
    cb

    cb

    1 year ago
    What does ‘no success’ mean? What API level?
    n

    nglauber

    1 year ago
    MyComposable
    has a
    Scaffold
    as root element… I’m testing on emulator. API 30
    Just to add more details… the
    TopBar
    of my
    Scaffold
    is using
    Modifier
        .statusBarsPadding()
    Not sure if it helps…
    cb

    cb

    1 year ago
    Not really. SystemUiController is a very thin layer on top of the Android APIs, so I’d be surprised if this is a bug in Accompanist
    If you can provide a reproducible sample, I’ll take a look
    n

    nglauber

    1 year ago
    Sure… give me 2min
    cb

    cb

    1 year ago
    Please raise it as an issue on the repo 👍
    n

    nglauber

    1 year ago
    I found the issue 😉 I’m using this in my activity’s theme:
    <item name="android:windowTranslucentStatus">true</item>
    Sorry @cb 😞
    cb

    cb

    1 year ago
    Ah yeah, I could probably add a check for that
    n

    nglauber

    1 year ago
    humm… but I can’t have a translucent for one composable and a colored status bar for a different one… 🤔 I mean…
    ScreenA
    is using a translucent status bar, but
    ScreenB
    must have a solid status bar. Is there a way to this?
    Maybe I can set the activity flags…
    Colton Idle

    Colton Idle

    1 year ago
    If it makes you feel any better. I've set up edge to edge on four separate apps and every time I need to do it, it takes forever. There's always some small little issue that trips me up. Also, I've ended up finding that the window manager api or whatever that is supposed to lay you out under the system bars doesn't work as well as the Insetter library edge to edge helper call.
    n

    nglauber

    1 year ago