Hey everyone One question, Does using x.dp for exa...
# compose
y
Hey everyone One question, Does using x.dp for example
1.dp
in every
@Composable()
cause performance issue? As it creates a new object everytime
r
.dp
does not create an object
Dp
is a value class, so unless you do something to force boxing (i.e. storing it in a generic collection, using it as nullable type, etc.), no instance is created
It’s the same for
Offset
,
Size
, etc. and even
Color
(they store multiple values packed into the bits of a
Long
)
👍 4
y
Thnx for the clarification 👍