Commit Graph

172 Commits

Author SHA1 Message Date
Krzysztof Magiera
752d6c0f04 Bump version -> 2.0.0-alpha.8 2.0.0-alpha.8 2019-11-06 22:04:14 +01:00
Krzysztof Magiera
a017713efc Fix screen container layout on Android. (#217)
This is a similar fix to the one already merged in #215 but for Android this time. We change default screen container to layout its direct children without using flexbox. This is to follow the same pattern as with native stack container.
2019-11-06 21:57:31 +01:00
Krzysztof Magiera
26384b625e Use fragment manager back stack to handle hw back button presses on Android. (#216)
Before this change we'd rely on new androidx OnBackPressedCallback mechanism. It turns out not to work well in a few cases. The biggest problem with it was that when registered it'd never allow for the hw back button press to fallback to a system default behaviour and instead would always "still" that event. After several attempts of trying to make it work I decided to revert back to a FragmentManager's default solution.

This change adds an ability to use FragmentManager's back stack API. There are also a few problems with it we need to workaround though. One of the problem is the fact that we can not modify back stack history. What we do because of that is that we try to keep at most one item on the back stack and reset it each time our native stack updates. In order for that to work we create a fake transaction that hides and shows the same screen that displays on top. Thanks to that when hw back is pressed the built in transaction rollback logic does nothing to the UI and allows us to handle back navigation using back stack change listener.
2019-11-06 21:54:19 +01:00
Krzysztof Magiera
5d5e8bfca6 Fix screen container after rnsscreen layout change. (#215)
For native stack we introduced a new way of layouting screen controllers. We no longer rely on flexbox to layout them so that we can use native stack to provide a correct dimensions and safe area paddings. Unfortunately this change broke the old screen container. With this commit we are adapting layout change to old screen container that will now layout its direct children on the native side by making them take up the whole space of the container.
2019-11-06 21:54:05 +01:00
Sunny Luo
2536837795 Fix compile error on xcode 10 (#212) 2019-11-05 14:05:23 +01:00
osdnk
20650a8ede Bump -> 2.0.0-alpha.7 2.0.0-alpha.7 2019-10-31 12:22:48 +01:00
Michał Osadnik
ee0dbfe8ae Revert "Fix deprecated items (#156)" (#209)
This reverts commit 5a9b3d1408.
2019-10-31 12:15:40 +01:00
Krzysztof Magiera
23cbc009d4 Bump version -> 2.0.0-alpha6 2019-10-25 14:19:24 +02:00
Krzysztof Magiera
f21a093918 Make it possible for iOS largeTitle to collapse while scrolling. (#202)
iOS navbar largeTitle setting allows the navbar to be automatically collapsed when scrolling. For that to work iOS expects scrollable component to be rendered in the screen view hierarchy as a first children (or just to be looked up on the ancestor path using first children when navigating down). On top of that in RN we should use contentInsetAdjustmentBehavior="automatic" for SV's contentInsets to adjust as expected when the header scrolls and to allow for the SV background to be present below the navigation bar.

This works pretty well w/o any changes. However when testing I disovered one issue with the navigation bar rendering in a collapsed state on the first render. After that you could've scroll down to reveal large title bar but the initial state would be collapsed. As on iOS it is expected for large title enabled screens to initially render in the revealed state a workaround was required. It turned out that the header rendered in collapsed state because at the moment when navigation controller is created is has an empty list of view controllers. The list is empty because react first creates nnavigation controller and only then adds children to it. It turned out the fix was to populate viewControllers with a single item at first, then when controllers list is replaced with the children provided from react the header renders properly in the revealed state.
2019-10-25 14:17:59 +02:00
Krzysztof Magiera
1d4712acbd iOS13 header customization updates. (#201)
This change makes it possible for header customization options to use appearence API introduces in iOS 13. Thanks to this the default header setting will respect header translucency. Thanks to the appearence API we no longer need to set so many properties in setAnimatedConfig.
2019-10-25 14:06:55 +02:00
Janic Duplessis
09c71a45a2 Remove es exports from screens.native.js (#193)
Follow up of 4749405d64, let's remove the es exports from this file to avoid confusion. It uses `module.export`.
2019-10-23 23:01:50 +02:00
Janic Duplessis
79e664f11d Fix iOS version runtime checks in RNSScreenStackHeaderConfig (#195)
- `@available` should not be used with other conditions (not sure if it breaks anything but it does trigger warnings in xcode)
- missing runtime check before using `modalInPresentation`, kept the precompiler instruction so it still builds on older xcodes.
2019-10-23 23:01:29 +02:00
Ferran Negre
b622abc935 fix: typo pops = props (#197) 2019-10-23 23:00:23 +02:00
Krzysztof Magiera
7d4bbb8f88 Some compatibility adjustments for react-navigation bindings (#196) 2019-10-23 16:04:50 +02:00
Krzysztof Magiera
7c304a007f Expose 'hideShadow' option in react naviation bindings (#192) 2019-10-22 23:57:39 +02:00
Krzysztof Magiera
adf3333462 Avoid calling deprecated cancel method on a root view (#191) 2019-10-22 23:41:35 +02:00
Krzysztof Magiera
d4636d3130 Android native stack bugfixes. (#190)
A few bugs fixed with android native stack in this commit:
 - fixed a problem with views not resizing when keyboard appears, the bug was due to onMeasure forwardin getHeight which was the old height of the container instead of the changed one
 - fixed a problem with back button behavior not being consistent. Now back button is controlled by 'gestureEnabled' to emulate iOS behavior where there is no hw back button but you can swipe back instead.
 - added compatibility for "contained" modal styles - for now we always render "containted" fragments on Android, plan to add a way to render in dialogs in the future
2019-10-22 23:22:48 +02:00
Krzysztof Magiera
4749405d64 Fix useScreens -> enableScreens renaming (#189)
There was a bug in PR that introduces enableScreens method to replace useScreens. The bug was that the method did not end up being exported (we use module.exports and not export syntax). On top of that I'm adding a deprecation warning to useScreens method as it interferes with some react hooks tooling.
2019-10-22 23:17:24 +02:00
osdnk
faff1138f7 Bump to 2.0.0-alpha.5 2.0.0-alpha.6 2.0.0-alpha.5 2019-10-21 11:38:02 +02:00
Janic Duplessis
b9473ccb04 Support fade in animation for modals on iOS (#186)
Supporting fade in for modals can be done by using `modalTransitionStyle = UIModalTransitionStyleCrossDissolve`. For other type of animations we leave this as the default value.

Tested via `@react-navigation/native-stack` with `{ animation: 'fade', presentation: 'transparentModal' }`
2019-10-21 11:35:52 +02:00
David
5cfe3f2814 Apply custom title font attributes to largeTitle (#183) 2019-10-21 09:03:43 +02:00
Janic Duplessis
c7f5fe6554 Fix RN version check when using master (#182) 2019-10-21 09:01:43 +02:00
Janic Duplessis
535902014d Fix non-default modal presentation styles (#185)
* Fix non-default modal presentation styles

Using alternative modal presentation styles like `transparentModal` is not working. This is because accessing `presentationController` before setting the `modalPresentationStyle` causes the presentation controller to be created and cannot be changed afterwards. This is documented https://developer.apple.com/documentation/uikit/uiviewcontroller/1621426-presentationcontroller?language=objc.

Yes very cool API

Tested via @react-navigation/native-stack using presentation: 'transparentModal'.

* Update RNSScreen.m
2019-10-21 09:01:02 +02:00
Krzysztof Magiera
4a9a3a877a Fix header rendering – layout and transparency (#184)
* Let UINavController control subcontroller view's frames.

This PR changes the way we've been handling yoga <> NavController layout interactions. Now we ignore frame updates coming from react for the main Screen view to allow NavController take the controll. In order to keep yoga working we now use `setSize` to pass the dimensions of the view back to yoga such that it can properly calculate layout of the views under Screen component.

* Header resizing fixes for Android.

In this change we use CoordinatorLayout as a stack screen container to handle rendering of toolbar and screen content. Thanks to this approach we can support collapsable bars in the future. Instead of relying on RN to layout screen container when renered under ScreenStack we rely on Android native layout to measure and position screen content and then use UIManager.setNodeSize to communicate that back to react.
2019-10-18 15:08:39 +02:00
Lorenzo Sciandra
c590283359 Enhancement: change to useScreens to enableScreens (#99)
This wants to be a small PR to improve the usability of the library, based on this conversation: https://twitter.com/grifotv/status/1127847192067215360.

Since the release of RNS there has been a new major player in the React game: hooks. And sadly `useScreens` recalls too closely Hooks, and this can lead to misunderstanding.

Changing it to `enableScreens` will make the difference clear, but at the same time it will be a BREAKING CHANGE for everyone using the lib.

So if we prefer to keep it around as useScreens I'm ok with it too, and we can close this.

Also, I did some tweaks to the README + fix some typos.
2019-10-11 21:57:48 +02:00
osdnk
77b1e14288 Bump -> 2.0.0-alpha.4 2.0.0-alpha.4 2019-10-11 13:00:25 +02:00
Krzysztof Magiera
cb710c63f7 Fix iOS Example project after upgrade to RN 61 (#179) 2019-10-10 21:08:36 +02:00
Krzysztof Magiera
2d54b76cb6 Update Example app to RN 0.61 (#177) 2019-10-09 11:05:37 +02:00
Satyajit Sahoo
f5477eb9e0 Remove usage of ScenesReducer (#174)
See #173
2019-10-09 09:42:25 +02:00
Michał Osadnik
b8dcda3f7a Call update bounds after transition (#175) 2019-10-09 09:25:20 +02:00
Krzysztof Magiera
7620c541da Fix header config when navigating back gets cancelled. (#171)
This change fixes the problem when header would update to the previous screen configuration as a result of starting swipe back gesture but never restore to the original one in case swipe back gets cancelled (e.g. user didn't swipe far enough). The problem was that as a result of swipe back we'd apply header config changes but after cancel there was no trigger to reset header to the previous state.
2019-10-03 11:56:29 +02:00
Krzysztof Magiera
a229904b57 Implement full screen modals on iOS (#170)
On iOS by default modals show up in full-screen mode. This behavior can be customized and instead of mouting new screens in top level window they can be mounted under a given UINavController. We used to be relying on that behavior (see "CurrentContext" presentation mode). This, apparently wasn't matching the default functionality of the OS. This change is adding it as a default and keeping the old way under newly exposed presentation modes: containedModal and containedTransparentModal

Thanks to this change, iOS 13 modals can work properly.
2019-10-03 11:54:49 +02:00
Brent Vatne
0bf6a2c6cc Merge pull request #165 from magicismight/patch-2
fix typo
2019-09-27 11:19:33 -07:00
Horcrux
8e71d75fe6 fix typo 2019-09-27 18:04:19 +08:00
Michel dos Santos Kuguio
5a9b3d1408 Fix deprecated items (#156)
* Fix deprecated items

Fix deprecated items

* fix deprecated items

fix deprecated items
2019-09-25 10:44:28 +02:00
Alain Hufkens
5281c1b553 Adds tvOS platform to the Podspec (#157)
* Add tvOS platform

* Correct Podspec
2019-09-25 10:43:58 +02:00
Krzysztof Magiera
c1540d395b Bump version -> 2.0.0-alpha3 2.0.0-alpha3 2.0.0-alpha.3 2019-09-09 15:14:56 +02:00
Krzysztof Magiera
6508386424 Fix issue with soft keyboard not showing from time to time on Android (#152) 2019-09-09 15:14:24 +02:00
dependabot[bot]
de9bfc3021 Bump extend from 3.0.1 to 3.0.2 (#143)
Bumps [extend](https://github.com/justmoon/node-extend) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/justmoon/node-extend/releases)
- [Changelog](https://github.com/justmoon/node-extend/blob/master/CHANGELOG.md)
- [Commits](https://github.com/justmoon/node-extend/compare/v3.0.1...v3.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:40:33 +02:00
dependabot[bot]
797a41cd54 Bump merge from 1.2.0 to 1.2.1 (#142)
Bumps [merge](https://github.com/yeikos/js.merge) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/yeikos/js.merge/releases)
- [Commits](https://github.com/yeikos/js.merge/compare/v1.2.0...v1.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:40:17 +02:00
dependabot[bot]
8567af05fe Bump mixin-deep from 1.3.1 to 1.3.2 (#146)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:36:08 +02:00
dependabot[bot]
2c6e99223e Bump morgan from 1.9.0 to 1.9.1 (#145)
Bumps [morgan](https://github.com/expressjs/morgan) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/expressjs/morgan/releases)
- [Changelog](https://github.com/expressjs/morgan/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/morgan/compare/1.9.0...1.9.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:35:54 +02:00
dependabot[bot]
fefe4a4fdc Bump react-dom from 16.4.1 to 16.4.2 (#140)
Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) from 16.4.1 to 16.4.2.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v16.4.2/packages/react-dom)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:35:34 +02:00
dependabot[bot]
171eb42b62 Bump lodash from 4.17.10 to 4.17.15 (#133)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.10 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.10...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:35:23 +02:00
dependabot[bot]
bf7db1d348 Bump handlebars from 4.0.12 to 4.2.0 in /Example (#147)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.0.12 to 4.2.0.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.0.12...v4.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:35:15 +02:00
dependabot[bot]
034fbb3f12 Bump js-yaml from 3.12.0 to 3.13.1 (#108)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.0 to 3.13.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.12.0...3.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:34:47 +02:00
dependabot[bot]
cf2bf00b23 Bump handlebars from 4.0.11 to 4.1.2 (#110)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.0.11 to 4.1.2.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.0.11...v4.1.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:34:31 +02:00
dependabot[bot]
8c8b52cd4e Bump js-yaml from 3.12.0 to 3.13.1 in /Example (#107)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.0 to 3.13.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.12.0...3.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:34:02 +02:00
dependabot[bot]
6de1282412 Bump mixin-deep from 1.3.1 to 1.3.2 in /Example (#144)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:33:51 +02:00
dependabot[bot]
db725d4cce Bump lodash from 4.17.11 to 4.17.15 in /Example (#148)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-09 10:33:39 +02:00