| 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); |