mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix animation flicker
This commit is contained in:
@@ -5,7 +5,7 @@ import {editing} from './utils';
|
||||
const {color, Value, timing} = Animated;
|
||||
|
||||
export const EditorPosition = new Value(Dimensions.get('window').width * 1.5);
|
||||
export const EditorScale = new Value(0.99);
|
||||
export const EditorScale = new Value(1);
|
||||
export const EditorOpacity = new Value(0);
|
||||
export const EditorTranslateY = new Value(150);
|
||||
|
||||
@@ -18,12 +18,6 @@ export function openEditorAnimation() {
|
||||
|
||||
EditorPosition.setValue(0);
|
||||
|
||||
setTimeout(() => {
|
||||
timing(EditorScale, {
|
||||
duration: 300,
|
||||
toValue: 1,
|
||||
easing: Easing.out(Easing.ease),
|
||||
}).start();
|
||||
timing(EditorTranslateY, {
|
||||
duration: 300,
|
||||
toValue: 0,
|
||||
@@ -34,7 +28,7 @@ export function openEditorAnimation() {
|
||||
toValue: 1,
|
||||
easing: Easing.out(Easing.ease),
|
||||
}).start();
|
||||
}, 10);
|
||||
|
||||
}
|
||||
|
||||
export function exitEditorAnimation() {
|
||||
@@ -42,28 +36,21 @@ export function exitEditorAnimation() {
|
||||
EditorOpacity.setValue(1);
|
||||
EditorTranslateY.setValue(0);
|
||||
editing.currentlyEditing = false;
|
||||
setTimeout(() => {
|
||||
|
||||
setTimeout(() => {
|
||||
EditorPosition.setValue(Dimensions.get('window').width * 1.5);
|
||||
}, 250);
|
||||
timing(EditorOpacity, {
|
||||
duration: 300,
|
||||
toValue: 0,
|
||||
easing: Easing.in(Easing.linear),
|
||||
}).start();
|
||||
easing: Easing.inOut(Easing.ease),
|
||||
}).start(() => {
|
||||
EditorPosition.setValue(Dimensions.get('window').width * 1.5);
|
||||
});
|
||||
timing(EditorTranslateY, {
|
||||
duration: 150,
|
||||
toValue: 150,
|
||||
easing: Easing.in(Easing.linear),
|
||||
}).start();
|
||||
timing(EditorScale, {
|
||||
duration: 150,
|
||||
toValue: 0.99,
|
||||
easing: Easing.in(Easing.linear),
|
||||
easing: Easing.inOut(Easing.ease),
|
||||
}).start();
|
||||
|
||||
|
||||
},20)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user