https://kotlinlang.org logo
#compose
Title
# compose
h

Hitanshu Dhawan

10/14/2020, 12:42 PM
Hey everyone, what’s the best way to have sizes in our theme? So that I can access it like
MaterialTheme.sizes.medium
And we can specify sizes like small, medium, large (similar to shapes).
s

Se7eN

10/14/2020, 1:31 PM
You can create an extension
But maybe you'll be better off having the
size
in your
AppTheme
z

Zhelyazko Atanasov

10/14/2020, 3:52 PM
Well, since we are using Kotlin, you can either have your sizes separately - e.g. in an Object or so. Another possible solution would be to extend the MaterialTheme and add a
size
to it, similarly to how
colors
,
typography
etc. are defined.
2 Views