| 1 | import { |
| 2 | FadeIn, |
| 3 | FadeOut, |
| 4 | LinearTransition, |
| 5 | ReduceMotion, |
| 6 | withTiming, |
| 7 | type LayoutAnimationFunction, |
| 8 | } from "react-native-reanimated"; |
| 9 | |
| 10 | // Match the model picker: move existing rows, briefly fade additions and removals. |
| 11 | export const PR_ROW_LAYOUT = LinearTransition.duration(180).reduceMotion(ReduceMotion.System); |
| 12 | export const PR_ROW_ENTER = FadeIn.duration(140).reduceMotion(ReduceMotion.System); |
| 13 | export const PR_ROW_EXIT = FadeOut.duration(100).reduceMotion(ReduceMotion.System); |
| 14 | |
| 15 | export const PR_DISCLOSURE_ENTER = FadeIn.delay(80).duration(120).reduceMotion(ReduceMotion.System); |
| 16 | |
| 17 | // Follow expanding status rows without interpolating the clipped markdown's height. |
| 18 | export const PR_POSITION_LAYOUT: LayoutAnimationFunction = (values) => { |
| 19 | "worklet"; |
| 20 | return { |
| 21 | initialValues: { |
| 22 | originX: values.targetOriginX, |
| 23 | originY: values.currentOriginY, |
| 24 | width: values.targetWidth, |
| 25 | height: values.targetHeight, |
| 26 | }, |
| 27 | animations: { |
| 28 | originX: values.targetOriginX, |
| 29 | originY: withTiming(values.targetOriginY, { |
| 30 | duration: 180, |
| 31 | reduceMotion: ReduceMotion.System, |
| 32 | }), |
| 33 | width: values.targetWidth, |
| 34 | height: values.targetHeight, |
| 35 | }, |
| 36 | }; |
| 37 | }; |