I'm trying to understand how to read the Recomposi...
# compose
n
I'm trying to understand how to read the Recomposition Counts in Layout Inspector. It looks like there might be a problem with my text. Could someone please have a look at my screenshot in thread?
The text seems to be getting recomposed but the recompositions come up as "skipped". The text does not need to be recomposed more than once, but I'm not sure what to use. When I use
derivedStateOf
I can't seem to access my value further down the line...
Copy code
val superscript =
            SpanStyle(
                baselineShift = BaselineShift.Superscript,
                fontSize = 12.sp,
                color = Color.White
            )

[...]

Text(
            text = buildAnnotatedString {
                append(data.name)
                withStyle(superscript) {
                    append("  ${data.value}")
                }
            }, style = TextStyle(Color.White, fontSize = 20.sp),
            fontWeight = FontWeight.ExtraBold
        )
s
In which version of android studio is this available?
n
Electric Eel
🙏 1
a
When
MainPiece
is recomposed, all its children are recomposed (and some of the recompositions may be skipped) so what you should look is
MainPiece
.
n
Hmm, I'm wondering about these 65 recompositions, is that a lot?
s
Depends, if you’re running an animation it seems quite normal I would guess. If you’re supposedly showing stable data to the screen then it doesn’t look normal.
n
Ah ok, yes, I have an animation (animateColorAsState) so that makes sense then. It's also after about 5 to 10 clicks. Thanks!
🤗 1