{"action":"created","comment":{"url":"https://api.github.com/repos/material-components/material-components-ios/pulls/comments/236340752","pull_request_review_id":178396497,"id":236340752,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjM0MDc1Mg==","diff_hunk":"@@ -481,6 +508,91 @@ - (void)preferredContentSizeDidChangeForChildContentContainer:(id<UIContentConta\n   [self.view setNeedsLayout];\n }\n \n+- (void)animateToPreferredContentHeight:(CGFloat)preferredContentHeight\n+                           withDuration:(NSTimeInterval)duration\n+                             completion:(void (^_Nullable)(BOOL))completion {\n+  CGSize newPreferredContentSize =\n+      CGSizeMake(CGRectGetWidth(self.view.bounds), preferredContentHeight);\n+  if ([self isMobileLandscape]) {\n+    self.contentViewController.preferredContentSize = newPreferredContentSize;\n+    return;\n+  }\n+  CGPoint contentOffset =\n+      [self calculateContentOffsetWithPreferredContentHeight:preferredContentHeight];\n+  CGFloat precentageOfFullScreen =\n+      [self precentageOfFullScreenWithPreferredContentHeight:preferredContentHeight];\n+  BOOL shouldSetContentHeight = NO;\n+  if (_contentVCPreferredContentSizeHeightCached > preferredContentHeight) {\n+    shouldSetContentHeight = YES;\n+  } else {\n+    if (_contentVCPreferredContentSizeHeightCached != preferredContentHeight) {\n+      // Calculate height before we set preferredContentSize\n+      CGFloat oldContentPreferredHeight = _contentVCPreferredContentSizeHeightCached;\n+      CGFloat oldTotalHeight = [self totalHeightWithAddedContentHeight:oldContentPreferredHeight];\n+      oldTotalHeight =\n+          CGRectGetHeight(self.presentingViewBounds) - oldTotalHeight - MDCDeviceTopSafeAreaInset();\n+      self.contentViewController.preferredContentSize = newPreferredContentSize;\n+      [self.scrollView setContentOffset:CGPointMake(0, oldTotalHeight)];\n+      [self resetLayoutWithInitialDrawerFactor:1];\n+      contentOffset = CGPointMake(0, oldTotalHeight * 2);\n+    }\n+  }\n+  [UIView animateWithDuration:duration\n+      animations:^{\n+        [self.scrollView setContentOffset:contentOffset];\n+      }\n+      completion:^(BOOL finished) {\n+        [self.scrollView setContentOffset:CGPointZero];\n+        if (shouldSetContentHeight) {\n+          [self resetLayoutWithInitialDrawerFactor:precentageOfFullScreen","path":"components/NavigationDrawer/src/private/MDCBottomDrawerContainerViewController.m","position":107,"original_position":106,"commit_id":"bd41faa79ed9db519801aea8acfcc920a0d0c6bc","original_commit_id":"041d0923911536b3e9607ef539a03868a675016c","user":{"login":"codeman7","id":7131294,"node_id":"MDQ6VXNlcjcxMzEyOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/7131294?v=4","gravatar_id":"","url":"https://api.github.com/users/codeman7","html_url":"https://github.com/codeman7","followers_url":"https://api.github.com/users/codeman7/followers","following_url":"https://api.github.com/users/codeman7/following{/other_user}","gists_url":"https://api.github.com/users/codeman7/gists{/gist_id}","starred_url":"https://api.github.com/users/codeman7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeman7/subscriptions","organizations_url":"https://api.github.com/users/codeman7/orgs","repos_url":"https://api.github.com/users/codeman7/repos","events_url":"https://api.github.com/users/codeman7/events{/privacy}","received_events_url":"https://api.github.com/users/codeman7/received_events","type":"User","site_admin":false},"body":"Comment has been added.","created_at":"2018-11-26T17:00:45Z","updated_at":"2018-11-26T17:00:46Z","html_url":"https://github.com/material-components/material-components-ios/pull/5826#discussion_r236340752","pull_request_url":"https://api.github.com/repos/material-components/material-components-ios/pulls/5826","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/material-components/material-components-ios/pulls/comments/236340752"},"html":{"href":"https://github.com/material-components/material-components-ios/pull/5826#discussion_r236340752"},"pull_request":{"href":"https://api.github.com/repos/material-components/material-components-ios/pulls/5826"}},"in_reply_to_id":236303075},"pull_request":{"url":"https://api.github.com/repos/material-components/material-components-ios/pulls/5826","id":233570824,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNTcwODI0","html_url":"https://github.com/material-components/material-components-ios/pull/5826","diff_url":"https://github.com/material-components/material-components-ios/pull/5826.diff","patch_url":"https://github.com/material-components/material-components-ios/pull/5826.patch","issue_url":"https://api.github.com/repos/material-components/material-components-ios/issues/5826","number":5826,"state":"open","locked":false,"title":"[NavigationDrawer] Add API to animate preferred content size","user":{"login":"codeman7","id":7131294,"node_id":"MDQ6VXNlcjcxMzEyOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/7131294?v=4","gravatar_id":"","url":"https://api.github.com/users/codeman7","html_url":"https://github.com/codeman7","followers_url":"https://api.github.com/users/codeman7/followers","following_url":"https://api.github.com/users/codeman7/following{/other_user}","gists_url":"https://api.github.com/users/codeman7/gists{/gist_id}","starred_url":"https://api.github.com/users/codeman7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeman7/subscriptions","organizations_url":"https://api.github.com/users/codeman7/orgs","repos_url":"https://api.github.com/users/codeman7/repos","events_url":"https://api.github.com/users/codeman7/events{/privacy}","received_events_url":"https://api.github.com/users/codeman7/received_events","type":"User","site_admin":false},"body":"### Context\r\nClients may want to animate a navigation drawer to full screen once a user has completed a task. Before this change the navigation drawer would jump if a client changed their `preferredContentSize` of either child view controllers. This allows clients to change their `preferredContentSize` to animate to full screen or to the height of the content.\r\n\r\n### The problem\r\nIf a client set their `preferredContentSize` their drawer would jump to the new height and never passed 50%, because that was the initial drawer height.\r\n### The fix\r\nAdd an API to allow clients to change their `preferredContentHeight` to animate the drawer to full screen.\r\n\r\n### Remaining work\r\nAnimation for top handle and corner radius is still not working.\r\n\r\n### Videos\r\n| Device with notch | Older device |\r\n| - | - |\r\n| ![after](https://user-images.githubusercontent.com/7131294/49020920-89bf4180-f15f-11e8-8336-e192c74b4df2.gif)|![olderdevice](https://user-images.githubusercontent.com/7131294/49020929-8d52c880-f15f-11e8-9b83-cc73195a7ed5.gif)|\r\n\r\n### Related Bugs\r\nCloses #5600\r\nRelated to #5151 ","created_at":"2018-11-26T14:11:05Z","updated_at":"2018-11-26T17:00:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"866de8bf7da3e027f88a22a0b4d6fbdb309cc345","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1004645026,"node_id":"MDU6TGFiZWwxMDA0NjQ1MDI2","url":"https://api.github.com/repos/material-components/material-components-ios/labels/[NavigationDrawer]","name":"[NavigationDrawer]","color":"ededed","default":false},{"id":273191333,"node_id":"MDU6TGFiZWwyNzMxOTEzMzM=","url":"https://api.github.com/repos/material-components/material-components-ios/labels/cla:%20yes","name":"cla: yes","color":"c2e0c6","default":false},{"id":752411854,"node_id":"MDU6TGFiZWw3NTI0MTE4NTQ=","url":"https://api.github.com/repos/material-components/material-components-ios/labels/kokoro:force-run","name":"kokoro:force-run","color":"1d76db","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/material-components/material-components-ios/pulls/5826/commits","review_comments_url":"https://api.github.com/repos/material-components/material-components-ios/pulls/5826/comments","review_comment_url":"https://api.github.com/repos/material-components/material-components-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/material-components/material-components-ios/issues/5826/comments","statuses_url":"https://api.github.com/repos/material-components/material-components-ios/statuses/bd41faa79ed9db519801aea8acfcc920a0d0c6bc","head":{"label":"codeman7:nav-drawer","ref":"nav-drawer","sha":"bd41faa79ed9db519801aea8acfcc920a0d0c6bc","user":{"login":"codeman7","id":7131294,"node_id":"MDQ6VXNlcjcxMzEyOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/7131294?v=4","gravatar_id":"","url":"https://api.github.com/users/codeman7","html_url":"https://github.com/codeman7","followers_url":"https://api.github.com/users/codeman7/followers","following_url":"https://api.github.com/users/codeman7/following{/other_user}","gists_url":"https://api.github.com/users/codeman7/gists{/gist_id}","starred_url":"https://api.github.com/users/codeman7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeman7/subscriptions","organizations_url":"https://api.github.com/users/codeman7/orgs","repos_url":"https://api.github.com/users/codeman7/repos","events_url":"https://api.github.com/users/codeman7/events{/privacy}","received_events_url":"https://api.github.com/users/codeman7/received_events","type":"User","site_admin":false},"repo":{"id":153677219,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM2NzcyMTk=","name":"material-components-ios","full_name":"codeman7/material-components-ios","private":false,"owner":{"login":"codeman7","id":7131294,"node_id":"MDQ6VXNlcjcxMzEyOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/7131294?v=4","gravatar_id":"","url":"https://api.github.com/users/codeman7","html_url":"https://github.com/codeman7","followers_url":"https://api.github.com/users/codeman7/followers","following_url":"https://api.github.com/users/codeman7/following{/other_user}","gists_url":"https://api.github.com/users/codeman7/gists{/gist_id}","starred_url":"https://api.github.com/users/codeman7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeman7/subscriptions","organizations_url":"https://api.github.com/users/codeman7/orgs","repos_url":"https://api.github.com/users/codeman7/repos","events_url":"https://api.github.com/users/codeman7/events{/privacy}","received_events_url":"https://api.github.com/users/codeman7/received_events","type":"User","site_admin":false},"html_url":"https://github.com/codeman7/material-components-ios","description":"Modular and customizable Material Design UI components for iOS","fork":true,"url":"https://api.github.com/repos/codeman7/material-components-ios","forks_url":"https://api.github.com/repos/codeman7/material-components-ios/forks","keys_url":"https://api.github.com/repos/codeman7/material-components-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeman7/material-components-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeman7/material-components-ios/teams","hooks_url":"https://api.github.com/repos/codeman7/material-components-ios/hooks","issue_events_url":"https://api.github.com/repos/codeman7/material-components-ios/issues/events{/number}","events_url":"https://api.github.com/repos/codeman7/material-components-ios/events","assignees_url":"https://api.github.com/repos/codeman7/material-components-ios/assignees{/user}","branches_url":"https://api.github.com/repos/codeman7/material-components-ios/branches{/branch}","tags_url":"https://api.github.com/repos/codeman7/material-components-ios/tags","blobs_url":"https://api.github.com/repos/codeman7/material-components-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeman7/material-components-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeman7/material-components-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeman7/material-components-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeman7/material-components-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/codeman7/material-components-ios/languages","stargazers_url":"https://api.github.com/repos/codeman7/material-components-ios/stargazers","contributors_url":"https://api.github.com/repos/codeman7/material-components-ios/contributors","subscribers_url":"https://api.github.com/repos/codeman7/material-components-ios/subscribers","subscription_url":"https://api.github.com/repos/codeman7/material-components-ios/subscription","commits_url":"https://api.github.com/repos/codeman7/material-components-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeman7/material-components-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeman7/material-components-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeman7/material-components-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeman7/material-components-ios/contents/{+path}","compare_url":"https://api.github.com/repos/codeman7/material-components-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeman7/material-components-ios/merges","archive_url":"https://api.github.com/repos/codeman7/material-components-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeman7/material-components-ios/downloads","issues_url":"https://api.github.com/repos/codeman7/material-components-ios/issues{/number}","pulls_url":"https://api.github.com/repos/codeman7/material-components-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/codeman7/material-components-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/codeman7/material-components-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeman7/material-components-ios/labels{/name}","releases_url":"https://api.github.com/repos/codeman7/material-components-ios/releases{/id}","deployments_url":"https://api.github.com/repos/codeman7/material-components-ios/deployments","created_at":"2018-10-18T19:32:13Z","updated_at":"2018-11-26T12:17:12Z","pushed_at":"2018-11-26T15:06:59Z","git_url":"git://github.com/codeman7/material-components-ios.git","ssh_url":"git@github.com:codeman7/material-components-ios.git","clone_url":"https://github.com/codeman7/material-components-ios.git","svn_url":"https://github.com/codeman7/material-components-ios","homepage":"","size":122818,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"material-components:develop","ref":"develop","sha":"7edf376e83e3cb8af51b120e099d976c8e9266e1","user":{"login":"material-components","id":19478152,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDc4MTUy","avatar_url":"https://avatars3.githubusercontent.com/u/19478152?v=4","gravatar_id":"","url":"https://api.github.com/users/material-components","html_url":"https://github.com/material-components","followers_url":"https://api.github.com/users/material-components/followers","following_url":"https://api.github.com/users/material-components/following{/other_user}","gists_url":"https://api.github.com/users/material-components/gists{/gist_id}","starred_url":"https://api.github.com/users/material-components/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/material-components/subscriptions","organizations_url":"https://api.github.com/users/material-components/orgs","repos_url":"https://api.github.com/users/material-components/repos","events_url":"https://api.github.com/users/material-components/events{/privacy}","received_events_url":"https://api.github.com/users/material-components/received_events","type":"Organization","site_admin":false},"repo":{"id":43820219,"node_id":"MDEwOlJlcG9zaXRvcnk0MzgyMDIxOQ==","name":"material-components-ios","full_name":"material-components/material-components-ios","private":false,"owner":{"login":"material-components","id":19478152,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NDc4MTUy","avatar_url":"https://avatars3.githubusercontent.com/u/19478152?v=4","gravatar_id":"","url":"https://api.github.com/users/material-components","html_url":"https://github.com/material-components","followers_url":"https://api.github.com/users/material-components/followers","following_url":"https://api.github.com/users/material-components/following{/other_user}","gists_url":"https://api.github.com/users/material-components/gists{/gist_id}","starred_url":"https://api.github.com/users/material-components/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/material-components/subscriptions","organizations_url":"https://api.github.com/users/material-components/orgs","repos_url":"https://api.github.com/users/material-components/repos","events_url":"https://api.github.com/users/material-components/events{/privacy}","received_events_url":"https://api.github.com/users/material-components/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/material-components/material-components-ios","description":"Modular and customizable Material Design UI components for iOS","fork":false,"url":"https://api.github.com/repos/material-components/material-components-ios","forks_url":"https://api.github.com/repos/material-components/material-components-ios/forks","keys_url":"https://api.github.com/repos/material-components/material-components-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/material-components/material-components-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/material-components/material-components-ios/teams","hooks_url":"https://api.github.com/repos/material-components/material-components-ios/hooks","issue_events_url":"https://api.github.com/repos/material-components/material-components-ios/issues/events{/number}","events_url":"https://api.github.com/repos/material-components/material-components-ios/events","assignees_url":"https://api.github.com/repos/material-components/material-components-ios/assignees{/user}","branches_url":"https://api.github.com/repos/material-components/material-components-ios/branches{/branch}","tags_url":"https://api.github.com/repos/material-components/material-components-ios/tags","blobs_url":"https://api.github.com/repos/material-components/material-components-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/material-components/material-components-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/material-components/material-components-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/material-components/material-components-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/material-components/material-components-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/material-components/material-components-ios/languages","stargazers_url":"https://api.github.com/repos/material-components/material-components-ios/stargazers","contributors_url":"https://api.github.com/repos/material-components/material-components-ios/contributors","subscribers_url":"https://api.github.com/repos/material-components/material-components-ios/subscribers","subscription_url":"https://api.github.com/repos/material-components/material-components-ios/subscription","commits_url":"https://api.github.com/repos/material-components/material-components-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/material-components/material-components-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/material-components/material-components-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/material-components/material-components-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/material-components/material-components-ios/contents/{+path}","compare_url":"https://api.github.com/repos/material-components/material-components-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/material-components/material-components-ios/merges","archive_url":"https://api.github.com/repos/material-components/material-components-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/material-components/material-components-ios/downloads","issues_url":"https://api.github.com/repos/material-components/material-components-ios/issues{/number}","pulls_url":"https://api.github.com/repos/material-components/material-components-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/material-components/material-components-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/material-components/material-components-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/material-components/material-components-ios/labels{/name}","releases_url":"https://api.github.com/repos/material-components/material-components-ios/releases{/id}","deployments_url":"https://api.github.com/repos/material-components/material-components-ios/deployments","created_at":"2015-10-07T14:12:39Z","updated_at":"2018-11-26T12:22:18Z","pushed_at":"2018-11-26T16:48:41Z","git_url":"git://github.com/material-components/material-components-ios.git","ssh_url":"git@github.com:material-components/material-components-ios.git","clone_url":"https://github.com/material-components/material-components-ios.git","svn_url":"https://github.com/material-components/material-components-ios","homepage":"","size":122655,"stargazers_count":2945,"watchers_count":2945,"language":"Objective-C","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":459,"mirror_url":null,"archived":false,"open_issues_count":886,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":459,"open_issues":886,"watchers":2945,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/material-components/material-components-ios/pulls/5826"},"html":{"href":"https://github.com/material-components/material-components-ios/pull/5826"},"issue":{"href":"https://api.github.com/repos/material-components/material-components-ios/issues/5826"},"comments":{"href":"https://api.github.com/repos/material-components/material-components-ios/issues/5826/comments"},"review_comments":{"href":"https://api.github.com/repos/material-components/material-components-ios/pulls/5826/comments"},"review_comment":{"href":"https://api.github.com/repos/material-components/material-components-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/material-components/material-components-ios/pulls/5826/commits"},"statuses":{"href":"https://api.github.com/repos/material-components/material-components-ios/statuses/bd41faa79ed9db519801aea8acfcc920a0d0c6bc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"codeman7"}}