mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-12 09:21:09 +08:00
refactor: rename WipeFromBottomAndroid to RevealFromBottomAndroid
This commit is contained in:
@@ -14,7 +14,7 @@ import { List, Divider } from 'react-native-paper';
|
||||
|
||||
import FullScreen from './src/FullScreen';
|
||||
import SimpleStack from './src/SimpleStack';
|
||||
import WipeStack from './src/WipeStack';
|
||||
import RevealStack from './src/RevealStack';
|
||||
import ImageStack from './src/ImageStack';
|
||||
import TransparentStack from './src/TransparentStack';
|
||||
import ModalStack from './src/ModalStack';
|
||||
@@ -41,7 +41,7 @@ I18nManager.forceRTL(false);
|
||||
const data = [
|
||||
{ component: SimpleStack, title: 'Simple', routeName: 'SimpleStack' },
|
||||
{ component: HeaderPreset, title: 'UIKit Preset', routeName: 'UIKit' },
|
||||
{ component: WipeStack, title: 'Wipe Preset', routeName: 'Wipe' },
|
||||
{ component: RevealStack, title: 'Reveal Preset', routeName: 'Reveal' },
|
||||
{ component: ImageStack, title: 'Image', routeName: 'ImageStack' },
|
||||
{ component: ModalStack, title: 'Modal', routeName: 'ModalStack' },
|
||||
{
|
||||
|
||||
@@ -153,7 +153,7 @@ export default createStackNavigator(
|
||||
initialRouteName: 'List',
|
||||
headerMode: 'screen',
|
||||
defaultNavigationOptions: {
|
||||
...TransitionPresets.WipeFromBottomAndroid,
|
||||
...TransitionPresets.RevealFromBottomAndroid,
|
||||
cardOverlayEnabled: true,
|
||||
},
|
||||
}
|
||||
@@ -5,6 +5,11 @@ import { createStackNavigator } from 'react-navigation-stack';
|
||||
|
||||
const Buttons = withNavigation(props => (
|
||||
<React.Fragment>
|
||||
<Button
|
||||
title="Push Details"
|
||||
onPress={() => props.navigation.push('Details')}
|
||||
/>
|
||||
<Button title="PopToTop" onPress={() => props.navigation.popToTop()} />
|
||||
<Button
|
||||
title="Go to Details"
|
||||
onPress={() => props.navigation.navigate('Details')}
|
||||
|
||||
@@ -158,7 +158,7 @@ export function forFadeFromBottomAndroid({
|
||||
/**
|
||||
* Standard Android-style wipe from the bottom for Android Pie.
|
||||
*/
|
||||
export function forWipeFromBottomAndroid({
|
||||
export function forRevealFromBottomAndroid({
|
||||
progress: { current, next },
|
||||
layouts: { screen },
|
||||
}: CardInterpolationProps): CardInterpolatedStyle {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import {
|
||||
forHorizontalIOS,
|
||||
forVerticalIOS,
|
||||
forWipeFromBottomAndroid,
|
||||
forRevealFromBottomAndroid,
|
||||
forFadeFromBottomAndroid,
|
||||
forModalPresentationIOS,
|
||||
} from './CardStyleInterpolators';
|
||||
import { forNoAnimation, forFade } from './HeaderStyleInterpolators';
|
||||
import {
|
||||
TransitionIOSSpec,
|
||||
WipeFromBottomAndroidSpec,
|
||||
RevealFromBottomAndroidSpec,
|
||||
FadeOutToBottomAndroidSpec,
|
||||
FadeInFromBottomAndroidSpec,
|
||||
} from './TransitionSpecs';
|
||||
@@ -62,13 +62,13 @@ export const FadeFromBottomAndroid: TransitionPreset = {
|
||||
};
|
||||
|
||||
// Standard Android navigation transition when opening or closing an Activity on Android >= 9
|
||||
export const WipeFromBottomAndroid: TransitionPreset = {
|
||||
export const RevealFromBottomAndroid: TransitionPreset = {
|
||||
direction: 'vertical',
|
||||
transitionSpec: {
|
||||
open: WipeFromBottomAndroidSpec,
|
||||
close: WipeFromBottomAndroidSpec,
|
||||
open: RevealFromBottomAndroidSpec,
|
||||
close: RevealFromBottomAndroidSpec,
|
||||
},
|
||||
cardStyleInterpolator: forWipeFromBottomAndroid,
|
||||
cardStyleInterpolator: forRevealFromBottomAndroid,
|
||||
headerStyleInterpolator: forNoAnimation,
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ export const DefaultTransition = Platform.select({
|
||||
default:
|
||||
Platform.OS === 'android' && Platform.Version < ANDROID_VERSION_PIE
|
||||
? FadeFromBottomAndroid
|
||||
: WipeFromBottomAndroid,
|
||||
: RevealFromBottomAndroid,
|
||||
});
|
||||
|
||||
export const ModalTransition = Platform.select({
|
||||
|
||||
@@ -33,7 +33,7 @@ export const FadeOutToBottomAndroidSpec: TransitionSpec = {
|
||||
};
|
||||
|
||||
// See http://androidxref.com/9.0.0_r3/xref/frameworks/base/core/res/res/anim/activity_open_enter.xml
|
||||
export const WipeFromBottomAndroidSpec: TransitionSpec = {
|
||||
export const RevealFromBottomAndroidSpec: TransitionSpec = {
|
||||
timing: 'timing',
|
||||
config: {
|
||||
duration: 425,
|
||||
|
||||
Reference in New Issue
Block a user