Skip to content

Commit

Permalink
Add all haptic types to example apps
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbaroni committed Nov 14, 2024
1 parent 46784bb commit 07ff65e
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 20 deletions.
36 changes: 34 additions & 2 deletions package/example-fabric/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,38 @@ function App(): React.JSX.Element {
<StatusBar barStyle="light-content" />
<GestureHandlerRootView>
<View style={styles.root}>
<GestureHandlerButton hapticType="impactLight" style={styles.button}>
<Text style={styles.text}>impactLight</Text>
</GestureHandlerButton>
<GestureHandlerButton hapticType="impactMedium" style={styles.button}>
<Text style={styles.text}>impactMedium</Text>
</GestureHandlerButton>
<GestureHandlerButton hapticType="impactHeavy" style={styles.button}>
<Text style={styles.text}>impactHeavy</Text>
</GestureHandlerButton>
<GestureHandlerButton
hapticType="notificationError"
style={styles.button}>
<Text style={styles.text}>notificationError</Text>
</GestureHandlerButton>
<GestureHandlerButton
hapticType="notificationWarning"
style={styles.button}>
<Text style={styles.text}>notificationWarning</Text>
</GestureHandlerButton>
<GestureHandlerButton
hapticType="notificationSuccess"
style={styles.button}>
<Text style={styles.text}>notificationSuccess</Text>
</GestureHandlerButton>
<GestureHandlerButton hapticType="rigid" style={styles.button}>
<Text style={styles.text}>rigid</Text>
</GestureHandlerButton>
<GestureHandlerButton hapticType="selection" style={styles.button}>
<Text style={styles.text}>selection</Text>
</GestureHandlerButton>
<GestureHandlerButton hapticType="soft" style={styles.button}>
<Text style={styles.text}>Tap Me</Text>
<Text style={styles.text}>soft</Text>
</GestureHandlerButton>
</View>
</GestureHandlerRootView>
Expand All @@ -26,12 +56,14 @@ const styles = StyleSheet.create({
borderRadius: 24,
height: 48,
justifyContent: 'center',
paddingHorizontal: 24,
paddingHorizontal: 20,
},
root: {
alignItems: 'center',
backgroundColor: '#000000',
flex: 1,
flexDirection: 'column',
gap: 28,
justifyContent: 'center',
},
text: {
Expand Down
10 changes: 2 additions & 8 deletions package/example-fabric/ios/example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -664,10 +661,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down
4 changes: 4 additions & 0 deletions package/example-fabric/ios/example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Expand Down
36 changes: 34 additions & 2 deletions package/example-paper/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,38 @@ function App(): React.JSX.Element {
<StatusBar barStyle="light-content" />
<GestureHandlerRootView>
<View style={styles.root}>
<GestureHandlerButton hapticType="impactLight" style={styles.button}>
<Text style={styles.text}>impactLight</Text>
</GestureHandlerButton>
<GestureHandlerButton hapticType="impactMedium" style={styles.button}>
<Text style={styles.text}>impactMedium</Text>
</GestureHandlerButton>
<GestureHandlerButton hapticType="impactHeavy" style={styles.button}>
<Text style={styles.text}>impactHeavy</Text>
</GestureHandlerButton>
<GestureHandlerButton
hapticType="notificationError"
style={styles.button}>
<Text style={styles.text}>notificationError</Text>
</GestureHandlerButton>
<GestureHandlerButton
hapticType="notificationWarning"
style={styles.button}>
<Text style={styles.text}>notificationWarning</Text>
</GestureHandlerButton>
<GestureHandlerButton
hapticType="notificationSuccess"
style={styles.button}>
<Text style={styles.text}>notificationSuccess</Text>
</GestureHandlerButton>
<GestureHandlerButton hapticType="rigid" style={styles.button}>
<Text style={styles.text}>rigid</Text>
</GestureHandlerButton>
<GestureHandlerButton hapticType="selection" style={styles.button}>
<Text style={styles.text}>selection</Text>
</GestureHandlerButton>
<GestureHandlerButton hapticType="soft" style={styles.button}>
<Text style={styles.text}>Tap Me</Text>
<Text style={styles.text}>soft</Text>
</GestureHandlerButton>
</View>
</GestureHandlerRootView>
Expand All @@ -26,12 +56,14 @@ const styles = StyleSheet.create({
borderRadius: 24,
height: 48,
justifyContent: 'center',
paddingHorizontal: 24,
paddingHorizontal: 20,
},
root: {
alignItems: 'center',
backgroundColor: '#000000',
flex: 1,
flexDirection: 'column',
gap: 28,
justifyContent: 'center',
},
text: {
Expand Down
10 changes: 2 additions & 8 deletions package/example-paper/ios/example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -664,10 +661,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down
4 changes: 4 additions & 0 deletions package/example-paper/ios/example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Expand Down

0 comments on commit 07ff65e

Please sign in to comment.