Remove SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN flag from root layout (#3654)
The flag was initially set to prevent the root layout from being pushed down when showing full screen modals.
This isn't the right approach and it also messed up keyboard handling.
To prevent the root layout from being pushed down in this scenario we should probably handle window insets
This resolves an issue where currentTabIndex, for example, was not cleared properly
if it was set in initialOptions as it was cloned each time clearOptions was invoked.
[BREAKING] Call Navigation.events().bindComponent(this) to listen to lifecycle events
This commit introduces breaking changes to the way components listen to RNN events.
Background
Up until now, components could handle navigation events by implemented a set of callbacks:
* componentDidAppear
* componentDidDisappear
* onNavigationButtonPressed
* onSearchBarUpdated
* onSearchBarCancelPressed
While this worked fine for the most part, this was completely broken for HOCs as RNN invoked these methods only on the registered component (top most HOC), leaving it to the user to propagate these events down the HOC chain. See the discussion in #1642 for more details.
Solution
In order to support HOC use case, we're introducing a new api which will let any Component bind itself to receive navigation events:
```js
class LifecycleScreen extends Component {
constructor(props) {
super(props);
this.subscription = Navigation.events().bindComponent(this);
}
componentWillUnmount() {
// The subscription is removed automatically when components unmount, but they can be explicitly removed as well by calling `this.subscription.remove(); `
}
}
```
It's still the users responsibility to propagate the `componentId` down the HOC chain, but by binding a component to RNN, it will be able to handle events as expected. Multiple components can be bound for the same `componentId`.
Consolidate event names
* onNavigationButtonPressed -> navigationButtonPressed
* onSearchBarUpdated -> searchBarUpdated
* onSearchBarCancelPressed -> searchBarCancelPressed
Merge default options before resolving animation options
Command animations did not take default options into account when resolving animation options.
This commit fixes that, TopBar options still need to be addressed.