Repository navigation
fix(Android): header shadow not hidden on go back - #2216
Merged
Merged
Conversation
kkafar
approved these changes
Jun 27, 2024
kkafar
left a comment
Member
There was a problem hiding this comment.
I think this change is ok, because it improves the situation.
However:
Important
We should research whether setting stateListAnimator to null here and in the other setters do not remove some system/material defined appbar animations. Let's put a task on our board for that.
alduzy
added a commit
that referenced
this pull request
Jun 28, 2024
## Description This PR intents to fix header shadow not being hidden after navigating back to a screen. The bug was visible when using `headerTransparent: true` option. The origin of this bug is [This PR](#2116) fixing build depracations. Setting the `elevation` on appBarLayout requires resetting the `stateListAnimator` to work properly, as opossed to deprecated `targetElevation` used before. For more info visit: https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout#setTargetElevation(float) Fixes #2212 . ## Changes - added missing `appBarLayout?.stateListAnimator` reset. ## Screenshots / GIFs Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. ### Before  ### After  ## Test code and steps to reproduce 1. use `Test1097.tsx` repro 2. navigate into second or third screen 3. go back to the first screen ## Checklist - [x] Included code example that can be used to test this change - [x] Ensured that CI passes
Contributor
|
Just a small comment from me, that's a great change! Good catch, Alex 💪 I was wondering why header has such an ugly shadow after setting its style to transparent. |
Closed
3 of 11 tasks
High5Apps
added a commit
to High5Apps/organize-rn
that referenced
this pull request
Aug 6, 2024
- Repro on Android only by navigating to the Discuss tab, tapping a post or new discussion button, then navigating back to the Discuss tab and seeing that the top tabs shadow is no longer hidden, despite still having `headerShadowVisible: false` - Fix by updating react-native-screens from 3.32.0 to 3.34.0 - `npm update react-native-screens` - react-navigation/react-navigation#12063 software-mansion/react-native-screens#2216
This was referenced Aug 23, 2024
This was referenced Aug 30, 2024
This was referenced Sep 22, 2024
This was referenced Sep 24, 2024
ja1ns
pushed a commit
to WiseOwlTech/react-native-screens
that referenced
this pull request
Oct 9, 2024
) ## Description This PR intents to fix header shadow not being hidden after navigating back to a screen. The bug was visible when using `headerTransparent: true` option. The origin of this bug is [This PR](software-mansion#2116) fixing build depracations. Setting the `elevation` on appBarLayout requires resetting the `stateListAnimator` to work properly, as opossed to deprecated `targetElevation` used before. For more info visit: https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout#setTargetElevation(float) Fixes software-mansion#2212 . ## Changes - added missing `appBarLayout?.stateListAnimator` reset. ## Screenshots / GIFs Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. ### Before  ### After  ## Test code and steps to reproduce 1. use `Test1097.tsx` repro 2. navigate into second or third screen 3. go back to the first screen ## Checklist - [x] Included code example that can be used to test this change - [x] Ensured that CI passes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR intents to fix header shadow not being hidden after navigating back to a screen. The bug was visible when using
headerTransparent: trueoption.The origin of this bug is This PR fixing build depracations. Setting the
elevationon appBarLayout requires resetting thestateListAnimatorto work properly, as opossed to deprecatedtargetElevationused before.For more info visit: https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout#setTargetElevation(float)
Fixes #2212 .
Changes
appBarLayout?.stateListAnimatorreset.Screenshots / GIFs
Here you can add screenshots / GIFs documenting your change.
You can add before / after section if you're changing some behavior.
Before
After
Test code and steps to reproduce
Test1097.tsxreproChecklist