[Fullscreen] Home indicator should show and hide with status bar
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2018 22:48:28 +0000 (22:48 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2018 22:48:28 +0000 (22:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186942
<rdar://problem/41302190>

Reviewed by Tim Horton.

* UIProcess/ios/fullscreen/WKFullScreenViewController.h:
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController showUI]):
(-[WKFullScreenViewController hideUI]):
(-[WKFullScreenViewController setPrefersHomeIndicatorAutoHidden:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.h
Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm

index d0b267b..98dfb9e 100644 (file)
@@ -1,5 +1,19 @@
 2018-06-22  Jer Noble  <jer.noble@apple.com>
 
+        [Fullscreen] Home indicator should show and hide with status bar
+        https://bugs.webkit.org/show_bug.cgi?id=186942
+        <rdar://problem/41302190>
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
+        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
+        (-[WKFullScreenViewController showUI]):
+        (-[WKFullScreenViewController hideUI]):
+        (-[WKFullScreenViewController setPrefersHomeIndicatorAutoHidden:]):
+
+2018-06-22  Jer Noble  <jer.noble@apple.com>
+
         [Fullscreen] Add a pinch-to-exit gesture
         https://bugs.webkit.org/show_bug.cgi?id=186821
 
index c2f6d8b..0fe7f76 100644 (file)
@@ -38,6 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (assign, nonatomic) SEL action;
 @property (copy, nonatomic) NSString *location;
 @property (assign, nonatomic) BOOL prefersStatusBarHidden;
+@property (assign, nonatomic) BOOL prefersHomeIndicatorAutoHidden;
 @property (assign, nonatomic, getter=isPlaying) BOOL playing;
 @property (assign, nonatomic, getter=isPictureInPictureActive) BOOL pictureInPictureActive;
 @property (assign, nonatomic, getter=isAnimating) BOOL animating;
index 6dce47b..cf71726 100644 (file)
@@ -119,6 +119,9 @@ private:
     CGFloat _nonZeroStatusBarHeight;
 }
 
+@synthesize prefersStatusBarHidden=_prefersStatusBarHidden;
+@synthesize prefersHomeIndicatorAutoHidden=_prefersHomeIndicatorAutoHidden;
+
 #pragma mark - External Interface
 
 - (id)initWithWebView:(WKWebView *)webView
@@ -167,6 +170,7 @@ private:
         [_stackView setHidden:NO];
         [_stackView setAlpha:1];
         self.prefersStatusBarHidden = NO;
+        self.prefersHomeIndicatorAutoHidden = NO;
         [self.view removeConstraints:@[_topConstraint.get()]];
         _topConstraint = [[_topGuide topAnchor] constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor];
         [_topConstraint setActive:YES];
@@ -179,11 +183,13 @@ private:
 {
     [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hideUI) object:nil];
     [UIView animateWithDuration:showHideAnimationDuration animations:^{
+
         [self.view removeConstraints:@[_topConstraint.get()]];
         _topConstraint = [[_topGuide topAnchor] constraintEqualToAnchor:self.view.topAnchor constant:self.view.safeAreaInsets.top];
         [_topConstraint setActive:YES];
         [_stackView setAlpha:0];
         self.prefersStatusBarHidden = YES;
+        self.prefersHomeIndicatorAutoHidden = YES;
         if (auto* manager = self._manager)
             manager->setFullscreenControlsHidden(true);
     } completion:^(BOOL finished) {
@@ -206,8 +212,6 @@ private:
     [_pipButton setHidden:!playbackSessionModel];
 }
 
-@synthesize prefersStatusBarHidden=_prefersStatusBarHidden;
-
 - (void)setPrefersStatusBarHidden:(BOOL)value
 {
     _prefersStatusBarHidden = value;
@@ -215,6 +219,12 @@ private:
     [self _updateWebViewFullscreenInsets];
 }
 
+- (void)setPrefersHomeIndicatorAutoHidden:(BOOL)value
+{
+    _prefersHomeIndicatorAutoHidden = value;
+    [self setNeedsUpdateOfHomeIndicatorAutoHidden];
+}
+
 - (void)setPlaying:(BOOL)isPlaying
 {
     if (_playing == isPlaying)