Commit e31936ad authored by Jian Li's avatar Jian Li Committed by Commit Bot

Don't return false to cancel drawing when destroying FeedSliceViewTracker

This fixes the drawinf freezing problem when the user navigates away
from Feed v2 page.

Bug: none
Change-Id: I2d14aa6eac0f03ff51c561ae34a65cdc011d664c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2242200Reviewed-by: default avatarDan H <harringtond@chromium.org>
Commit-Queue: Jian Li <jianli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#777539}
parent 1ed99880
...@@ -60,7 +60,7 @@ class FeedSliceViewTracker implements ViewTreeObserver.OnPreDrawListener { ...@@ -60,7 +60,7 @@ class FeedSliceViewTracker implements ViewTreeObserver.OnPreDrawListener {
@Override @Override
public boolean onPreDraw() { public boolean onPreDraw() {
// Not sure why, but this method can be called just after destroy(). // Not sure why, but this method can be called just after destroy().
if (mRootView == null) return false; if (mRootView == null) return true;
if (!(mRootView.getLayoutManager() instanceof LinearLayoutManager)) return true; if (!(mRootView.getLayoutManager() instanceof LinearLayoutManager)) return true;
LinearLayoutManager layoutManager = (LinearLayoutManager) mRootView.getLayoutManager(); LinearLayoutManager layoutManager = (LinearLayoutManager) mRootView.getLayoutManager();
......
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