react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

Android support topbar title font scaling

Open mika-lindell opened this issue 1 year ago • 0 comments

  • Android only
  • To enable font scaling that can be adjusted via Android Settings-app:
    • Accessibility -> Display size and text -> Font size
  • Adds options.topBar.title.allowFontScaling
  • Adds and updated unit tests
  • When allowFontScaling is enabled, sets top bar title to use SP units. When font scaling is 1.0, it should be the same size as when using DIP
  • Here it's set to false by default, because it can conflict with other top bar options like subtitle, height, fontSize etc. that existing users may have
  • I'm thinking about making similar changes to iOS, but I wanted feedback on this one first. iOS has some issues especially when "Larger accessibility sizes"-setting is enabled
{
   topBar: {
      title: {
         text: "My title",
         fontSize: 18,
         allowFontScaling: true,
      },
   },
}
allowFontScaling=false allowFontScaling=true
Screenshot_20240813-183132 Screenshot_20240813-175043

Allowing font scaling in top bar title seems to be convention in "standard" Android apps:

Screenshot_20240812-155831 Screenshot_20240812-155816
Screenshot_20240812-155559 Screenshot_20240812-155736

Settings that can change font scaling in users' device

mika-lindell avatar Aug 14 '24 10:08 mika-lindell