Commit db01bd34 authored by sczs's avatar sczs Committed by Chromium LUCI CQ

[ios] Removes diffable data source scrolling offset workaround.

Since diffable data source has been turned off we can remove this
workaround.

Bug: 1162429, 1162427
Change-Id: I45d786022312bc85fa19ad4e9b96920ce88572a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612565Reviewed-by: default avatarAdam Trudeau-Arcaro <adamta@google.com>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840638}
parent 9dfb6b22
...@@ -60,8 +60,6 @@ const CGFloat kDiscoverFeedFeaderHeight = 30; ...@@ -60,8 +60,6 @@ const CGFloat kDiscoverFeedFeaderHeight = 30;
// Minimum height of the Discover feed content to indicate that the articles // Minimum height of the Discover feed content to indicate that the articles
// have loaded. // have loaded.
const CGFloat kDiscoverFeedLoadedHeight = 1000; const CGFloat kDiscoverFeedLoadedHeight = 1000;
// Delay before the CollectionView scrolls to the saved position.
const CGFloat kDelayBeforeScrollingToSavedOffset = 0.3;
} }
NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix = NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix =
...@@ -954,25 +952,9 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix = ...@@ -954,25 +952,9 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix =
self.traitCollection.preferredContentSizeCategory) + self.traitCollection.preferredContentSizeCategory) +
collection.contentInset.bottom)); collection.contentInset.bottom));
if (collection.contentOffset.y != offset) { if (collection.contentOffset.y != offset) {
// Since the Discover feed uses a diffable data source its not completely
// loaded at this time, in order to make this work we need to add a short
// delay before scrolling.
if (IsDiscoverFeedEnabled()) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW,
static_cast<int64_t>(
kDelayBeforeScrollingToSavedOffset *
NSEC_PER_SEC)),
dispatch_get_main_queue(), ^{
collection.contentOffset = CGPointMake(0, offset);
// Update the constraints in case the omnibox needs to
// be moved.
[self updateConstraints];
});
} else {
collection.contentOffset = CGPointMake(0, offset); collection.contentOffset = CGPointMake(0, offset);
// Update the constraints in case the omnibox needs to be moved. // Update the constraints in case the omnibox needs to be moved.
[self updateConstraints]; [self updateConstraints];
}
} }
} }
_initialContentOffset = NAN; _initialContentOffset = NAN;
......
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