Xamarin.Forms icon indicating copy to clipboard operation
Xamarin.Forms copied to clipboard

[Enhancement] Adjustable feature to iOS devices

Open jonny123d opened this issue 4 years ago • 0 comments

Summary

When there is a value that can be increased or decreased, in iOS it is common to do it with a view that detects the swipe up / down gestures when VoiceOver is activated. These views you create are of type UIAccessibilityTraitAdjustable. In Xamarin.iOS this value is part of the UIAccessibilityTrait enumeration: UIAccessibilityTrait.Adjustable. This Adjustable views need to implement accessibilityIncrement() and accessibilityDecrement() methods to detect swipe up and down gestures.

It would be nice if this feature were available for a Grid (for example) to improve usability for blind or visually impaired users.

API Changes

The main goal would be somethig like this:

<Grid AutomationProperties.IsInAccessibleTree="{Binding IsIosPlatform}"
      AutomationProperties.IosTraits="Adjustable"
      AutomationProperties.IosValue="{Binding Value}"
      AutomationProperties.IosIncrementCommand="{Command IncreaseCommand}"
      AutomationProperties.IosDecrementCommand="{Command DecreaseCommand}">
    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Label Grid.Row="0"
           Grid.Column="0"
           Grid.ColumnSpan="2"
           Text="{Binding Value}"
           AutomationProperties.IsInAccessibleTree="{Binding IsAndroidPlatform}"/>
    <Button Grid.Row="1"
            Grid.Column="0"
            Text="-"
            Command="{Binding DecreaseCommand}"
            AutomationProperties.IsInAccessibleTree="{Binding IsAndroidPlatform}"/>
    <Button Grid.Row="1"
            Grid.Column="1"
            Text="+"
            Command="{Binding IncreaseCommand}"
            AutomationProperties.IsInAccessibleTree="{Binding IsAndroidPlatform}"/>
</Grid>

With the screen reader disabled:

  • There is a Grid with a Label (to show the value) and 2 Buttons to increase or decrease the value in Android and iOS platforms.

With the screen reader enabled:

  • In iOS platform there is one Adjustable Grid with the value and increase/decrease commands.
  • In Android platform there is a Grid with a Label (to notify the value) and 2 Buttons to increase or decrease the value.

Intended Use Case

This feature is useful for any situation where you want to increase or decrease a value, and also want to keep the user interface the same with the screen reader enabled or disabled.

Blind or visually impaired users can continue to use the gestures they are used to on the iOS platform.

jonny123d avatar Jul 30 '21 10:07 jonny123d