Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup example app to use Expo #2905

Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- '.github/workflows/android-build.yml'
- 'android/**'
- 'Common/**'
- 'Example/android/**'
- 'example/android/**'
- 'FabricExample/android/**'
push:
branches:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ios-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- '.github/workflows/ios-build.yml'
- 'RNGestureHandler.podspec'
- 'apple/**'
- 'Example/ios/**'
- 'example/ios/**'
- 'FabricExample/ios/**'
push:
branches:
Expand Down Expand Up @@ -41,4 +41,4 @@ jobs:
run: bundle install && NO_FLIPPER=1 bundle exec pod install
- name: Build app
working-directory: ${{ matrix.working-directory }}
run: yarn ios --simulator=\"iPhone 14\" --mode Debug --verbose --terminal /bin/zsh
run: npx react-native run-ios
bohdanprog marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ If you want to play with the API but don't feel like trying it on a real app, yo
yarn install
```

If you are running on ios, run `pod install` in the ios folder

Run `yarn start` to start the metro bundler

Run `yarn android` or `yarn ios` (depending on which platform you want to run the example app on).

You will need to have an Android or iOS device or emulator connected as well as `react-native-cli` package installed globally.
You will need to have an Android or iOS device or emulator connected.

## React Native Support

Expand Down
4 changes: 4 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@ buck-out/

# testing
/coverage

# Expo
android/
ios/
bohdanprog marked this conversation as resolved.
Show resolved Hide resolved
102 changes: 58 additions & 44 deletions example/src/App.tsx → example/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import React from 'react';
import { Text, View, StyleSheet, SectionList, Platform } from 'react-native';
import {
Text,
View,
StyleSheet,
SectionList,
Platform,
Dimensions,
} from 'react-native';
import {
createStackNavigator,
StackScreenProps,
Expand All @@ -9,50 +16,53 @@
GestureHandlerRootView,
bohdanprog marked this conversation as resolved.
Show resolved Hide resolved
RectButton,
} from 'react-native-gesture-handler';
import OverflowParent from './release_tests/overflowParent';
import DoublePinchRotate from './release_tests/doubleScalePinchAndRotate';
import DoubleDraggable from './release_tests/doubleDraggable';
import { ComboWithGHScroll } from './release_tests/combo';
import { TouchablesIndex, TouchableExample } from './release_tests/touchables';
import Rows from './release_tests/rows';
import NestedFling from './release_tests/nestedFling';
import MouseButtons from './release_tests/mouseButtons';
import ContextMenu from './release_tests/contextMenu';
import NestedTouchables from './release_tests/nestedTouchables';
import NestedButtons from './release_tests/nestedButtons';
import PointerType from './release_tests/pointerType';
import NestedGestureHandlerRootViewWithModal from './release_tests/nestedGHRootViewWithModal';
import { PinchableBox } from './recipes/scaleAndRotate';
import PanAndScroll from './recipes/panAndScroll';
import { BottomSheet } from './showcase/bottomSheet';
import Swipeables from './showcase/swipeable';
import ChatHeads from './showcase/chatHeads';
import Draggable from './basic/draggable';
import MultiTap from './basic/multitap';
import BouncingBox from './basic/bouncing';
import PanResponder from './basic/panResponder';
import HorizontalDrawer from './basic/horizontalDrawer';
import PagerAndDrawer from './basic/pagerAndDrawer';
import ForceTouch from './basic/forcetouch';
import Fling from './basic/fling';
import OverflowParent from './src/release_tests/overflowParent';
import DoublePinchRotate from './src/release_tests/doubleScalePinchAndRotate';
import DoubleDraggable from './src/release_tests/doubleDraggable';
import { ComboWithGHScroll } from './src/release_tests/combo';
import {
TouchablesIndex,
TouchableExample,
} from './src/release_tests/touchables';
import Rows from './src/release_tests/rows';
import NestedFling from './src/release_tests/nestedFling';
import MouseButtons from './src/release_tests/mouseButtons';
import ContextMenu from './src/release_tests/contextMenu';
import NestedTouchables from './src/release_tests/nestedTouchables';
import NestedButtons from './src/release_tests/nestedButtons';
import PointerType from './src/release_tests/pointerType';
import NestedGestureHandlerRootViewWithModal from './src/release_tests/nestedGHRootViewWithModal';
import { PinchableBox } from './src/recipes/scaleAndRotate';
import PanAndScroll from './src/recipes/panAndScroll';
import { BottomSheet } from './src/showcase/bottomSheet';
import Swipeables from './src/showcase/swipeable';
import ChatHeads from './src/showcase/chatHeads';
import Draggable from './src/basic/draggable';
import MultiTap from './src/basic/multitap';
import BouncingBox from './src/basic/bouncing';
import PanResponder from './src/basic/panResponder';
import HorizontalDrawer from './src/basic/horizontalDrawer';
import PagerAndDrawer from './src/basic/pagerAndDrawer';
import ForceTouch from './src/basic/forcetouch';
import Fling from './src/basic/fling';

import ReanimatedSimple from './new_api/reanimated';
import Camera from './new_api/camera';
import Transformations from './new_api/transformations';
import OverlapParents from './new_api/overlap_parent';
import OverlapSiblings from './new_api/overlap_siblings';
import Calculator from './new_api/calculator';
import BottomSheetNewApi from './new_api/bottom_sheet';
import ChatHeadsNewApi from './new_api/chat_heads';
import DragNDrop from './new_api/drag_n_drop';
import BetterHorizontalDrawer from './new_api/betterHorizontalDrawer';
import ManualGestures from './new_api/manualGestures/index';
import Hover from './new_api/hover';
import HoverableIcons from './new_api/hoverable_icons';
import VelocityTest from './new_api/velocityTest';
import ReanimatedSimple from './src/new_api/reanimated';
import Camera from './src/new_api/camera';
import Transformations from './src/new_api/transformations';
import OverlapParents from './src/new_api/overlap_parent';
import OverlapSiblings from './src/new_api/overlap_siblings';
import Calculator from './src/new_api/calculator';
import BottomSheetNewApi from './src/new_api/bottom_sheet';
import ChatHeadsNewApi from './src/new_api/chat_heads';
import DragNDrop from './src/new_api/drag_n_drop';
import BetterHorizontalDrawer from './src/new_api/betterHorizontalDrawer';
import ManualGestures from './src/new_api/manualGestures/index';
import Hover from './src/new_api/hover';
import HoverableIcons from './src/new_api/hoverable_icons';
import VelocityTest from './src/new_api/velocityTest';

import EmptyExample from './empty/EmptyExample';
import RectButtonBorders from './release_tests/rectButton';
import EmptyExample from './src/empty/EmptyExample';
import RectButtonBorders from './src/release_tests/rectButton';

interface Example {
name: string;
Expand Down Expand Up @@ -159,6 +169,7 @@

type RootStackParamList = {
Home: undefined;
TouchableExample: { item: string };
} & {
[Screen: string]: undefined;
};
Expand All @@ -169,7 +180,10 @@
return (
<GestureHandlerRootView>
<NavigationContainer>
bohdanprog marked this conversation as resolved.
Show resolved Hide resolved
<Stack.Navigator>
<Stack.Navigator
screenOptions={{
cardStyle: { height: Dimensions.get('window').height },
}}>
bohdanprog marked this conversation as resolved.
Show resolved Hide resolved
<Stack.Screen
name="Home"
options={{ title: '✌️ Gesture Handler Demo' }}
Expand Down Expand Up @@ -207,7 +221,7 @@
renderSectionHeader={({ section: { sectionTitle } }) => (
<Text style={styles.sectionTitle}>{sectionTitle}</Text>
)}
ItemSeparatorComponent={() => <View style={styles.separator} />}

Check warning on line 224 in example/App.tsx

View workflow job for this annotation

GitHub Actions / check (example)

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “MainScreen” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true
/>
);
}
Expand Down
166 changes: 0 additions & 166 deletions example/android/app/build.gradle

This file was deleted.

19 changes: 0 additions & 19 deletions example/android/app/build_defs.bzl

This file was deleted.

Binary file removed example/android/app/debug.keystore
Binary file not shown.
10 changes: 0 additions & 10 deletions example/android/app/proguard-rules.pro

This file was deleted.

8 changes: 0 additions & 8 deletions example/android/app/src/debug/AndroidManifest.xml

This file was deleted.

Loading
Loading