Commit Graph

72 Commits

Author SHA1 Message Date
satyajit.happy
4e07461526 chore: publish
- @react-navigation/bottom-tabs@5.0.0-alpha.3
 - @react-navigation/core@5.0.0-alpha.2
 - @react-navigation/drawer@5.0.0-alpha.3
 - @react-navigation/material-bottom-tabs@5.0.0-alpha.3
 - @react-navigation/material-top-tabs@5.0.0-alpha.3
 - @react-navigation/native@5.0.0-alpha.2
 - @react-navigation/routers@5.0.0-alpha.3
 - @react-navigation/stack@5.0.0-alpha.4
2019-08-22 10:10:06 +05:30
satyajit.happy
f18231541b fix: fix path to typescript definitions 2019-08-22 10:09:16 +05:30
satyajit.happy
e70f5273ac chore: publish
- @react-navigation/bottom-tabs@5.0.0-alpha.2
 - @react-navigation/drawer@5.0.0-alpha.2
 - @react-navigation/material-bottom-tabs@5.0.0-alpha.2
 - @react-navigation/material-top-tabs@5.0.0-alpha.2
 - @react-navigation/routers@5.0.0-alpha.2
 - @react-navigation/stack@5.0.0-alpha.3
2019-08-22 07:40:13 +05:30
satyajit.happy
91958617dc chore: publish
- @react-navigation/bottom-tabs@5.0.0-alpha.1
 - @react-navigation/core@5.0.0-alpha.1
 - @react-navigation/drawer@5.0.0-alpha.1
 - @react-navigation/example@5.0.0-alpha.1
 - @react-navigation/material-bottom-tabs@5.0.0-alpha.1
 - @react-navigation/material-top-tabs@5.0.0-alpha.1
 - @react-navigation/native@5.0.0-alpha.1
 - @react-navigation/routers@5.0.0-alpha.1
 - @react-navigation/stack@5.0.0-alpha.1
2019-08-22 04:31:54 +05:30
satyajit.happy
6b4fc74592 fix: fix peer deps and add git urls 2019-08-22 04:30:58 +05:30
satyajit.happy
c1a2fd6da4 chore: set access to public 2019-08-22 04:00:51 +05:30
satyajit.happy
6970ad7b7b docs: add basic README files 2019-08-21 19:12:40 +05:30
satyajit.happy
1c2e5de07a chore: configure publishing packages 2019-08-21 18:12:43 +05:30
satyajit.happy
4128654324 chore: navigation-ex -> react-navigation 2019-08-21 16:09:10 +05:30
satyajit.happy
6b9af77fab chore: configure lerna with bob 2019-08-21 14:27:07 +05:30
satyajit.happy
14b353b6ef docs: document screen options for all navigators 2019-08-20 16:44:23 +05:30
satyajit.happy
f0b80ce0f6 feat: implement various navigators 2019-08-19 01:07:48 +05:30
satyajit.happy
f4ac5c3e1a wip 2019-08-18 23:33:00 +05:30
satyajit.happy
e4e009fb33 wip 2019-08-18 23:32:59 +05:30
satyajit.happy
0799b43046 wip 2019-08-18 23:32:59 +05:30
satyajit.happy
80b7f1d102 fix: correctly reset _isTabPress property 2019-08-18 23:32:56 +05:30
satyajit.happy
b56de41653 chore: upgrade react-native-tab-view 2019-08-18 23:32:55 +05:30
satyajit.happy
242625aa29 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-08-18 23:32:54 +05:30
Frederik Winkelsdorf
4adb3a9223 fix: increase padding for iOS horizontal label alignment (#114)
Fixes #113.

20 looks more natural on iPad
2019-08-18 23:32:53 +05:30
satyajit.happy
3c7918dfbe fix: specify default values for getAccessibilityX
fixes #116
2019-08-18 23:32:51 +05:30
Benoit Dion
8f70ebb0d6 feat: add ability to render label beside the icon (#103) 2019-08-18 23:32:49 +05:30
satyajit.happy
d0e43bd346 chore: improve the examples 2019-08-18 23:32:49 +05:30
Satyajit Sahoo
ccb2d38089 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-08-18 23:32:47 +05:30
Kevin Fawcett
73e9b4cb8f 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-08-18 23:32:47 +05:30
Vojtech Novak
ce3670b36e fix: fix hit slop for bottom tab bar (#110) 2019-08-18 23:32:46 +05:30
Satyajit Sahoo
d8b4774138 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-08-18 23:32:43 +05:30
Satyajit Sahoo
df52eb05a9 chore: upgrade expo to 32.0.0 2019-08-18 23:32:42 +05:30
Satyajit Sahoo
860bc53042 chore: fix running on ci 2019-08-18 23:32:41 +05:30
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
mmtootmm
8a4ef3f18d Fix renderPager undefined override (#70) 2019-08-18 23:32:39 +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
a5514a2f24 fix: tweak hitSlop on bottom tab bar buttons 2019-08-18 23:32:36 +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
9280cc10be Emit refocus event, add example that uses it 2019-08-18 23:32:34 +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
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