Skip to content

Commit

Permalink
[NavigationDrawer] Allow users to scroll to dismiss on lower resoluti…
Browse files Browse the repository at this point in the history
…on 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
  • Loading branch information
codeman7 committed Sep 26, 2019
1 parent 6febfa9 commit a80e41c
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -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];

Expand Down

0 comments on commit a80e41c

Please sign in to comment.