-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IOAPPX-419] Adjust the size of
Icon
, Pictogram
and some componen…
…ts based on the value of `fontScale` (#348) >[!caution] > This PR depends on the following PR: > * #347 ## Short description This PR adds a dynamic size to some components, based on the value of `fontScale`. Dynamic size is currently supported on the following components: - `Tag`, `Badge`, `Alert` and `FeatureInfo` - All the selection components (`ListItemCheckbox`, `ListItemRadio`, etc…) - All the `ListItem…` components ## List of changes proposed in this pull request - Add the new `useIOFontDynamicScale` hook to get the current `fontScale` value - Add the new `allowFontScaling` to `Icon`, `AnimatedIcon` and `Pictogram` components to enable dynamic size based on the `fontScale` value - Add the new `allowScaleSpacing` to `Stack` components to enable the same behavior - Add dynamic spacing to `Tag`, `Badge`, all the selection and `ListItem…` components - Increase value of the `maxFontSizeMultiplier` from `1.25` to `1.5` - Hide decorative icons from `ListItem…` and `Module…` components if the text size multiplier is quite big (>= 1.5) ### Preview #### `ListItemCheckbox` As you can see, the size of the margins, icons and checkboxes also changes depending on the value of `fontScale`: | Default size | Larger text size | |--------|--------| | ![Simulator Screenshot - iPhone 16 Pro - 2024-11-06 at 17 14 09](https://github.com/user-attachments/assets/42d1c209-c7c9-4ac2-a7e3-739ef7d28a74) | ![Simulator Screenshot - iPhone 16 Pro - 2024-11-06 at 17 12 20](https://github.com/user-attachments/assets/fc9e689e-6219-4f15-9ffc-89c53a344899) | #### `Alert` Same as above, but with boldEnabled set to _ON._ | Default size | Larger text size | |--------|--------| | ![Simulator Screenshot - iPhone 16 Pro - 2024-11-07 at 16 26 33](https://github.com/user-attachments/assets/9169214b-69d6-48d6-8d75-0fdfdf9be1e0) | ![Simulator Screenshot - iPhone 16 Pro - 2024-11-07 at 16 23 46](https://github.com/user-attachments/assets/737d7113-8170-469d-91dc-2d3a05d577af) | ## How to test 1. Launch the example app 2. Go to the **Accessibility → Display & Text Size → Larger text** 3. Change the values 4. Go back to the example app to see the applied changes
- Loading branch information
Showing
54 changed files
with
1,283 additions
and
957 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.