Skip to content

Commit f1e0f8b

Browse files
authored
fix exit animation on iPhoneX (with bottom safe area) and change the bezier easing values (#793)
1 parent d76532e commit f1e0f8b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/dialog/DialogDismissibleView.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ class DialogDismissibleView extends PureComponent {
133133
getHiddenLocation = (left, top) => {
134134
const {direction} = this.props;
135135
const topInset = Constants.isIphoneX ? Constants.getSafeAreaInsets().top : Constants.isIOS ? 20 : 0;
136+
const bottomInset = Constants.isIphoneX ? Constants.getSafeAreaInsets().bottom : Constants.isIOS ? 20 : 0;
137+
136138
const result = {left: 0, top: 0};
137139
switch (direction) {
138140
case PanningProvider.Directions.LEFT:
@@ -146,7 +148,7 @@ class DialogDismissibleView extends PureComponent {
146148
break;
147149
case PanningProvider.Directions.DOWN:
148150
default:
149-
result.top = Constants.screenHeight - top;
151+
result.top = Constants.screenHeight - top + bottomInset;
150152
break;
151153
}
152154

@@ -157,7 +159,7 @@ class DialogDismissibleView extends PureComponent {
157159
const animation = Animated.timing(this.animatedValue, {
158160
toValue,
159161
duration: 400,
160-
easing: Easing.bezier(0.165, 0.84, 0.44, 1),
162+
easing: Easing.bezier(0.65, 0, 0.35, 1),
161163
useNativeDriver: true
162164
});
163165

0 commit comments

Comments
 (0)