custom linear haptics

This commit is contained in:
Boof2015
2026-07-13 02:20:57 -04:00
parent a34d9cba89
commit 261d095090
42 changed files with 1569 additions and 89 deletions
+8 -1
View File
@@ -18,6 +18,7 @@ import {
import { createThemedStyles, useColors } from '@/theme/themed';
import { useRipple } from '@/theme/ripple';
import { motion } from '@/theme/motion';
import { playHaptic } from '@/lib/haptics';
const THUMB_INSET = 3;
@@ -106,11 +107,17 @@ function SegmentButton({
color: interpolateColor(progress.value, [0, 1], [inactiveColor, activeColor]),
}));
const handlePress = () => {
if (focused) return;
playHaptic('selection');
onPress();
};
return (
<Pressable
android_ripple={ripple.bounded}
style={styles.segment}
onPress={onPress}
onPress={handlePress}
accessibilityRole="tab"
accessibilityState={{ selected: focused }}
>