Skip to content

Commit

Permalink
fix: disable shadow if needed (#516)
Browse files Browse the repository at this point in the history
mAppBarLayout is created on every screen change so we need to check if the shadow shouldn't be disabled. This method is needed here since the if clause in setToolbarShadowHidden will return false e.g. when going back to the previous screen.
  • Loading branch information
WoLewicki committed May 18, 2020
1 parent aca5c18 commit b1f9fdd
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ public View onCreateView(LayoutInflater inflater,
AppBarLayout.LayoutParams.MATCH_PARENT, AppBarLayout.LayoutParams.WRAP_CONTENT));
view.addView(mAppBarLayout);

if (mShadowHidden) {
mAppBarLayout.setTargetElevation(0);
}

if (mToolbar != null) {
mAppBarLayout.addView(recycleView(mToolbar));
}
Expand Down

0 comments on commit b1f9fdd

Please sign in to comment.