pavelbabenko / react-native-awesome-gallery

Performant, native-like, and well-customizable gallery for React Native.
MIT License
495 stars 54 forks source link

Doesn't work on Android #89

Closed applecat closed 7 hours ago

applecat commented 1 day ago

React Native Awesome Gallery works really well on iOS (both on emulator and on device), but does not work on Android for some reason — the first image of the gallery is shown, but it does not respond to any gestures — swipe, pinch, zoom and double tap.

Tested on blank new RN project:

npx create-expo-app@latest my-app
cd my-app
npm i react-native-awesome-gallery

index.tsx:

import Gallery from 'react-native-awesome-gallery';

const images = [
  'https://images.unsplash.com/photo-1417325384643-aac51acc9e5d?q=75&fm=jpg&w=400&fit=max',
  'https://images.unsplash.com/photo-1461988320302-91bde64fc8e4?ixid=2yJhcHBfaWQiOjEyMDd9&&fm=jpg&w=400&fit=max',
  'https://images.unsplash.com/1/type-away.jpg?q=80&fm=jpg&w=400&fit=max',
]

export default function HomeScreen() {
  return (
    <View>
      <Gallery
        data={images}
        onIndexChange={(newIndex) => {
          console.log(newIndex);
        }}
      />
  )
}

package.json:

"dependencies": {
    "@expo/vector-icons": "^14.0.2",
    "@react-navigation/bottom-tabs": "^7.0.0",
    "@react-navigation/native": "^7.0.0",
    "expo": "~52.0.8",
    "expo-blur": "~14.0.1",
    "expo-constants": "~17.0.3",
    "expo-font": "~13.0.1",
    "expo-haptics": "~14.0.0",
    "expo-linking": "~7.0.3",
    "expo-router": "~4.0.7",
    "expo-splash-screen": "~0.29.11",
    "expo-status-bar": "~2.0.0",
    "expo-symbols": "~0.2.0",
    "expo-system-ui": "~4.0.3",
    "expo-web-browser": "~14.0.1",
    "react": "18.3.1",
    "react-dom": "18.3.1",
    "react-native": "0.76.2",
    "react-native-awesome-gallery": "^0.4.3",
    "react-native-gesture-handler": "~2.20.2",
    "react-native-reanimated": "~3.16.1",
    "react-native-safe-area-context": "4.12.0",
    "react-native-screens": "~4.1.0",
    "react-native-web": "~0.19.13",
    "react-native-webview": "13.12.4"
  },
  "devDependencies": {
    "@babel/core": "^7.25.2",
    "@types/jest": "^29.5.12",
    "@types/react": "~18.3.12",
    "@types/react-test-renderer": "^18.3.0",
    "jest": "^29.2.1",
    "jest-expo": "~52.0.2",
    "react-test-renderer": "18.3.1",
    "typescript": "^5.3.3"
  },
pavelbabenko commented 7 hours ago

@applecat Try adding flex: 1 to container