Commit Graph

562 Commits

Author SHA1 Message Date
Krzysztof Magiera
64900495f4 fix: change opacity for hidden tabs only when not using rn-screens (#80)
When using react-native screens we don't need to hide invisible tabs using opacity. This in conjunctions with "active" property normally used by screens where causing blinking effect when new tabs got activated as in some cases opacity would update in a different UI transaction (this would only surface on Android).

This change removes the use of `opacity` style when react-native-screens are active and solely relies on `active` property in that case. When rn-screens are off we fallback to rendering `View` and use `opacity` as before (this is now done in `ResourceSavingScene`).

### Motivation

Fix blinking effect on Android when switching tabs [#5382](https://github.com/react-navigation/react-navigation/issues/5382)

### Test plan

1) Run RN-screens sample app with and w/o screens enabled or try the code from this snack -> https://snack.expo.io/rklSkM-xE
2) Try this on a low end Android device for consistent repro
3) Switch between tabs and see the content disappear for one frame with screens ON when this change isn't active and see this issue gone with this change applied
2019-08-18 23:32:40 +05:30
Brent Vatne
c80654e29f Release 1.0.1 2019-08-18 23:32:39 +05:30
mmtootmm
8a4ef3f18d Fix renderPager undefined override (#70) 2019-08-18 23:32:39 +05:30
Brent Vatne
a138bb0637 Update devDependencies 2019-08-18 23:32:38 +05:30
Brent Vatne
634b6c429c Release 1.0.0 2019-08-18 23:32:38 +05:30
Brent Vatne
1b2532b1a1 Fix active and inactive tint colors - thanks to @CrazyPython - Original: https://github.com/react-navigation/react-navigation-tabs/pull/35 2019-08-18 23:32:37 +05:30
Jonny Burger
331055c24b implement onTabLongPress event handler (#66)
* implement onTabLongPress event handler

* style fix

* defaultHandler for long press
2019-08-18 23:32:37 +05:30
Brent Vatne
8ecc08bcf7 chore: release 1.0.0-alpha.5 2019-08-18 23:32:36 +05:30
Brent Vatne
a5514a2f24 fix: tweak hitSlop on bottom tab bar buttons 2019-08-18 23:32:36 +05:30
Brent Vatne
66ae51869f chore: fix flow error 2019-08-18 23:32:35 +05:30
Yao Hui Chua
b797801e8f Fix bottom tab voiceover (#61)
* Fix bottom tab voiceover

* Remove isBottom check

* Update MaterialTopTabBar

* Remove unnecessary props on route
2019-08-18 23:32:35 +05:30
Brent Vatne
b1deb7031b chore: release 1.0.0-alpha.4 2019-08-18 23:32:34 +05:30
Brent Vatne
9280cc10be Emit refocus event, add example that uses it 2019-08-18 23:32:34 +05:30
Brent Vatne
42838ab35b chore: bump version 2019-08-18 23:32:33 +05:30
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
242cd9901e Published 0.8.4 https://npm.community/t/unable-to-install-newly-published-package-version/2628 2019-08-18 23:32:31 +05:30
Brent Vatne
80922750ad Release 0.8.3 2019-08-18 23:32:30 +05:30
Brent Vatne
498ca98b2f Handle case where screensEnabled isn't available (in Snack) 2019-08-18 23:32:30 +05:30
Eric Vicenti
7812866f70 Distribute source (#59)
By shipping source files and setting the ‘react-native’ entry point to src, the RN packager can parse the module and provide source maps when debugging from your app. This makes the install slightly heavier but is worth it for the improved ergonomics.
2019-08-18 23:32:29 +05:30
Brent Vatne
5c21015555 Release 0.8.2 2019-08-18 23:32:29 +05:30
Brent Vatne
d44ec52023 More loose peer dependency 2019-08-18 23:32:28 +05:30
Brent Vatne
8bded17008 Move react-native-screens to a peer dependency 2019-08-18 23:32:28 +05:30
Brent Vatne
c56edc3e46 Release 0.8.0 2019-08-18 23:32:27 +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
Brent Vatne
20e30f5ced Release 0.7.0 2019-08-18 23:32:26 +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
fdcb4df8f2 Release 0.6.0 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
c632bdd746 chore: release 0.5.1 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
5932ef88c4 chore: release v0.5.0 2019-08-18 23:32:21 +05:30
Brent Vatne
87ea8d80ab fix: change prepublish to prepare to fix warning 2019-08-18 23:32:20 +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
669a681174 chore: release v0.4.1 2019-08-18 23:32:19 +05:30
Satyajit Sahoo
57a0d46350 fix: typo in accessibilityLabel 2019-08-18 23:32:19 +05:30
Satyajit Sahoo
98b90d5572 chore: release v0.4.0 2019-08-18 23:32:18 +05:30
Satyajit Sahoo
987d54d96b chore: add a precommit hook 2019-08-18 23:32:18 +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
6f326322da chore: improve the example app 2019-08-18 23:32:16 +05:30
Brent Vatne
6dcd2b7142 Release 0.3.0 2019-08-18 23:32:16 +05:30
Satyajit Sahoo
267e9ecf0a feat: add defaultHandler argument to tabBarOnPress. fixes #22 2019-08-18 23:32:15 +05:30
Satyajit Sahoo
47b709aff1 chore: fix flow 2019-08-18 23:32:14 +05:30