Commit deb8bb4e authored by Wenyu Fu's avatar Wenyu Fu Committed by Commit Bot

Change the shadow when view changes

Currently shadow is only listening to scrolling behavior for
ScrollingView, but didn't handled the view changes. This fix will update
the shadow view visibility #onGlobalLayout.

Bug: 1127816
Change-Id: I3a0b04bfb077d543fa0b41a9ece7890e5198d77f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416565
Commit-Queue: Wenyu Fu <wenyufu@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarSky Malice <skym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808414}
parent 9b778717
......@@ -76,7 +76,10 @@ public class TosAndUmaFragmentView extends FrameLayout {
mShadow = findViewById(R.id.shadow);
// Set up shadow.
// Needed when scrolling to/away from the bottom of the ScrollView.
mScrollView.getViewTreeObserver().addOnScrollChangedListener(this::updateShadowVisibility);
// Needed when other elements are added / removed from ScrollView.
mScrollView.getViewTreeObserver().addOnGlobalLayoutListener(this::updateShadowVisibility);
// Cache resource dimensions that used in #onMeasure.
mImageBottomMargin = getResources().getDimensionPixelSize(R.dimen.fre_image_bottom_margin);
......
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