When toggleTabs was called, the visibility state of the BottomTabs
was not persisted. There for, when pushing a screen and popping
the BottomTabs visibility state was set to the value of bottomTabsHidden
from navigatorStyle.
This commit continues the work done in #2057.
When hardware back button is pressed, we handle it accordingly:
1. If screen was pushed with `overrideBackPress: true`, we emit `backPress` event
2. Let `BackHandler` handle the event
3. If the event wasn't handled by `BackHandler`, pop the stack
4. let the system handle the event
* added method for getting the currently visible screen ID. Can be useful to decide if logic should be applied according to screen visibility, for example: set buttons/title dynamically, or even determine that you don’t need to show the same screen again if it’s the current one that’s showing
* Implement getCurrentlyVisibleScreenId on Android
Can be used statically:
Navigation.getCurrentlyVisibleScreenId() - returns the unique screen
instance id
With a navigator instance:
await this.props.navigator.screenIsCurrentlyVisible() - resolves a
promise that checks if the current screen is visible
* Add screen visibility listener which can be registered globally
API
new ScreenVisibilityListener({
willAppear: ({screen, timestamp}) => console.log(`Displaying screen ${screen}`),
didAppear: ({screen, timestamp}) => console.log(`Screen ${screen} displayed in ${Date.now() - timestamp} millis`)
}).register();
todo
* Add timestamp to modal, resetTo
* implement unregister
* implement iOS
* Add global screen visibility listener to example app
* Think I better assign a value to emitter
* Send timestamp in resetTo
* Moved listener to library, it can be deleted from the app
* Add push and resetTo buttons to pushed screens
* Send appear/disappear events after animation ends
* Pass pop timestamp from js
* Send timestamp in popToRoot
* Add popToRoot button in push screen
* Add few navigation buttons to modal screen
* Pass timestamp to tabs
relevant only to first/initial tab
* Update timestamp when navigating between BottomTabs
* Send screen visible events after modal dismiss
* log willDisappear and didDisappear
* Report both start and end timestamps
* Implement unregister
* Send NavigationType parameter in visibilityEvent
This indicates the type of the navigation command that triggered the visibility change
* Rename pushInitialScreen to more explicit name
* Fix duplicate initialScreen visibility events
* Update screen visibility log statement
* Show popToRoot in modal screen only if screens were pushed
* implement global screen event for iOS
* fix lint issues
Since fab set dynamically wasn’t saved in screen params, when returning
to that screen the fab wasn't displayed.
This commit also enables setting fab dynamically in modals
dismissInAppNotification support on android. (#687)
* Add .hideInAppNotification on android.
- Separate hide and show animations.
- Implement a little bit of throttling around successive calls to .showInAppNotification
* Update example to demo dismiss.
* Don’t create SideMenu button automatically on Android
* Remove left button and add it dynamically
* Fix resetTo animation on Android
Up until now resetTo would destroy the current stack and create a new
one. This was an easy implementation but resulted in jurky
(none existent) animations.
This commit changes resetTo behavior. Instead of recreating the stack,
the we reset to is pushed to the stack, and the other elements are
removed when show animation ends.
Sends a nav event whenever the sideMenu button is clicked. (Android) (#617)
* Dispatch a navigation event whenever the side menu button is clicked (BottomTabsLayout)
* Dispatch a navigation event whenever the side menu button is clicked (SingleScreenLayout)
* Changed the way the navigatorEventId is retrieved in SingleScreenLayout.
Set BottomTabs background color only if it is defined
This change means that in a tab based app, when pushing a screen
which did not declare `tabBarBackgroundColor` - the BottomTabs color
will persist from the previous screen and not be set to the default
color which is white. This eliminates the unwanted BottomTabs
background color change in this specific use case.
closes #409
When ivoking navigation actions such as push, pop etc, instead of
checking modal visibility, check if modal actually contains the given
navigator. This fix alows to change navigation state in screens while
modal is displayed.
* Don't show fab of a screen that's pushed to a none active tab
* Change fab when navigating back in the stack with back button
* Add screens before SnackbarAndFabContainer