Commit Graph

77 Commits

Author SHA1 Message Date
Satyajit Sahoo
a929933bde chore: update prettier 2020-03-23 00:02:47 +01:00
Satyajit Sahoo
44c390075f fix: don't use react-native-screens on web
seems `react-native-screens` doesn't handle active screens properly and shows a blank page
 instead on web when a number is specified in the `active` prop.

closes #7485
2020-03-19 16:43:28 +01:00
Satyajit Sahoo
72e8160537 chore: migrate to monorepo 2020-02-24 17:27:10 +01:00
Satyajit Sahoo
4147e4f869 feat: add support for pager component 2020-01-05 01:26:20 +01:00
Satyajit Sahoo
e700bb9713 fix: don't override position unnecessarily 2019-12-03 18:34:28 +01:00
Vojtech Novak
ead8cd979c fix: white block when keyboard is open (#227)
closes #206
2019-12-03 18:21:06 +01:00
Adrian Hartanto
4b940481e3 feat: add keyboardHidesTabBarAnimationConfig props (#195) 2019-10-31 21:14:45 +08:00
gewfy
5c18bee2cf fix: fix layout when starting in landscape (#192) 2019-10-21 15:08:29 +02:00
Stefan Aleksovski
ef1e400a28 feat: export BottomTabBarProps (#194) 2019-10-21 15:06:58 +02:00
satyajit.happy
a5ae81dd7f chore: update eslint config 2019-10-09 10:59:11 +02:00
satyajit.happy
584af8f7b1 fix: fix issue when setting position to absolute for tab bar 2019-10-09 10:51:06 +02:00
satyajit.happy
62844c042a fix: set proper type for screenProps in ScreenComponent 2019-09-22 00:38:47 +02:00
satyajit.happy
5175ffb583 fix: fix types for tab bar button component 2019-09-19 17:10:00 +02:00
satyajit.happy
8f19e410c0 fix: add safeAreaInset to tab bar options 2019-09-19 17:01:41 +02:00
satyajit.happy
eeefa5df6b fix: upgrade react-navigation. closes #163 2019-09-19 16:56:18 +02:00
satyajit.happy
2d22d877e9 fix: fix typescript definitions. closes #163 2019-09-17 23:25:33 +02:00
satyajit.happy
cebb0dbd62 fix: loosen types for navigation prop 2019-09-12 19:54:19 +02:00
satyajit.happy
7ecc884ecd feat: export types for ScreenProps amd ScreenComponent 2019-09-12 16:39:34 +02:00
Satyajit Sahoo
255266a683 fix: fix typescript definitions (#165) 2019-09-11 17:00:23 +02:00
satyajit.happy
52064c7f96 fix: add peer dep on react-navigation 2019-09-09 22:07:13 +02:00
Satyajit Sahoo
c28cc52d38 refactor: migrate project to TypeScript (#161) 2019-09-09 12:08:22 +02:00
Brent Vatne
3550163f56 feat: add theme support 2019-09-03 17:10:40 -07:00
satyajit.happy
e2b64af7d8 fix: correctly reset _isTabPress property 2019-05-16 11:37:36 +02:00
satyajit.happy
6f76249ca9 chore: upgrade react-native-tab-view 2019-05-14 16:32:31 +02:00
satyajit.happy
1a9f3542d7 fix: use the JUMP_TO action for tab change
The index change event fires after swipe animation. If you quickly navigate to a new screen in stack before animation finishes, the index change event will fire after the previous navigation event. By this time, the tab navigator is not focused anymore. Using the JUMP_TO action instead of NAVIGATE avoids this issue.
2019-04-23 20:36:44 +02:00
Frederik Winkelsdorf
eaed48b71b fix: increase padding for iOS horizontal label alignment (#114)
Fixes #113.

20 looks more natural on iPad
2019-04-23 12:28:59 +02:00
satyajit.happy
3ff10fa16d fix: specify default values for getAccessibilityX
fixes #116
2019-04-10 12:30:57 +02:00
Benoit Dion
533c2e5a08 feat: add ability to render label beside the icon (#103) 2019-04-01 17:53:35 -04:00
satyajit.happy
723afe6d76 chore: improve the examples 2019-04-01 22:17:14 +02:00
Satyajit Sahoo
70a479da84 feat: hide tab bar when keyboard is shown (#112)
Closes #16

When the statusbar is not translucent, the view resizes when the keyboard is shown on Android. The tab bar stays above the keyboard. This PR makes the tab bar hide automatically when the keyboard is shown.

The behaviour is enabled by default and can be disabled with `keyboardHidesTabBar: false` in `tabBarOptions`
2019-03-31 00:05:50 +01:00
Kevin Fawcett
7c77f60398 feat: add accessibility role and state to bottom bar (#90)
### Motivation

Exposing `accessibilityRole` and `accessibilityStates` through props in the same way as `accessibilityLabel`. This allows screen readers to announce things like: `Selected. Banana. Button.`

Reasonable defaults were provided, however, consumers can provide custom overrides in the cases where the role might be `imagebutton` or the state might be `disabled`.

### Test plan

Select a button with VoiceOver (iOS) or Talkback (Android) enabled. The screen reader should read something like `Selected. <AccessibilityLabel>. Button.` or something slightly different depending on which platform you are on. Buttons that are not focused should not have `Selected` announced.
2019-03-30 12:55:25 -04:00
Vojtech Novak
35d85f1ad1 fix: fix hit slop for bottom tab bar (#110) 2019-03-21 14:51:12 +01:00
Satyajit Sahoo
6486c4b7dd feat: upgrade react-native-tab-view to 2.0
BREAKING CHANGES:

- Animated nodes are not from `react-native-reanimated`, which means custom tab bars need to be updated
- Changed behaviour: `activeTintColor` and `inactiveTintColor` also controls opacity now
- Removed props: `animationsEnabled`, `optimizationsEnabled`
- Dropped support for React < 16.3, which means the minimum supported React Native version is 0.56

New features:

- Added prop: `lazyPlaceholderComponent`
2019-02-26 22:40:51 +01:00
Satyajit Sahoo
421207dab3 chore: fix running on ci 2019-03-02 01:30:57 +01:00
Krzysztof Magiera
856f7f4036 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
2018-12-18 16:38:25 +01:00
mmtootmm
1659bead1c Fix renderPager undefined override (#70) 2018-12-01 05:49:36 +09:00
Brent Vatne
a2c6410296 Fix active and inactive tint colors - thanks to @CrazyPython - Original: https://github.com/react-navigation/react-navigation-tabs/pull/35 2018-11-17 09:11:27 +07:00
Jonny Burger
23890f296f implement onTabLongPress event handler (#66)
* implement onTabLongPress event handler

* style fix

* defaultHandler for long press
2018-11-09 18:45:18 +01:00
Brent Vatne
f86fe1ce7f fix: tweak hitSlop on bottom tab bar buttons 2018-10-31 16:26:02 -07:00
Yao Hui Chua
36ea405145 Fix bottom tab voiceover (#61)
* Fix bottom tab voiceover

* Remove isBottom check

* Update MaterialTopTabBar

* Remove unnecessary props on route
2018-11-05 11:46:37 +08:00
Brent Vatne
f1f5445e76 Emit refocus event, add example that uses it 2018-10-22 18:17:31 -07:00
Brent Vatne
080ea4d43d chore: move core/native to peerDependencies 2018-10-16 21:14:44 -07:00
Brent Vatne
2a55e93f72 Fix example project 2018-10-15 12:10:05 -07:00
Eric Vicenti
f39655f976 move to react-navigation core and native 2018-10-15 11:21:04 -07:00
Brent Vatne
fd2966f67c Handle case where screensEnabled isn't available (in Snack) 2018-10-10 13:11:30 -07:00
Krzysztof Magiera
8ff96aa3cd 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).
2018-09-18 12:07:59 +02:00
Jonny Burger
324806e232 Upgrade react-native-safe-area-view (#44)
* Update react-native-safe-area-view

* import SafeAreaView from react-navigation
2018-09-06 14:46:41 -07:00
Brent Vatne
3e57028079 Pass horizontal prop into tabBarIcon for bottom tabs, fix default background color, fix text sizes 2018-09-06 14:44:23 -07:00
Brent Vatne
1d808bdd06 Fix formatting and flow errors 2018-08-02 12:07:58 -07:00
Nicolas Charpentier
03cd7566ac 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)

-->
2018-07-25 20:41:02 -04:00