nglauber
07/12/2020, 3:12 PMval shape = RoundedCornerShape(8.dp)
Column(modifier = Modifier.fillMaxSize()) {
Text(
text = "Text 1",
modifier = Modifier.fillMaxWidth()
.padding(16.dp)
.drawShadow(2.dp, shape)
.drawBorder(2.dp, MaterialTheme.colors.secondary, shape)
.drawBackground(MaterialTheme.colors.primary, shape)
.padding(16.dp)
)
}
Leland Richardson [G]
07/12/2020, 8:55 PMNader Jawad
07/12/2020, 9:02 PMnglauber
07/12/2020, 9:57 PM.drawBorder(2.dp, MaterialTheme.colors.secondary, shape)
.padding(1.dp) // FIX
.drawBackground(MaterialTheme.colors.primary, shape)
It works… But I don’t think this is an expected behavior… If I’m using the same shape with the same size, the last one should overlaps the previous one… 🤷♂️ (I don’t know how it works under the hood)Nader Jawad
07/12/2020, 10:02 PMNader Jawad
07/12/2020, 10:11 PMmatvei
07/13/2020, 10:41 AMdrawBackground
and drawBorder
to behave more correct and with better default, so Modifier.drawBorder
will become Modifier.border
and will properly pad and, probably, clip content inside, so there will be no such problem in the futurenglauber
07/13/2020, 12:51 PMnglauber
07/13/2020, 12:54 PMNader Jawad
07/13/2020, 10:17 PM