MCPcopy
hub / github.com/callstack/react-native-paper / runElevationAnimation

Function runElevationAnimation

src/components/Card/Card.tsx:215–234  ·  view source on GitHub ↗
(pressType: HandlePressType)

Source from the content-addressed store, hash-verified

213 ]);
214
215 const runElevationAnimation = (pressType: HandlePressType) => {
216 if (isV3 && isMode('contained')) {
217 return;
218 }
219
220 const isPressTypeIn = pressType === 'in';
221 if (dark && isAdaptiveMode) {
222 Animated.timing(elevationDarkAdaptive, {
223 toValue: isPressTypeIn ? (isV3 ? 2 : 8) : cardElevation,
224 duration: animationDuration,
225 useNativeDriver: false,
226 }).start();
227 } else {
228 Animated.timing(elevation, {
229 toValue: isPressTypeIn ? (isV3 ? 2 : 8) : cardElevation,
230 duration: animationDuration,
231 useNativeDriver: false,
232 }).start();
233 }
234 };
235
236 const handlePressIn = useLatestCallback((e: GestureResponderEvent) => {
237 onPressIn?.(e);

Callers 1

CardFunction · 0.85

Calls 1

isModeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…