Commit 73862c96 authored by David Jean's avatar David Jean Committed by Commit Bot

[ios] Fixed bookmarks folder search animation when in root

When going from bookmarks root to another folder through search
(we replace the controller stack) the search bar was at different
height (on iOS 11), resulting in a kink in the animation. This
solves it by moving to small title before the animation.

Bug: 893559
Change-Id: I74424e25ae475ea493a967f49c89eb0d5cc96242
Reviewed-on: https://chromium-review.googlesource.com/c/1304514Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: David Jean <djean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605284}
parent a2b1f7be
...@@ -749,6 +749,19 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) { ...@@ -749,6 +749,19 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) {
[self navigateAway]; [self navigateAway];
if (@available(iOS 11, *)) {
// At root, since there's a large title, the search bar is lower than on
// whatever destination folder it is transitioning to (root is never
// reachable through search). To avoid a kink in the animation, the title
// is set to regular size, which means the search bar is at same level at
// beginning and end of animation. This controller will be replaced in
// |stack| so there's no need to care about restoring this.
if (_rootNode == self.bookmarks->root_node()) {
self.navigationItem.largeTitleDisplayMode =
UINavigationItemLargeTitleDisplayModeNever;
}
}
auto completion = ^{ auto completion = ^{
[self.navigationController setViewControllers:stack animated:YES]; [self.navigationController setViewControllers:stack animated:YES];
}; };
......
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