From ef0ce951e7c95ce3374a3e49db16f72a344ef779 Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 16 May 2024 10:40:12 -0700 Subject: [🐴] Only scroll down one "screen" in height when foregrounding (#4027) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * maintain position after foreground * one possibility * don't overscroll when content size changes. * ignore the rule on 1 item * fix * [🐴] Pill for additional unreads when coming from background (#4043) * create a pill with some animatons * add some basic styles to the pill * make the animations reusable * bit better styling * rm logs --------- Co-authored-by: Samuel Newman * import --------- Co-authored-by: Samuel Newman --- src/lib/custom-animations/ScaleAndFade.ts | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/lib/custom-animations/ScaleAndFade.ts (limited to 'src/lib/custom-animations/ScaleAndFade.ts') diff --git a/src/lib/custom-animations/ScaleAndFade.ts b/src/lib/custom-animations/ScaleAndFade.ts new file mode 100644 index 000000000..ad2c15f8f --- /dev/null +++ b/src/lib/custom-animations/ScaleAndFade.ts @@ -0,0 +1,39 @@ +import {withTiming} from 'react-native-reanimated' + +export function ScaleAndFadeIn() { + 'worklet' + + const animations = { + opacity: withTiming(1), + transform: [{scale: withTiming(1)}], + } + + const initialValues = { + opacity: 0, + transform: [{scale: 0.7}], + } + + return { + animations, + initialValues, + } +} + +export function ScaleAndFadeOut() { + 'worklet' + + const animations = { + opacity: withTiming(0), + transform: [{scale: withTiming(0.7)}], + } + + const initialValues = { + opacity: 1, + transform: [{scale: 1}], + } + + return { + animations, + initialValues, + } +} -- cgit 1.4.1