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
romainguy
09/01/2023, 3:18 PM
.dp
does not create an object
romainguy
09/01/2023, 3:19 PM
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
romainguy
09/01/2023, 3:21 PM
It’s the same for
Offset
,
Size
, etc. and even
Color
romainguy
09/01/2023, 3:21 PM
(they store multiple values packed into the bits of a