Bug? :ladybug:*: `BoxWithConstraints` update lag*...
# compose
t
Bug? 🐞*:
BoxWithConstraints
update lag* Can someone confirm the stange flickering occuring om the content inside the
BoxWithConstraints
and that it's gone wenn replaced by a regular Box? Code in the 🧵
Code:
Copy code
import androidx.compose.desktop.Window
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier


fun main() {
    Window {
        var isDarkTheme by remember { mutableStateOf(true) }
        //LocalAppWindow.current.keyboard.setShortcut(Key.T) { isDarkTheme = !isDarkTheme } // For Desktop
        MaterialTheme(if(isDarkTheme) darkColors() else lightColors()) {
            Column(Modifier.fillMaxSize().background(MaterialTheme.colors.background)) {
                Button(onClick = { isDarkTheme = !isDarkTheme }) { Text("Toggle") }
                Box(Modifier.fillMaxWidth().fillMaxHeight(0.5f).background(MaterialTheme.colors.background))
                BoxWithConstraints(Modifier.fillMaxSize()) {
                    Box(Modifier.fillMaxSize().background(MaterialTheme.colors.background))
                }
            }
        }
    }
}
fyi @Zach Klippenstein (he/him) [MOD] regarding https://kotlinlang.slack.com/archives/CJLTWPH7S/p1617123543403600
z
if it repros for you, it will probably repro for others. I’d file a bug to jetbrains compose specifically about this, unless you can also repro on android
t
that would be the question. I correctly haven't tested it on Android and would like to know if its a general Compose Bug
z
i can run a quick android test for you
t
would be great 👍 I currently have no Android Studio installed and would have to setup the whole thing 😅
z
confirmed, i’m seeing it on android too
t
thanks a lot 🙏 I will file a issue tomorrow morning
z
here’s a screencap
thanks, post here after and i’ll star it
t
Issue created 🙌 https://issuetracker.google.com/184173932 @Zach Klippenstein (he/him) [MOD] could you tell me the compose version of your android test?
🙏 1
z
beta03
I tried commenting on the issue to note that but i don’t have comment permission apparently
Reproed in Android SDK 29 emulator
t
Added it to the comments ^^
🙏 1