Maybe a dumb question. But I learned about Dp.Hair...
# compose-android
c
Maybe a dumb question. But I learned about Dp.Hairline today. Seems like its always 1px. My designers gave me designs where there is a divider set to 0.5.dp. Would I be better off using Dp.Hairline or 0.5.dp?
r
Hairline != 0.5.dp
So it depends on what the designer wants
f
might no longer be the case, but in the past, with lower density devices, using 0.5dp was problematic
r
Indeed, 0.5dp will be < 1px on anything that’s < 320dpi
Which means it may not be drawn, or will be drawn in a different color because of antialiasing
f
I would see if you could nudge your designer to accept 1dp and, if that's a bit too much, apply some alpha to it
c
Thanks! In this same vein... the designer has asked "can we replace the 0.5dp divider with a drop shadow" Anyone know the tldr with shadows? Can I easily do this in compose, or do I have to make a 1.dp tall
Card
to make use of it's bottom shadow? đŸ˜‚
m
Wouldn't the shadow be on the item you want to separate? Not on a fake 1.dp on the border of it.
c
I've basically got a 24.dp tall "spacer" list item. At the top of the list item was this divider at 0.5.dp. but now they are just asking to add a drop shadow at the top. Will give it a whirl when im back at my desk.
109 Views