Commit eade57cd authored by edchin's avatar edchin Committed by Commit Bot

[ios] Fix iOS 10 tab grid animation bug

A bug in WKWebView causes video playback to get gummed up for all future
playbacks even on new WebStates until the app is killed.
This fix runs the simple reduced motion animator for iOS 10 so users
are able to playback video.

Bug: 891851
Change-Id: I22e84f5a7e3b7aa453ba8fe4632ddc12619d86a7
Reviewed-on: https://chromium-review.googlesource.com/c/1330028Reviewed-by: default avataredchin <edchin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607248}
parent a5406b62
......@@ -23,32 +23,28 @@
animationControllerForPresentedController:(UIViewController*)presented
presentingController:(UIViewController*)presenting
sourceController:(UIViewController*)source {
id<UIViewControllerAnimatedTransitioning> animator;
if (UIAccessibilityIsReduceMotionEnabled() ||
!self.provider.selectedCellVisible) {
ReducedMotionAnimator* simpleAnimator =
[[ReducedMotionAnimator alloc] init];
simpleAnimator.presenting = YES;
animator = simpleAnimator;
} else {
animator =
[[GridToVisibleTabAnimator alloc] initWithStateProvider:self.provider];
if (@available(iOS 11, *)) {
if (!UIAccessibilityIsReduceMotionEnabled() &&
self.provider.selectedCellVisible) {
return [[GridToVisibleTabAnimator alloc]
initWithStateProvider:self.provider];
}
}
return animator;
ReducedMotionAnimator* simpleAnimator = [[ReducedMotionAnimator alloc] init];
simpleAnimator.presenting = YES;
return simpleAnimator;
}
- (id<UIViewControllerAnimatedTransitioning>)
animationControllerForDismissedController:(UIViewController*)dismissed {
id<UIViewControllerAnimatedTransitioning> animator;
if (UIAccessibilityIsReduceMotionEnabled()) {
ReducedMotionAnimator* simpleAnimator =
[[ReducedMotionAnimator alloc] init];
simpleAnimator.presenting = NO;
animator = simpleAnimator;
} else {
animator = [[TabToGridAnimator alloc] initWithStateProvider:self.provider];
if (@available(iOS 11, *)) {
if (!UIAccessibilityIsReduceMotionEnabled()) {
return [[TabToGridAnimator alloc] initWithStateProvider:self.provider];
}
}
return animator;
ReducedMotionAnimator* simpleAnimator = [[ReducedMotionAnimator alloc] init];
simpleAnimator.presenting = NO;
return simpleAnimator;
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment