Commit Graph

70 Commits

Author SHA1 Message Date
Brent Vatne
e4caff2cee chore: move core/native to peerDependencies 2019-08-18 23:32:33 +05:30
Brent Vatne
d9f142a6fd Fix example project 2019-08-18 23:32:32 +05:30
Eric Vicenti
fb09ca5ad3 move to react-navigation core and native 2019-08-18 23:32:32 +05:30
Brent Vatne
498ca98b2f Handle case where screensEnabled isn't available (in Snack) 2019-08-18 23:32:30 +05:30
Krzysztof Magiera
835e988502 Use react-native-screens when available (#54)
This change adds support for react-native-screens. Screens package makes it possible to use native primitives to render tabs container and its scenes such that they get properly mounted/unmounted when not visible.

The support has only been added to `createBottomTabNavigator` as the material one renders its own container that's a part of a different package (react-native-tab-view).
2019-08-18 23:32:27 +05:30
Jonny Burger
0550775fa3 Upgrade react-native-safe-area-view (#44)
* Update react-native-safe-area-view

* import SafeAreaView from react-navigation
2019-08-18 23:32:26 +05:30
Brent Vatne
1ec940479c Pass horizontal prop into tabBarIcon for bottom tabs, fix default background color, fix text sizes 2019-08-18 23:32:25 +05:30
Brent Vatne
6d7240f815 Fix formatting and flow errors 2019-08-18 23:32:24 +05:30
Nicolas Charpentier
18fa1315cf feat: lazy initialized MaterialTopTabNavigator routes (#9)
Routes in `MaterialTopTabNavigator` are now lazy initialized like in `MaterialBottomTabNavigator`.

A scene visibility is computed from multiple states and props:

To handle the pan between tabs, we check if you're currently swiping between tabs and the prop `lazyOnSwipe` is true (default value) or if the tab have been already loaded, we'll check if this tab is a sibling of the focused tab. Then, we'll display the tab if it's a sibling.

~With the prop `animationEnabled` to true, we shouldn't hide a tab before the transition is done. So we're waiting `COMPLETE_TRANSITION` action to hide it. Also, if the prop `sceneAlwaysVisible` is true (default value), we won't hide scenes between A and D while transitioning.~

If the current tab has not been loaded and must not be visible, we do not render it.

I'll update the docs accordingly to this PR.

![tabs-2](https://user-images.githubusercontent.com/7189823/38261082-3bd30d04-3737-11e8-854e-684430db771f.gif)

<!--
#### Default behavior
Tabs are lazy initialized on swipe or focus and are always visible while transitioning.

![tabs-1](https://user-images.githubusercontent.com/7189823/38260989-060f5808-3737-11e8-87ed-d138fec6022b.gif)

#### Hide tabs between while transitioning

```js
{
  sceneAlwaysVisible: false,
}
```

![tabs-2](https://user-images.githubusercontent.com/7189823/38261082-3bd30d04-3737-11e8-854e-684430db771f.gif)

#### Fallback to only lazy initialized tabs on focus

```js
{
  lazyOnSwipe: false,
}
```

![tabs-3](https://user-images.githubusercontent.com/7189823/38261164-7bcc6018-3737-11e8-8758-de71d28218ae.gif)

-->
2019-08-18 23:32:24 +05:30
Vojtech Novak
79e1dacb13 Update BottomTabBar.js (#41) 2019-08-18 23:32:23 +05:30
Satyajit Sahoo
8c3b36e864 refactor: remove unused getLabel method 2019-08-18 23:32:23 +05:30
Loch Wansbrough
172e582a9e Allows use of custom safe area inset (#32) 2019-08-18 23:32:22 +05:30
Brent Vatne
3fdb3d9293 fix: remove tab icon wrapper to fix adaptive icons 2019-08-18 23:32:21 +05:30
Brent Vatne
34b0e5d5ba feat: add an option to swap out TouchableWithoutFeedback for another component (#27) 2019-08-18 23:32:20 +05:30
Satyajit Sahoo
57a0d46350 fix: typo in accessibilityLabel 2019-08-18 23:32:19 +05:30
Daniel Basedow
4cc91d19ba feat: add accessibilityLabel and testID options (#26) 2019-08-18 23:32:17 +05:30
Satyajit Sahoo
ec4a4de327 chore: upgrade to latest react-native-tab-view 2019-08-18 23:32:17 +05:30
Satyajit Sahoo
267e9ecf0a feat: add defaultHandler argument to tabBarOnPress. fixes #22 2019-08-18 23:32:15 +05:30
Satyajit Sahoo
2a80c11691 feat: add lazy option. fixes #23 2019-08-18 23:32:14 +05:30
Satyajit Sahoo
93b45f22b9 fix: use react-lifecycles-compat for async mode compatibility 2019-08-18 23:32:13 +05:30
Ashoat Tevosyan
491ee81eda fix: fix tabBarOnPress with MaterialTopTabs and fix isFocused (#21)
* Hook up tabBarOnPress

* Move onTabPress logic to createTabNavigator

* Use old logic for determining focus state

* Use navigation.isFocused()

* Reorder jumpTo/onTabPress

* react-native-tab-view@0.0.78
2019-08-18 23:32:13 +05:30
Brent Vatne
42e35f5028 feat: put material bottom tabs in another repository 2019-08-18 23:32:12 +05:30
Brent Vatne
5d5f4d1cc3 fix: import SceneView from react-navigation default export 2019-08-18 23:32:11 +05:30
Eric Vicenti
14139e41fd Fix tab action in v2
The action helpers may not be available at the navigator level, they will be there inside the screen.

This change dispatches a normal explicit action.
2019-08-18 23:32:10 +05:30
Satyajit Sahoo
863bb2b14a chore: upgrade react-native-paper 2019-08-18 23:32:09 +05:30
Brent Vatne
3bb5ec402f fix: iPad / horizontal layout works as expected in BottomTabBar 2019-08-18 23:32:08 +05:30
Brent Vatne
273131f607 fix: NavigationActions.popToTop no longer exists, belongs to StackActions now 2019-08-18 23:32:07 +05:30
Satyajit Sahoo
3bf6fcd106 chore: update dependencies and fix flow 2019-08-18 23:32:06 +05:30
Satyajit Sahoo
fd2c35224f feat: use resource saving view for scenes. fixes #3 2019-08-18 23:32:05 +05:30
Satyajit Sahoo
a4ead48813 feat: export tab bars 2019-08-18 23:32:03 +05:30
Satyajit Sahoo
d29e51dca3 refactor: upgrade react-native-tab-view 2019-08-18 23:32:02 +05:30
Satyajit Sahoo
65b0c46ae1 feat: export individual navigators separately. fixes #2 2019-08-18 23:32:02 +05:30
Brent Vatne
ae7ed685d4 Fix incorrect method name and release 0.1.0-alpha.3 2019-08-18 23:32:01 +05:30
Brent Vatne
d16fedf61a Fix tab style in horizontal layout 2019-08-18 23:32:00 +05:30
Brent Vatne
e1313ae86b Remove wrapper around tab bar 2019-08-18 23:32:00 +05:30
Satyajit Sahoo
e60112b0a3 chore: release v0.1.0-alpha.1 2019-08-18 23:31:59 +05:30
Satyajit Sahoo
89934b93c0 feat: initial commit 2019-08-18 23:31:59 +05:30
satyajit.happy
5676dea5ac fix: don't lose child state when rehydrating in tab router 2019-08-18 13:13:17 +05:30
satyajit.happy
afa24c110e fix: don't use action.source for stack router 2019-08-18 12:03:44 +05:30
satyajit.happy
7f5f3ddb6e chore: use lowercase route names 2019-08-18 12:03:36 +05:30
satyajit.happy
dbe2b9159a feat: add helpers to convert between url and state 2019-08-18 00:12:23 +05:30
satyajit.happy
8ed54dace4 fix: handle partial initial state better when rehydrating 2019-08-18 00:12:23 +05:30
satyajit.happy
ca985bb96a feat: add integration with redux devtools extension
Currently supports:
- Tracking actions and navigation state
- Time travel for navigation state

It doesn't do anything in production
2019-08-17 22:25:06 +05:30
Michał Osadnik
b7735af7fc feat: add native container with back button integration (#48) 2019-08-14 19:34:21 +05:30
Satyajit Sahoo
4a3db4e6f4 refactor: simpler way to check canGoBack (#54) 2019-08-14 15:01:41 +01:00
Michał Osadnik
82b771aa57 refactor: simplify logic for dispatching to focused navigator (#53) 2019-08-14 18:39:23 +05:30
satyajit.happy
10a6bfdbb1 refactor: use named exports for navigators 2019-08-14 06:08:44 +05:30
Satyajit Sahoo
2b59f7e482 feat: add a useIsFocused hook to get focus state (#52) 2019-08-13 21:11:39 +01:00
Satyajit Sahoo
2b8f2edfd1 fix: implement canGoBack for tab router (#51) 2019-08-13 21:10:04 +01:00
satyajit.happy
81348959ee fix: use correct dispatch in methods in screen's navigation prop 2019-08-12 06:11:10 +05:30