diff --git a/android/build.gradle b/android/build.gradle index 7041eba..cc647b3 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -26,10 +26,9 @@ def isNewArchitectureEnabled() { apply plugin: "com.android.library" apply plugin: "kotlin-android" -// TODO: Getting build error with this block :( -// if (isNewArchitectureEnabled()) { -// apply plugin: "com.facebook.react" -// } +if (isNewArchitectureEnabled()) { + apply plugin: "com.facebook.react" +} def getExtOrDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["TrueSheet_" + name] diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml index 7ba83a2..e29e52e 100644 --- a/example/android/app/src/main/res/values/styles.xml +++ b/example/android/app/src/main/res/values/styles.xml @@ -1,7 +1,9 @@ - diff --git a/example/package.json b/example/package.json index b1709e2..f747b26 100644 --- a/example/package.json +++ b/example/package.json @@ -12,8 +12,7 @@ "dependencies": { "react": "18.3.1", "react-native": "0.76.3", - "react-native-gesture-handler": "^2.21.2", - "react-native-is-edge-to-edge": "^1.1.6", + "react-native-edge-to-edge": "^1.1.3", "react-native-maps": "^1.20.1", "react-native-reanimated": "^3.16.3" }, diff --git a/example/src/App.tsx b/example/src/App.tsx index e7214ec..544e1d1 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -51,6 +51,7 @@ export default function App() { ref={sheetRef} blurTint="dark" backgroundColor={DARK} + edgeToEdge contentContainerStyle={{ padding: SPACING, paddingBottom: SPACING * 3 }} dimmedIndex={2} dismissible={false} diff --git a/example/src/components/DemoContent.tsx b/example/src/components/DemoContent.tsx index 6b62ca2..5356480 100644 --- a/example/src/components/DemoContent.tsx +++ b/example/src/components/DemoContent.tsx @@ -1,11 +1,4 @@ -import { - View, - type ColorValue, - type ViewProps, - type TextStyle, - type ViewStyle, - Text, -} from 'react-native' +import { View, type ColorValue, type ViewProps, Text, StyleSheet } from 'react-native' import { BORDER_RADIUS, SPACING } from '../utils' interface DemoContentProps extends ViewProps { @@ -18,23 +11,24 @@ export const DemoContent = (props: DemoContentProps) => { const { text, radius = BORDER_RADIUS, style: $style, color = 'rgba(0,0,0,0.2)', ...rest } = props return ( - {text && {text}} + {text && {text}} ) } -const $demoContent: ViewStyle = { - height: 100, - marginBottom: 16, - padding: SPACING / 2, - alignItems: 'center', -} - -const $demoText: TextStyle = { - fontSize: 16, - lineHeight: 20, - color: 'white', -} +const styles = StyleSheet.create({ + content: { + height: 100, + marginBottom: 16, + padding: SPACING / 2, + alignItems: 'center', + }, + text: { + fontSize: 16, + lineHeight: 20, + color: 'white', + }, +}) diff --git a/example/src/sheets/GestureSheet.tsx b/example/src/sheets/GestureSheet.tsx index 4efd6a6..9d1232b 100644 --- a/example/src/sheets/GestureSheet.tsx +++ b/example/src/sheets/GestureSheet.tsx @@ -1,13 +1,13 @@ import { forwardRef, useRef, type Ref, useImperativeHandle } from 'react' -import { type ViewStyle, useWindowDimensions, StyleSheet } from 'react-native' +import { StyleSheet, Text } from 'react-native' import { TrueSheet, type TrueSheetProps } from '@lodev09/react-native-true-sheet' -import Animated, { useAnimatedStyle, useSharedValue, withDecay } from 'react-native-reanimated' -import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler' +// import Animated, { useAnimatedStyle, useSharedValue, withDecay } from 'react-native-reanimated' +// import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler' -import { DARK, DARK_GRAY, GRABBER_COLOR, SPACING, times } from '../utils' -import { Button, DemoContent, Footer } from '../components' +import { DARK, DARK_GRAY, GRABBER_COLOR, SPACING } from '../utils' +import { Button, Footer, Spacer } from '../components' -const BOXES_COUNT = 20 +// const BOXES_COUNT = 20 const CONTAINER_HEIGHT = 200 const BOX_GAP = SPACING const BOX_SIZE = CONTAINER_HEIGHT - SPACING * 2 @@ -17,29 +17,29 @@ interface GestureSheetProps extends TrueSheetProps {} export const GestureSheet = forwardRef((props: GestureSheetProps, ref: Ref) => { const sheetRef = useRef(null) - const scrollX = useSharedValue(0) - const dimensions = useWindowDimensions() + // const scrollX = useSharedValue(0) + // const dimensions = useWindowDimensions() const dismiss = async () => { await sheetRef.current?.dismiss() } - const $animatedContainer: ViewStyle = useAnimatedStyle(() => ({ - transform: [{ translateX: scrollX.value }], - })) + // const $animatedContainer: ViewStyle = useAnimatedStyle(() => ({ + // transform: [{ translateX: scrollX.value }], + // })) - const pan = Gesture.Pan() - .onChange((e) => { - scrollX.value += e.changeX - }) - .onFinalize((e) => { - scrollX.value = withDecay({ - velocity: e.velocityX, - rubberBandEffect: true, - clamp: [-((BOX_SIZE + BOX_GAP) * BOXES_COUNT) + dimensions.width - SPACING, 0], - }) - }) - .activeOffsetX([-10, 10]) + // const pan = Gesture.Pan() + // .onChange((e) => { + // scrollX.value += e.changeX + // }) + // .onFinalize((e) => { + // scrollX.value = withDecay({ + // velocity: e.velocityX, + // rubberBandEffect: true, + // clamp: [-((BOX_SIZE + BOX_GAP) * BOXES_COUNT) + dimensions.width - SPACING, 0], + // }) + // }) + // .activeOffsetX([-10, 10]) useImperativeHandle(ref, () => sheetRef.current) @@ -60,7 +60,14 @@ export const GestureSheet = forwardRef((props: GestureSheetProps, ref: Ref} {...props} > - + + react-native-gesture-handler is causing build issues on Android at this time 🤷‍♂️ + + + Removed for now. + +