Skip to content

Commit

Permalink
Fix layout in casting screen
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Android][Fixed] - Fix StatusBar not updating to use translucent values when set to the same value across different activities

With native nav we open routes in a new activity. Each activity has its own StatusBar configured so we need to ensure it is configured properly.
Currently since the statusBar RN component avoids changing the StatusBar if the value hasn't changed it never gets updated and doesn't become translucent this results in all our padding being off since we add padding to account for the status bar

Reviewed By: yungsters

Differential Revision: D34810143

fbshipit-source-id: 5e382026fb89542fe0c8f6ab396f2fbeedee7a05
  • Loading branch information
Vegas Murphy authored and facebook-github-bot committed Mar 11, 2022
1 parent 31f0796 commit d34a75e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Libraries/Components/StatusBar/StatusBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,12 @@ class StatusBar extends React.Component<Props> {
if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) {
NativeStatusBarManagerAndroid.setHidden(mergedProps.hidden.value);
}
if (!oldProps || oldProps.translucent !== mergedProps.translucent) {
// Activities are not translucent by default, so always set if true.
if (
!oldProps ||
oldProps.translucent !== mergedProps.translucent ||
mergedProps.translucent
) {
NativeStatusBarManagerAndroid.setTranslucent(mergedProps.translucent);
}
}
Expand Down

0 comments on commit d34a75e

Please sign in to comment.