From a80e41c20710024d01941ab538817678352e480c Mon Sep 17 00:00:00 2001 From: Cody Weaver Date: Thu, 26 Sep 2019 11:32:46 -0700 Subject: [PATCH] [NavigationDrawer] Allow users to scroll to dismiss on lower resolution devices. (#8503) This change allows `currentlyFullscreen` property on [`MDCBottomDrawerContainerViewController`](https://github.com/material-components/material-components-ios/blob/develop/components/NavigationDrawer/src/private/MDCBottomDrawerContainerViewController.m) to become `NO` on lower resolution devices. Currently this property is always `NO`. This doesn't allow the code within `- (void)scrollViewWillEndDragging:withVelocity:targetContentOffset:` to be executed. ## Testing 1. Set `preferredContentSize` on the headerVC of a Navigation Drawer example to 80. 2. Set `preferredContentSize` on the contentVC of the same Navigation Drawer example to a value less than 240. 3. Open the example on a iPhoneSE 4. Rotate to landscape. 5. Try to swipe to dismiss the drawer. Closes #8454 --- .../src/private/MDCBottomDrawerContainerViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/NavigationDrawer/src/private/MDCBottomDrawerContainerViewController.m b/components/NavigationDrawer/src/private/MDCBottomDrawerContainerViewController.m index 23bc6a7d38e..8f209acd7a8 100644 --- a/components/NavigationDrawer/src/private/MDCBottomDrawerContainerViewController.m +++ b/components/NavigationDrawer/src/private/MDCBottomDrawerContainerViewController.m @@ -661,7 +661,7 @@ - (void)updateViewWithContentOffset:(CGPoint)contentOffset { transitionRatio:transitionPercentage]; [self updateDrawerState:transitionPercentage]; - self.currentlyFullscreen = self.contentReachesFullscreen && headerTransitionToTop >= 1; + self.currentlyFullscreen = self.contentReachesFullscreen && contentOffset.y > 0; CGFloat fullscreenHeaderHeight = self.contentReachesFullscreen ? self.topHeaderHeight : [self contentHeaderHeight];