Skip to content

Commit b380a16

Browse files
authored
Merge pull request #1 from maxiru/fixAndroid/OnKeyboardClosed
fast clear space for keyboard
2 parents 83636c1 + 1121e81 commit b380a16

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

KeyboardSpacer.js

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,32 @@ const styles = StyleSheet.create({
2222
});
2323

2424
// From: https://medium.com/man-moon/writing-modern-react-native-ui-e317ff956f02
25-
const defaultAnimation = {
26-
duration: 500,
27-
create: {
28-
duration: 300,
29-
type: LayoutAnimation.Types.easeInEaseOut,
30-
property: LayoutAnimation.Properties.opacity
25+
const defaultAnimation = Platform.select({
26+
ios: {
27+
duration: 500,
28+
create: {
29+
duration: 300,
30+
type: LayoutAnimation.Types.easeInEaseOut,
31+
property: LayoutAnimation.Properties.opacity
32+
},
33+
update: {
34+
type: LayoutAnimation.Types.spring,
35+
springDamping: 200
36+
}
3137
},
32-
update: {
33-
type: LayoutAnimation.Types.spring,
34-
springDamping: 200
38+
android: {
39+
duration: 500,
40+
create: {
41+
duration: 300,
42+
type: LayoutAnimation.Types.easeInEaseOut,
43+
property: LayoutAnimation.Properties.opacity
44+
},
45+
update: {
46+
duration: 1,
47+
type: LayoutAnimation.Types.linear,
48+
}
3549
}
36-
};
50+
});
3751

3852
export default class KeyboardSpacer extends Component {
3953
static propTypes = {

0 commit comments

Comments
 (0)