Re: VoiceOver and swipe gestures
Re: VoiceOver and swipe gestures
- Subject: Re: VoiceOver and swipe gestures
- From: Chris Fleizach <email@hidden>
- Date: Tue, 6 Dec 2011 09:11:16 -0800
On Dec 5, 2011, at 11:26 AM, Fritz Anderson wrote:
> Again, thanks for your help, and I'm sorry I'm apparently so dense.
>
> On 5 Dec 2011, at 11:36 AM, Chris Fleizach wrote:
>
>> Attempting VoiceOver gestures in the simulator won't give you an accurate portrait of how things actually work.
>
> Understood. I've now switched to testing exclusively on my device.
>
>
>> However, in this case you might want to allow a 3 finger scroll left or right to expand/collapse this view.
>>
>> You can do that by overriding accessibilityScroll: on that specific view
>
> I got it to recognize three-finger swipes by making the container view an instance of a UIView subclass, implementing only accessibilityScroll:. See the complete @implementaiton at the end of this message.
>
> If I select a view inside the container, and then attempt the scroll gesture, it works. Great.
>
> Issue: If the gesture is the first thing after the application comes to the foreground (at launch or from the background), accessibilityScroll: is never called, and the iPad emits a bongo tone. Selecting a subview restores the three-finger-swipe gesture.
>
Not clear what "If the gesture is the first thing after the app" means. Do you mean that if the user does a 3 finger swipe as soon as the app launches it doesn't work?
That sounds like it's behaving correctly. The user has to choose which view to perform the scroll on. If they're not within the scrollable area, then they won't be able to scroll.
>
> The container view is instantiated (as SwipingView) from the NIB. Initialization from -viewDidLoad assigns into the container's .frame, but immediately posts UIAccessibilityLayoutChangedNotification when it does.
>
>
> What I've tried:
>
> For the sighted, I attach a gesture recognizer that shifts the container upon a single-finger swipe left or right. I tested without the recognizer. No effect on the issue.
>
> I tried making the container a UIAccessibilityContainer (indexing into its subviews), but that made no difference to the issue.
>
> You can tell I'm flailing. What am I missing?
>
>
>>> My assumption is that it's tap once to clear the selection, then tap, tap-hold-and-swipe. About 30% of the time, that gesture not merely selects, but triggers, another control that isn't even close to the gesture. I haven't caught on to what's different about the gesture that does that.
>>
>> That sounds like the right gesture, but again, on the simulator your mileage may vary.
>
> It turned out that the second tap has to be _very_ rapid, and there's no way to adjust it, which surprises me. (Note to self: File a bug.) Once I figured that out, and stuck to the device, there was no problem.
>
> In other news, I hadn't noticed UIAccessibilityTraitAdjustable, which may have me rethinking my slider control and implementing accessibilityIncrement and -Decrement. I wish those methods had examples, or more than ten words of documentation. (Note to self: File a bug.)
>
There's not much else to that API. Just implement those to methods, then a VO user do a swipe up or down to "adjust" the item. It's up to you to decide what to do when the VO user does that
> — F
>
>
> @implementation SwipingView
>
> // gTaskView is the view controller.
> // It has a @property(nonatomic, assign) BOOL containerIsLeft
> // Setting it shifts the container view to match the value.
>
> // For sighted users, the controller attaches a gesture recognizer
> // to the container view: Swipe left -> containerIsLeft = NO,
> // swipe right -> containerIsLeft = YES.
>
> - (BOOL) accessibilityScroll: (UIAccessibilityScrollDirection) direction
> {
> NSString * announcement;
> switch (direction) {
> case UIAccessibilityScrollDirectionLeft:
> if (gTaskView.containerIsLeft) {
> gTaskView.containerIsLeft = NO;
> announcement = @"right-handed";
> }
> break;
>
> case UIAccessibilityScrollDirectionRight:
> if (! gTaskView.containerIsLeft) {
> gTaskView.containerIsLeft = YES;
> announcement = @"left-handed";
> }
> break;
>
> default:
> return NO;;
> }
>
> UIAccessibilityPostNotification(UIAccessibilityPageScrolledNotification,
> announcement);
> return YES;
> }
>
> @end
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden