where the size of icons was initialised as "Unspecified". As a result, certain icons became 'clipped', see:
We believe the cause of this is that the function .sp doesn't have enough information in order to construct a TextUnit value at the time that the object is constructed. As such, it gives a TextUnit value of "Unspecified".
What are the changes implemented in this PR?
The only other place we use .sp in our application is in //framework/common/theme/Typography.kt, where we follow the pattern of declaring our sizes as const Ints and transforming them into TextUnit values later with .sp. We now follow this pattern in //framework/material/Icon.kt
We've also made all the Icon enum class constructor arguments named.
What is the goal of this PR?
We've fix a bug we introduced a bug in:
where the size of icons was initialised as "Unspecified". As a result, certain icons became 'clipped', see:
We believe the cause of this is that the function
.sp
doesn't have enough information in order to construct aTextUnit
value at the time that the object is constructed. As such, it gives aTextUnit
value of "Unspecified".What are the changes implemented in this PR?
The only other place we use
.sp
in our application is in//framework/common/theme/Typography.kt
, where we follow the pattern of declaring our sizes asconst
Ints and transforming them intoTextUnit
values later with.sp
. We now follow this pattern in//framework/material/Icon.kt
We've also made all the Icon enum class constructor arguments named.