if I’d like to do something like this, this is a b...
# compose
o
if I’d like to do something like this, this is a box with a surface inside and an icon inside the surface, sounds right?
j
I'd say the
Box
with a
Modifier.background()
is enough
o
ah right
thanks makes sense
a
nested surfaces are definitely overkill, if it can be made simply with primitives, do that. If it makes sense to componentize it, do that. 🙂
And a little offtopic, ticketswap sounds a lot like my previous gig @ lemonade.social
It was a fun time there 🙂
o
hehe, yes Ticketswap is definitely a fun place to be in, Amsterdam itself also
a
I worked with 2 devs from the Netherlands, one was ex Razer, other ex Amazon
o
where do you work from now?
c
Looks like a box, CircleShape clip, with an icon. Or you could even recreate that icon using compose code.
a
I still keep mine as drawables personally 😅
The icons, just tint them and all is good
What I'll do is store the resource IDs in an object
@oday I work for RealPage now, under their smart building division/acquisition: STRATIS
It's smart home but for multifamily, so apartments, student housing, etc
o
nice!
well @Colton Idle the issue with that is that if I were to want to set the background for that box with the circleshape clip, and have it have an opacity of something for example, the icon inside is getting affected
Copy code
Box(
    modifier = modifier
        .clip(CircleShape)
        .size((size.width / 2).dp, (size.height / 2).dp)
        .background(color.copy(alpha = 0.12f))
) {
    Icon(
        painter = painterResource(id = R.drawable.ic_sample_icon),
        modifier = modifier
            .size(size.width.dp, size.height.dp)
            .align(Alignment.Center),
        contentDescription = null
    )
}
a
How is it affected, that shouldn't affect it 🤔
o
yea……as I was writing i realized that this doesn’t make sense, yea something else is up
a
Screenshot?
o
yea it is not affecting it, just tried again
just a d’oh moment 🙂
there we go
a
Nice!