Compose material question. There's no way to incre...
# compose
c
Compose material question. There's no way to increase the size of a checkbox or radio button right? For the latter it seems hard-coded to 20.dp, but my designer wants it to be 22.dp /shruggie
c
Yep. so that means... fork it? no way to somehow force it?
s
It does
.requiredSize(20.dp)
after your
modifier
which you pass in in the modifier chain. I don't see a way to override this,, no. You can also pass it in a higher required size before, but all that will do is take up more space around the drawing operations they do, but the canvas they got there will still be 20.dp no matter what. You can try doing that though and see how it renders, to ensure that what I am saying is true.
But also, all the drawing operations inside the canvas seem to operate on other fixed numbers, like the
*RadioButton*DotSize
being 12.dp and the
drawCircle
using that value. You gotta fork it indeed. Luckily this one looks like a very simple component
c
Yeah. When I try setting it larger it just adds padding around it unfortunately. Thanks Stylianos for the sanity check
k
Material Theme is a ready to use design system. it is not designed to be very customizable.
if you need your own style then you are supposed to use the foundation instead
1
c
Completely understand that. But for example... I can modify the height of a material button. As well as other components and now they wouldn't exactly look like material. Anyway... it was just an innocuous question because i thought maybe I was missing something.
d
You can use a modifier to scale the CheckBox. i.e.
Copy code
.graphicsLayer( scaleX = 1.5f, scaleY = 1.5f)
Too much scaling may overlap other elements though.
s
@Dan MacNeil ooh, I don't like that. Wouldn't it cause it to look pixelated? I think changing the
LocalDensity
value through
CompositionLocalProvider
would be better, no? AND its actual layout size grows too, so no risk of overlapping other elements.
s
The scale thing just does a graphics scale. It doesn't even occupy more space so you need to make sure to not have it overlap with things. Overall it's a horrible solution for such scenarios.
s
Yeah, it just takes the pixels and stretches them out.
👍 2