Compare commits

...

7 Commits

Author SHA1 Message Date
Brent Vatne
6ac3bb90ed Bump version 2018-01-11 18:30:28 -08:00
Brent Vatne
627c487936 Revert "Issue #2794 - Fixing iPad iOS 11 Tab Bar Bottom Behavior (#3041)"
This reverts commit c7b73cd8b4.
2018-01-11 18:21:46 -08:00
Brent Vatne
f46bdff703 Bump version 2018-01-11 18:20:44 -08:00
Adam Miskiewicz
bc75a5b7b9 Use stiffness/damping/mass for card stack transition on React Native >= 50 (#3261) 2018-01-11 18:08:42 -08:00
混沌DM
50d5c8bc0a Set the default value of the DrawerNavigatorConfig correctly. (#3152)
* Set the default value of the DrawerNavigatorConfig correctly.

* update DrawerViewProps type
2018-01-09 14:58:27 +05:30
SteffeyDev
c7b73cd8b4 Issue #2794 - Fixing iPad iOS 11 Tab Bar Bottom Behavior (#3041)
* Fixing iPad iOS 11 Tab Bar Bottom Behavior with changing widths via Multitasking

* Updating snapshot tests

* Changes per discussion in !3041

* Additional changes per discussion in !3041

* Changing to test for constrained height

* Additional changes per discussion in !3041
2018-01-08 20:28:13 -06:00
rgovind92
e2e540c32d Fix drawer toggle (#3191)
* Fixed drawer toggle

* Fixed drawer toggle

* Update DrawerView.js
2018-01-06 10:40:56 -05:00
5 changed files with 55 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "react-navigation",
"version": "1.0.0-beta.23",
"version": "1.0.0-beta.25",
"description": "React Navigation",
"main": "src/react-navigation.js",
"sources": {

View File

@@ -63,6 +63,9 @@ const DefaultDrawerConfig = {
return Math.min(smallerAxisSize - appBarHeight, maxWidth);
},
contentComponent: defaultContentComponent,
drawerOpenRoute: 'DrawerOpen',
drawerCloseRoute: 'DrawerClose',
drawerToggleRoute: 'DrawerToggle',
drawerPosition: 'left',
drawerBackgroundColor: 'white',
useNativeAnimations: true,
@@ -70,11 +73,7 @@ const DefaultDrawerConfig = {
const DrawerNavigator = (
routeConfigs: NavigationRouteConfigMap,
config: DrawerNavigatorConfig = {
drawerOpenRoute: 'DrawerOpen',
drawerCloseRoute: 'DrawerClose',
drawerToggleRoute: 'DrawerToggle',
}
config: DrawerNavigatorConfig = {}
) => {
const mergedConfig = { ...DefaultDrawerConfig, ...config };
const {

View File

@@ -0,0 +1,12 @@
/* @flow */
import { NativeModules } from 'react-native';
const { PlatformConstants } = NativeModules;
export const supportsImprovedSpringAnimation = () => {
if (PlatformConstants && PlatformConstants.reactNativeVersion) {
const { major, minor } = PlatformConstants.reactNativeVersion;
return minor >= 50 || (major === 0 && minor === 0); // `master` has major + minor set to 0
}
return false;
};

View File

@@ -9,12 +9,25 @@ import type {
} from '../../TypeDefinition';
import CardStackStyleInterpolator from './CardStackStyleInterpolator';
import * as ReactNativeFeatures from '../../utils/ReactNativeFeatures';
const IOSTransitionSpec = ({
duration: 500,
easing: Easing.bezier(0.2833, 0.99, 0.31833, 0.99),
timing: Animated.timing,
}: NavigationTransitionSpec);
let IOSTransitionSpec;
if (ReactNativeFeatures.supportsImprovedSpringAnimation()) {
// These are the exact values from UINavigationController's animation configuration
IOSTransitionSpec = ({
timing: Animated.spring,
stiffness: 1000,
damping: 500,
mass: 3,
}: NavigationTransitionSpec);
} else {
// This is an approximation of the IOS spring animation using a derived bezier curve
IOSTransitionSpec = ({
duration: 500,
easing: Easing.bezier(0.2833, 0.99, 0.31833, 0.99),
timing: Animated.timing,
}: NavigationTransitionSpec);
}
// Standard iOS navigation transition
const SlideFromRightIOS = ({

View File

@@ -33,9 +33,9 @@ export type DrawerViewConfig = {
drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open',
drawerWidth?: number | (() => number),
drawerPosition?: 'left' | 'right',
drawerOpenRoute: string,
drawerCloseRoute: string,
drawerToggleRoute: string,
drawerOpenRoute?: string,
drawerCloseRoute?: string,
drawerToggleRoute?: string,
contentComponent?: React.ComponentType<*>,
contentOptions?: {},
style?: ViewStyleProp,
@@ -44,11 +44,21 @@ export type DrawerViewConfig = {
screenProps?: {},
};
export type DrawerViewPropsExceptRouter = DrawerViewConfig & {
navigation: NavigationScreenProp<NavigationState>,
};
export type DrawerViewProps = {
drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open',
drawerWidth: number | (() => number),
drawerPosition: 'left' | 'right',
drawerOpenRoute: string,
drawerCloseRoute: string,
drawerToggleRoute: string,
contentComponent: React.ComponentType<*>,
contentOptions?: {},
style?: ViewStyleProp,
useNativeAnimations: boolean,
drawerBackgroundColor: string,
screenProps?: {},
export type DrawerViewProps = DrawerViewPropsExceptRouter & {
navigation: NavigationScreenProp<NavigationState>,
router: NavigationRouter<NavigationState, NavigationDrawerScreenOptions>,
};
@@ -93,10 +103,10 @@ export default class DrawerView extends React.PureComponent<
if (routes[index].routeName === drawerOpenRoute) {
this._drawer.openDrawer();
} else if (routes[index].routeName === drawerToggleRoute) {
if (this._drawer.state.drawerShown) {
this.props.navigation.navigate(drawerCloseRoute);
} else {
if (this.props.navigation.state.index === 0) {
this.props.navigation.navigate(drawerOpenRoute);
} else {
this.props.navigation.navigate(drawerCloseRoute);
}
} else {
this._drawer.closeDrawer();