Android: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#23069)

Summary:
Equivalent of this iOS PR: https://github.com/facebook/react-native/pull/20915

Motivation:
----------

Whenever a user changes the system font size to its maximum allowable setting, React Native apps that allow font scaling can become unusable because the text gets too big. Experimenting with a native app like iMessage on iOS, the font size used for non-body text (e.g. header, navigational elements) is capped while the body text (e.g. text in the message bubbles) is allowed to grow.

This PR introduces a new prop on `<Text>` and `<TextInput>` called `maxFontSizeMultiplier`. This enables devs to set the maximum allowed text scale factor on a Text/TextInput. The default is 0 which means no limit.
Pull Request resolved: https://github.com/facebook/react-native/pull/23069

Differential Revision: D13748513

Pulled By: mdvacca

fbshipit-source-id: 8dd5d6d97bf79387d9a2236fa2e586ccb01afde9
This commit is contained in:
Adam Comella
2019-01-23 11:40:00 -08:00
committed by Facebook Github Bot
parent 5bc709d517
commit 4936d284df
6 changed files with 67 additions and 8 deletions
@@ -106,6 +106,7 @@ public class ViewProps {
public static final String VISIBLE = "visible";
public static final String ALLOW_FONT_SCALING = "allowFontScaling";
public static final String MAX_FONT_SIZE_MULTIPLIER = "maxFontSizeMultiplier";
public static final String INCLUDE_FONT_PADDING = "includeFontPadding";
public static final String BORDER_WIDTH = "borderWidth";