* 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
Add font size support on title bar for android (#1493)
* Add font family support on bottom tabs
* import missing classes
* import missing class
* update document
* Support customize icon for left nav button in android
* Add navBar navBarTextFontSize support for android
Currently startApp is called from global context which results in the
app being launched when headlessJs tasks run in the background.
In order to support this use case, while not breaking existing users,
this commit adds two mechanisms which should help users detrmine if
the native Activity is running and startApp can be called safely.
1. RNN.appLaunched event is emitted is SplashActivity starts and react
context has already been created. This is the use case of openeing
the app while headless js task was started or has just finished and
react context is in a "pasued" state.
2. Navigation.isAppLaunched() convenience method has been added.
It returns a promise which when resolved, indicates if the app
is launched and we should show the ui or not.
Usage
import {Navigation, NativeEventsReceiver} from 'react-native-navigation';
Promise.resolve(Navigation.isAppLaunched())
.then(appLaunched => {
if (appLaunched) {
startApp();
} else {
new NativeEventsReceiver().appLaunched(startApp);
}
});
function startApp() {
Navigation.startTabBasedApp({ ... });
}
[iOS] Allow lightbox tap to dismiss without background color (#1440)
* Move logic for tap background to dismiss out of background color view
This allows for tapping the background without setting a color here, meaning this feature can be enabled with one less view in the view hierarchy
* Only allow taps on views that aren't the React view
This allows for taps on any background view, visual effect view, color tint view, etc, but not on the content.
Fixes #1411
Each time a color attribute is set in AHBottomNavigation, all items in
the BottomTabs are recreated. If a badge is set, it is animated each
time items are recreated. This behaviour can even be seen in the gifs
in the repo https://github.com/aurelhubert/ahbottomnavigation