Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add better shadow handling for newer apis #488

Closed
wants to merge 2 commits into from

Conversation

WoLewicki
Copy link
Member

When headerHideShadow is set to true on a screen, pushing another screen on top of it and then going back makes the shadow appear again. It looks like a problem with the usage of deprecated method setTargetElevation. This change fixes the problem on the newer APIs by using another method of changing the elevation. Should resolve #484.

StateListAnimator stateListAnimator = new StateListAnimator();
stateListAnimator.addState(new int[0], ObjectAnimator.ofFloat(mAppBarLayout, "elevation",hidden ? 0 : TOOLBAR_ELEVATION));
mAppBarLayout.setStateListAnimator(stateListAnimator);
} else if (mShadowHidden != hidden) {
mAppBarLayout.setTargetElevation(hidden ? 0 : TOOLBAR_ELEVATION);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it even worth keeping this around?

@chirag04
Copy link
Contributor

@WoLewicki would be great to ship this as well. thank you for the fix. 🙌

@WoLewicki
Copy link
Member Author

Closing due to #516.

@WoLewicki WoLewicki closed this May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Header hide shadow on android do not work
2 participants