Skip to content

Commit

Permalink
Access to PixelUtil.toPixelFromDIP when it is necessary (#1016)
Browse files Browse the repository at this point in the history
Instead of assigning PixelUtil.toPixelFromDIP to static variable, use it when it is necessary to fix crash from #1008.
  • Loading branch information
sercand committed Aug 2, 2021
1 parent c3998ad commit 3641490
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

public class ScreenStackFragment extends ScreenFragment {

private static final float TOOLBAR_ELEVATION = PixelUtil.toPixelFromDIP(4);
private AppBarLayout mAppBarLayout;
private Toolbar mToolbar;
private boolean mShadowHidden;
Expand Down Expand Up @@ -59,7 +58,7 @@ public void setToolbar(Toolbar toolbar) {

public void setToolbarShadowHidden(boolean hidden) {
if (mShadowHidden != hidden) {
mAppBarLayout.setTargetElevation(hidden ? 0 : TOOLBAR_ELEVATION);
mAppBarLayout.setTargetElevation(hidden ? 0 : PixelUtil.toPixelFromDIP(4));
mShadowHidden = hidden;
}
}
Expand Down

0 comments on commit 3641490

Please sign in to comment.