Closed sergio-sastre closed 3 months ago
Update: It's plan to look as follows:
SMALL(0.85f),
NORMAL(1f),
LARGE(1.15f),
@Discouraged("Use XLARGE instead") HUGE(1.3f),
XLARGE(1.3f),
XXLARGE(1.5f),
XXXLARGE(1.8f),
LARGEST(2.0f)
Moreover, custom values will also be allowed. Some examples:
ActivityScenarioForComposableRule(
config = ComposableConfig(fontSize = FontSize.XXLARGE)
)
or
ActivityScenarioForComposableRule(
config = ComposableConfig(fontSize = FontSizeScaleValue(2.2f))
)
Additionally, you can skip non-officially-supported values by calling the following method at the beginning of a test:
assumeSupportsFontSizeScale(FontSize.XXLARGE))
This will skip that test if SDK < 34.
The reasoning behind is that you might want to test it anyway, since some Manufactures build on top of standard Android OS and provide their custom Font Size Options in some models (Hello Samsung!). That is allowed by default
No breaking changes expected :) :)
included in 2.3.0
Currently, FontSize supports only till HUGE, which is 1.3f Since Android 34, it is possible to scale up to 2.0f, and this scaling is not linear.
Robolectric supports that as well.
the idea is to add the new values, e.g EXTRA_HUGE(1.5f) EXTREMELY_HUGE(1.8f) MAXIMUM(2.0f)
that will run on API 34+ and such tests will skip on API <34
Additionally add other values that will force these new font scaling in older API e.g FORCED_EXTRA_HUGE(1.5f) etc.