Create BottomTabs once when options are applied
The BottomTabs library we use recreates its children each time a style property changes.
This can hinder performance quite a bit as the view creation logic is quite costly.
This commit introduces a simple fix to this issue - we delay view creation until all options are applied.
BottomTabs refactor
* Prevent view recreation in `onSizeChanged`
* Cleanup `createTabs` method
The following PR introduces improved support for Context api and other api's which wrap the root view.
## Context api
Navigation.registerComponent('navigation.playground.ContextScreen', () => (props) => (
<TitleContext.Provider value={'Title from Provider'}>
<ContextScreen {...props} />
</TitleContext.Provider>
), () => ContextScreen);
## Redux
Navigation.registerComponent('navigation.playground.ReduxScreen', () => (props) => (
<Provider store={reduxStore}>
<ReduxScreen {...props} />
</Provider>
), () => ReduxScreen);
## Plain Component - not changed
Navigation.registerComponent('navigation.playground.MyScreen', () => MyScreen);
This PR also upgrades the TypeScript version to 3.2.0 and RN version used in the playground app to 0.57.7
* New Android build flavor - `reactNative57_7`
* Unit test coverage is disabled, for some reason it broke after upgrading to RN 0.57.7
This commit adds a dedicated RN 57 build flavour for the Wix fork, where 506f920838 is reverted.
The revert reintroduced UiImplementationProvider which is required to pass SyncUiImplementation to UiManager.
Implement Element transition on Android
This commit adds basic support for Element transition to Android.
Currently, only Shared Transition is supported and only when pushing screens.
There are a few caveats you need to be aware of if you intend to use
this feature in its current state:
1. Since elements need to be laid out before the transition can start, Set `waitForRender: true` when pushing the destination screen.
2. Fade animation has to be used when pushing screens with shared elements.
API
```js
options: {
animations: {
push: {
waitForRender: true,
content: {
alpha: {
from: 0,
to: 1,
duration: 250
}
}
}
},
customTransition: {
animations: [
]
}
}
```
* Refactored bottomTab and bottomTabs
* Initial commit before switching to our fork of AHBottomNavigation
* Bump AHBottomNavigation version
* More work on BottomTab options
Need to merge some child options when a child is attached to parent
* Fix tests
* DefaultOptions refactor
* defaultOptions are now merged before applying options
* Handle BottomTab options in dedicated presenter
* Create BottomTabs in BottomTabsController.createView() instead of constructor
* Set bottomTab TypeFace
* Update Android installation guide
* fixed unit tests
* Fix unit tests
Kind of a workaround
* Handle NPE in getPreferredHeight
If a view hasn't been attached yet, return 0 height
* Apply BottomTab text and icon color individually
wix-playground/AHBottomNavigation does not support setting color for the entire tab (icon and text),
instead it supports setting color individually to text and icon. Another change is that it no longer supports
default color for icons. If icon color is undefined - it won't tint the icon.
* Add getCurrentChild to ParentController contract
* Clear backButton when setting stack root
* Add ViewController.resolveCurrentOptions
resolveCurrentOptions merges the controllers options with all of its current children
* StackController refactor
* Create pushed child view only in StackController.createView
* When initialising a stack with multiple children, only create the top child's view
* StackController constructor now accepts children
* When pushing child to stack, apply options that change LayoutParams
* Apply BottomTabs layout options when tab views are created
* bototmTab changes in iOS
* options fix
* Fixes options propagating
* Support RN 0.55.4
This commit adds support for RN 0.55.4 by introducing version specific build flavors - reactNative51
* Update scripts after introducing build flavors
* Update Android installation instruction on specifying build flavor
* basic fab
* fab menu
* fab menu clicks
* pop lifecycle
* options lifecycle
* refactoring
* refactor
* parse unit tests
* refacotr
* fix test
* align
* fab unit tests
* more tests
* size
* hide on scroll in progress
* options
* menu collapse
* parser test
* merge v2
* refactor
* refactor
* more refactor
* more refactor
* fix
* more refactoring
* refactor
* refactor
* fix
* fix
* fixed undefined key
* refactor
* refactor
* refactort
* Use AHBottomNavigation for BottomTabs
* Process passed options for all layout types
Static options are still processed only for components
* ios e2e fix
* Update RNNNavigationController.m
Further work on TopTabs and some refactoring (#2362)
* Further work on TopTabs and some refactoring
* OptionsPresenter receives views as params
* Remove TopBar and style logic from ViewControllers, these are the OptionsPresenters concern
* StackAnimator isn't coupled to LinearLayout
* Convert Runnable to lambda
* ContainerLayout now implements ReactContainer interface
* Enable desugaring in playground app
* TopTabs unit tests