Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Update 10151.md
Browse files Browse the repository at this point in the history
  • Loading branch information
parjohns authored Nov 30, 2023
1 parent 2128909 commit ff7ee90
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion content/notes/wwdc22/10151.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ https://github.com/apple/unityplugins

## Accessibility Elements
In this demo, cards can be flipped by tapping the button. However, VoiceOver would not read the text on the screen and an external switch would not tap the button.
![Example-Card-Game][0]

[0]: ../../../images/notes/wwdc22/10151/0.jpg

The text, cards, and button need to be accessibility elements so the user can understand what is on the screen.
![Elements][1]

[1]: ../../../images/notes/wwdc22/10151/1.JPG

If the app supports multiple languages, the labels should also be localized.

Expand All @@ -22,7 +26,9 @@ With the labels added as accessibility elements, VoiceOver would now be able to

By adding an accessibility trait, VoiceOver would read the button as "Flip Button" and an external switch would be able to control the button.

![trait](https://github.com/WWDCNotes/Content/assets/88257761/1f18d74e-7baa-4be9-92a3-59e9ac4c4a64)
![Elements][2]

[2]: ../../../images/notes/wwdc22/10151/2.JPG

There are many different types of traits, full list can be found here:

Expand All @@ -31,6 +37,10 @@ https://developer.apple.com/documentation/uikit/uiaccessibilitytraits

In this example, the cards would need a `value` trait to be able to provide the face value of the cards.

![Value][3]

[3]: ../../../images/notes/wwdc22/10151/3.JPG

### Unity Implementation

Accessibility elements are added using the `Accessibility Node` component. This component is added to any gameObject that the user wishes to add accessibility for. The script provides the following fields:
Expand All @@ -40,7 +50,9 @@ Accessibility elements are added using the `Accessibility Node` component. This
- Hint
- Identifier

![Script][4]

[4]: ../../../images/notes/wwdc22/10151/4.JPG
Buttons in Unity UI already have the `Accessibility Node` component by default.

Creating custom C# scripts using Apple's Accessibility requires `using Apple.Accessibility`
Expand Down Expand Up @@ -98,19 +110,32 @@ In a similar way, the face of the cards could also be modified during these acce
LargeMaterial;
}
```
![Value][5]

[5]: ../../../images/notes/wwdc22/10151/5.JPG
![Value][6]

[6]: ../../../images/notes/wwdc22/10151/6.JPG
## UI Accommodations

### Reduce Transparency
- Turns transparent objects more opaque
- Helps improve legibility
- Can be checked with `AccessibilitySettings.IsReduceTransparencyEnabled`

![Reduce-Transparency][8]

[8]: ../../../images/notes/wwdc22/10151/8.jpg

### Increase Contrast
- Colors stand out more
- Makes controls easier to recognize
- Can be checked with `AccessibilitySettings.IsIncreaseContrastEnabled`

![Increase-Contrast][7]

[7]: ../../../images/notes/wwdc22/10151/9.jpg

### Reduce Motion
- Animations should be removed if this is enabled
- Can be checked with `AccessibilitySettings.IsReduceMotionEnabled`
Expand Down

0 comments on commit ff7ee90

Please sign in to comment.