├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── .prettierrc.json ├── .vscode ├── launch.json └── settings.json ├── Example ├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App.tsx ├── README.md ├── __tests__ │ └── App-test.js ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── reanimatedgalleryexample │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── reactnativegallerytoolkitexample │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── assets │ └── images │ │ ├── Airplane.svg │ │ ├── Bookmark.svg │ │ ├── Bubble.svg │ │ └── Heart.svg ├── babel.config.js ├── index.js ├── ios │ ├── Podfile │ ├── Podfile.lock │ ├── ReactNativeGalleryToolkitExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── ReactNativeGalleryToolkitExample-tvOS.xcscheme │ │ │ └── ReactNativeGalleryToolkitExample.xcscheme │ ├── ReactNativeGalleryToolkitExample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── ReactNativeGalleryToolkitExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.mm │ │ ├── Base.lproj │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m ├── metro.config.js ├── package.json ├── src │ ├── DetachedHeader.tsx │ ├── ImageTransformerExamples │ │ ├── ImageTransformerTest.tsx │ │ └── index.tsx │ ├── PagerExamples │ │ ├── PagerExampleScreen.tsx │ │ └── index.tsx │ ├── ScalableImageExamples │ │ ├── InstagramFeed │ │ │ └── InstagramFeed.tsx │ │ ├── ScalableImageExample.tsx │ │ └── index.tsx │ ├── SimpleGalleryExamples │ │ ├── Basic.tsx │ │ ├── FullFeatured.tsx │ │ ├── Map.tsx │ │ └── index.tsx │ ├── helpers.ts │ └── hooks │ │ └── useControls.tsx ├── tsconfig.json └── yarn.lock ├── IDEAS.md ├── LICENSE ├── README.md ├── gifs ├── promo.gif └── promo_2.gif ├── lerna.json ├── package.json ├── packages ├── common │ ├── package.json │ ├── src │ │ ├── common.ts │ │ ├── index.ts │ │ ├── useAnimatedGestureHandler.tsx │ │ ├── useInit.ts │ │ └── vectors.ts │ ├── tsconfig.build.json │ └── tsconfig.json ├── image-transformer │ ├── package.json │ ├── src │ │ ├── ImageTransformer.tsx │ │ └── index.tsx │ ├── tsconfig.build.json │ └── tsconfig.json ├── pager │ ├── package.json │ ├── src │ │ ├── Pager.tsx │ │ └── index.tsx │ ├── tsconfig.build.json │ └── tsconfig.json ├── scalable-image │ ├── package.json │ ├── src │ │ ├── ScalableImage.tsx │ │ └── index.tsx │ ├── tsconfig.build.json │ └── tsconfig.json └── simple-gallery │ ├── package.json │ ├── src │ ├── SimpleGallery.tsx │ └── index.tsx │ ├── tsconfig.build.json │ └── tsconfig.json ├── tsconfig.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # http://editorconfig.org 4 | 5 | root = true 6 | 7 | [*.{js,jsx,ts,tsx}] 8 | indent_style = space 9 | indent_size = 2 10 | end_of_line = lf 11 | charset = utf-8 12 | trim_trailing_whitespace = true 13 | insert_final_newline = true 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | const { peerDependencies } = require('./package.json'); 2 | 3 | module.exports = { 4 | root: true, 5 | extends: ['airbnb', 'prettier', 'prettier/react'], 6 | parser: '@typescript-eslint/parser', 7 | plugins: [ 8 | 'react', 9 | 'react-native', 10 | 'import', 11 | '@typescript-eslint/eslint-plugin', 12 | ], 13 | rules: { 14 | 'import/no-extraneous-dependencies': [ 15 | 'error', 16 | { devDependencies: true, peerDependencies: true }, 17 | ], 18 | 'import/prefer-default-export': 0, 19 | 'react/jsx-filename-extension': [ 20 | 'error', 21 | { extensions: ['.tsx'] }, 22 | ], 23 | // This rule doesn't play nice with Prettier 24 | 'react/jsx-one-expression-per-line': 'off', 25 | // This rule doesn't play nice with Prettier 26 | 'react/jsx-wrap-multilines': 'off', 27 | // Remove this rule because we only destructure props, but never state 28 | 'react/destructuring-assignment': 'off', 29 | 'react/prop-types': 'off', 30 | 'react/jsx-props-no-spreading': 'off', 31 | 'react/static-property-placement': 'off', 32 | 'react/state-in-constructor': 'off', 33 | 'no-unused-vars': 'off', 34 | '@typescript-eslint/no-unused-vars': ['error'], 35 | 'no-underscore-dangle': 0, 36 | 'class-methods-use-this': 0, 37 | 'no-param-reassign': 0, 38 | 'no-use-before-define': [ 39 | 'error', 40 | { functions: false, classes: false }, 41 | ], 42 | 'import/no-unresolved': ["error", { ignore: Object.keys(peerDependencies) }] 43 | 'no-void': 0, 44 | 'import/extensions': 0, 45 | }, 46 | settings: { 47 | 'import/resolver': { 48 | node: { 49 | extensions: [ 50 | '.js', 51 | '.android.js', 52 | '.ios.js', 53 | '.jsx', 54 | '.android.jsx', 55 | '.ios.jsx', 56 | '.tsx', 57 | '.ts', 58 | '.android.tsx', 59 | '.android.ts', 60 | '.ios.tsx', 61 | '.ios.ts', 62 | ], 63 | }, 64 | }, 65 | }, 66 | }; 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | src-old -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": false, 3 | "printWidth": 70, 4 | "tabWidth": 2, 5 | "singleQuote": true, 6 | "trailingComma": "all", 7 | "jsxBracketSameLine": false, 8 | "parser": "typescript", 9 | "noSemi": false, 10 | "rcVerbose": true, 11 | "arrowParens": "always" 12 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | {"name":"Attach to packager","request":"attach","type":"reactnative","cwd":"${workspaceFolder}/Example"} 8 | 9 | ] 10 | } -------------------------------------------------------------------------------- /Example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /Example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['../.eslintrc.js'], 3 | settings: { 4 | 'import/core-modules': [ 5 | 'react-native-gallery-toolkit', 6 | 'react-native-gesture-handler', 7 | 'react-native-reanimated', 8 | ], 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /Example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; These should not be required directly 12 | ; require from fbjs/lib instead: require('fbjs/lib/warning') 13 | node_modules/warning/.* 14 | 15 | ; Flow doesn't support platforms 16 | .*/Libraries/Utilities/LoadingView.js 17 | 18 | [untyped] 19 | .*/node_modules/@react-native-community/cli/.*/.* 20 | 21 | [include] 22 | 23 | [libs] 24 | node_modules/react-native/interface.js 25 | node_modules/react-native/flow/ 26 | 27 | [options] 28 | emoji=true 29 | 30 | esproposal.optional_chaining=enable 31 | esproposal.nullish_coalescing=enable 32 | 33 | module.file_ext=.js 34 | module.file_ext=.json 35 | module.file_ext=.ios.js 36 | 37 | munge_underscores=true 38 | 39 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 40 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 41 | 42 | suppress_type=$FlowIssue 43 | suppress_type=$FlowFixMe 44 | suppress_type=$FlowFixMeProps 45 | suppress_type=$FlowFixMeState 46 | 47 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ 49 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 50 | 51 | [lints] 52 | sketchy-null-number=warn 53 | sketchy-null-mixed=warn 54 | sketchy-number=warn 55 | untyped-type-import=warn 56 | nonstrict-import=warn 57 | deprecated-type=warn 58 | unsafe-getters-setters=warn 59 | inexact-spread=warn 60 | unnecessary-invariant=warn 61 | signature-verification-failure=warn 62 | deprecated-utility=error 63 | 64 | [strict] 65 | deprecated-type 66 | nonstrict-import 67 | sketchy-null 68 | unclear-type 69 | unsafe-getters-setters 70 | untyped-import 71 | untyped-type-import 72 | 73 | [version] 74 | ^0.113.0 75 | -------------------------------------------------------------------------------- /Example/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /Example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | lib -------------------------------------------------------------------------------- /Example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Example/App.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | NavigationContainer, 3 | useFocusEffect, 4 | useNavigation, 5 | } from '@react-navigation/native'; 6 | import { createStackNavigator } from '@react-navigation/stack'; 7 | import React from 'react'; 8 | import { ScrollView, StatusBar, Text } from 'react-native'; 9 | import { RectButton } from 'react-native-gesture-handler'; 10 | import ImageTransformerTest from './src/ImageTransformerExamples'; 11 | import PagerTest from './src/PagerExamples'; 12 | import ScalableImage from './src/ScalableImageExamples'; 13 | import SimpleGalleryTest from './src/SimpleGalleryExamples'; 14 | 15 | const Stack = createStackNavigator(); 16 | 17 | const routes: React.ComponentProps[] = [ 18 | { name: 'Image Transformer', component: ImageTransformerTest }, 19 | { name: 'Pager', component: PagerTest }, 20 | { name: 'Scalable image', component: ScalableImage }, 21 | { name: 'Simple gallery', component: SimpleGalleryTest }, 22 | ]; 23 | 24 | export function RoutesList({ 25 | routes, 26 | }: { 27 | routes: React.ComponentProps[]; 28 | }) { 29 | const nav = useNavigation(); 30 | 31 | return ( 32 | 33 | {routes.map((route) => ( 34 | nav.navigate(route.name)} 37 | style={{ 38 | height: 64, 39 | alignItems: 'center', 40 | flexDirection: 'row', 41 | justifyContent: 'space-between', 42 | padding: 16, 43 | backgroundColor: 'white', 44 | borderBottomColor: '#ccc', 45 | borderBottomWidth: 1, 46 | }} 47 | > 48 | {route.name} 49 | 50 | 51 | ))} 52 | 53 | ); 54 | } 55 | 56 | export function Home() { 57 | useFocusEffect(() => { 58 | StatusBar.setHidden(false); 59 | }); 60 | 61 | return ; 62 | } 63 | 64 | export default function App() { 65 | return ( 66 | <> 67 | 68 | 69 | 77 | 84 | 85 | {routes.map((route) => ( 86 | 87 | ))} 88 | 89 | 90 | 91 | ); 92 | } 93 | -------------------------------------------------------------------------------- /Example/README.md: -------------------------------------------------------------------------------- 1 | # React Native Gallery Toolkit Examples 2 | 3 | ## How to run 4 | 5 | Install all the dependencies: 6 | 7 | ```bash 8 | npm install 9 | ``` 10 | 11 | ### Running on iOS 12 | 13 | Before running the app, install the cocoapods dependencies: 14 | 15 | ```bash 16 | npx pod-install 17 | ``` 18 | 19 | Now, you can start the app: 20 | 21 | ```bash 22 | npm run ios 23 | ``` 24 | 25 | ### Running on Android 26 | 27 | ```bash 28 | npm run android 29 | ``` 30 | -------------------------------------------------------------------------------- /Example/__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /Example/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.reactnativegallerytoolkitexample", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.reactnativegallerytoolkitexample", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /Example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation. If none specified and 19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 20 | * // default. Can be overridden with ENTRY_FILE environment variable. 21 | * entryFile: "index.android.js", 22 | * 23 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format 24 | * bundleCommand: "ram-bundle", 25 | * 26 | * // whether to bundle JS and assets in debug mode 27 | * bundleInDebug: false, 28 | * 29 | * // whether to bundle JS and assets in release mode 30 | * bundleInRelease: true, 31 | * 32 | * // whether to bundle JS and assets in another build variant (if configured). 33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 34 | * // The configuration property can be in the following formats 35 | * // 'bundleIn${productFlavor}${buildType}' 36 | * // 'bundleIn${buildType}' 37 | * // bundleInFreeDebug: true, 38 | * // bundleInPaidRelease: true, 39 | * // bundleInBeta: true, 40 | * 41 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 42 | * // for example: to disable dev mode in the staging build type (if configured) 43 | * devDisabledInStaging: true, 44 | * // The configuration property can be in the following formats 45 | * // 'devDisabledIn${productFlavor}${buildType}' 46 | * // 'devDisabledIn${buildType}' 47 | * 48 | * // the root of your project, i.e. where "package.json" lives 49 | * root: "../../", 50 | * 51 | * // where to put the JS bundle asset in debug mode 52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 53 | * 54 | * // where to put the JS bundle asset in release mode 55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 56 | * 57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 58 | * // require('./image.png')), in debug mode 59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 60 | * 61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 62 | * // require('./image.png')), in release mode 63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 64 | * 65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 69 | * // for example, you might want to remove it from here. 70 | * inputExcludes: ["android/**", "ios/**"], 71 | * 72 | * // override which node gets called and with what additional arguments 73 | * nodeExecutableAndArgs: ["node"], 74 | * 75 | * // supply additional arguments to the packager 76 | * extraPackagerArgs: [] 77 | * ] 78 | */ 79 | 80 | project.ext.react = [ 81 | enableHermes: true, // clean and rebuild if changing 82 | ] 83 | 84 | apply from: "../../node_modules/react-native/react.gradle" 85 | 86 | /** 87 | * Set this to true to create two separate APKs instead of one: 88 | * - An APK that only works on ARM devices 89 | * - An APK that only works on x86 devices 90 | * The advantage is the size of the APK is reduced by about 4MB. 91 | * Upload all the APKs to the Play Store and people will download 92 | * the correct one based on the CPU architecture of their device. 93 | */ 94 | def enableSeparateBuildPerCPUArchitecture = false 95 | 96 | /** 97 | * Run Proguard to shrink the Java bytecode in release builds. 98 | */ 99 | def enableProguardInReleaseBuilds = false 100 | 101 | /** 102 | * The preferred build flavor of JavaScriptCore. 103 | * 104 | * For example, to use the international variant, you can use: 105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 106 | * 107 | * The international variant includes ICU i18n library and necessary data 108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 109 | * give correct results when using with locales other than en-US. Note that 110 | * this variant is about 6MiB larger per architecture than default. 111 | */ 112 | def jscFlavor = 'org.webkit:android-jsc:+' 113 | 114 | /** 115 | * Whether to enable the Hermes VM. 116 | * 117 | * This should be set on project.ext.react and mirrored here. If it is not set 118 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 119 | * and the benefits of using Hermes will therefore be sharply reduced. 120 | */ 121 | def enableHermes = project.ext.react.get("enableHermes", false); 122 | 123 | android { 124 | compileSdkVersion rootProject.ext.compileSdkVersion 125 | 126 | compileOptions { 127 | sourceCompatibility JavaVersion.VERSION_1_8 128 | targetCompatibility JavaVersion.VERSION_1_8 129 | } 130 | 131 | defaultConfig { 132 | applicationId "com.reactnativegallerytoolkitexample" 133 | minSdkVersion rootProject.ext.minSdkVersion 134 | targetSdkVersion rootProject.ext.targetSdkVersion 135 | versionCode 1 136 | versionName "1.0" 137 | } 138 | splits { 139 | abi { 140 | reset() 141 | enable enableSeparateBuildPerCPUArchitecture 142 | universalApk false // If true, also generate a universal APK 143 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 144 | } 145 | } 146 | signingConfigs { 147 | debug { 148 | storeFile file('debug.keystore') 149 | storePassword 'android' 150 | keyAlias 'androiddebugkey' 151 | keyPassword 'android' 152 | } 153 | release { 154 | storeFile file('debug.keystore') 155 | storePassword 'android' 156 | keyAlias 'androiddebugkey' 157 | keyPassword 'android' 158 | } 159 | } 160 | buildTypes { 161 | debug { 162 | signingConfig signingConfigs.debug 163 | } 164 | release { 165 | // Caution! In production, you need to generate your own keystore file. 166 | // see https://facebook.github.io/react-native/docs/signed-apk-android. 167 | signingConfig signingConfigs.debug 168 | minifyEnabled enableProguardInReleaseBuilds 169 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 170 | } 171 | } 172 | 173 | // applicationVariants are e.g. debug, release 174 | applicationVariants.all { variant -> 175 | variant.outputs.each { output -> 176 | // For each separate APK per architecture, set a unique version code as described here: 177 | // https://developer.android.com/studio/build/configure-apk-splits.html 178 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 179 | def abi = output.getFilter(OutputFile.ABI) 180 | if (abi != null) { // null for the universal-debug, universal-release variants 181 | output.versionCodeOverride = 182 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 183 | } 184 | 185 | } 186 | } 187 | } 188 | 189 | dependencies { 190 | implementation fileTree(dir: "libs", include: ["*.jar"]) 191 | //noinspection GradleDynamicVersion 192 | implementation "com.facebook.react:react-native:+" // From node_modules 193 | 194 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 195 | 196 | // debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 197 | // exclude group:'com.facebook.fbjni' 198 | // } 199 | 200 | // debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 201 | // exclude group:'com.facebook.flipper' 202 | // exclude group:'com.squareup.okhttp3', module:'okhttp' 203 | // } 204 | 205 | // debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 206 | // exclude group:'com.facebook.flipper' 207 | // } 208 | 209 | if (enableHermes) { 210 | def hermesPath = "../../../node_modules/hermes-engine/android/"; 211 | debugImplementation files(hermesPath + "hermes-debug.aar") 212 | releaseImplementation files(hermesPath + "hermes-release.aar") 213 | } else { 214 | implementation jscFlavor 215 | } 216 | } 217 | 218 | // Run this once to be able to run the application with BUCK 219 | // puts all compile dependencies into folder libs for BUCK to use 220 | task copyDownloadableDepsToLibs(type: Copy) { 221 | from configurations.implementation 222 | into 'libs' 223 | } 224 | 225 | apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); 226 | applyNativeModulesAppBuildGradle(project) 227 | -------------------------------------------------------------------------------- /Example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /Example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/debug.keystore -------------------------------------------------------------------------------- /Example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /Example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Example/android/app/src/debug/java/com/reanimatedgalleryexample/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | // /** 2 | // * Copyright (c) Facebook, Inc. and its affiliates. 3 | // * 4 | // *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | // * directory of this source tree. 6 | // */ 7 | // package com.reactnativegallerytoolkitexample; 8 | 9 | // import android.content.Context; 10 | // import com.facebook.flipper.android.AndroidFlipperClient; 11 | // import com.facebook.flipper.android.utils.FlipperUtils; 12 | // import com.facebook.flipper.core.FlipperClient; 13 | // import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | // import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | // import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | // import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | // import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | // import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | // import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | // import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | // import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | // import com.facebook.react.ReactInstanceManager; 23 | // import com.facebook.react.bridge.ReactContext; 24 | // import com.facebook.react.modules.network.NetworkingModule; 25 | // import okhttp3.OkHttpClient; 26 | 27 | // public class ReactNativeFlipper { 28 | // public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 29 | // if (FlipperUtils.shouldEnableFlipper(context)) { 30 | // final FlipperClient client = AndroidFlipperClient.getInstance(context); 31 | 32 | // client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 33 | // client.addPlugin(new ReactFlipperPlugin()); 34 | // client.addPlugin(new DatabasesFlipperPlugin(context)); 35 | // client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 36 | // client.addPlugin(CrashReporterPlugin.getInstance()); 37 | 38 | // NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 39 | // NetworkingModule.setCustomClientBuilder( 40 | // new NetworkingModule.CustomClientBuilder() { 41 | // @Override 42 | // public void apply(OkHttpClient.Builder builder) { 43 | // builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 44 | // } 45 | // }); 46 | // client.addPlugin(networkFlipperPlugin); 47 | // client.start(); 48 | 49 | // // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 50 | // // Hence we run if after all native modules have been initialized 51 | // ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 52 | // if (reactContext == null) { 53 | // reactInstanceManager.addReactInstanceEventListener( 54 | // new ReactInstanceManager.ReactInstanceEventListener() { 55 | // @Override 56 | // public void onReactContextInitialized(ReactContext reactContext) { 57 | // reactInstanceManager.removeReactInstanceEventListener(this); 58 | // reactContext.runOnNativeModulesQueueThread( 59 | // new Runnable() { 60 | // @Override 61 | // public void run() { 62 | // client.addPlugin(new FrescoFlipperPlugin()); 63 | // } 64 | // }); 65 | // } 66 | // }); 67 | // } else { 68 | // client.addPlugin(new FrescoFlipperPlugin()); 69 | // } 70 | // } 71 | // } 72 | // } 73 | -------------------------------------------------------------------------------- /Example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/android/app/src/main/java/com/reactnativegallerytoolkitexample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.reactnativegallerytoolkitexample; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactActivityDelegate; 5 | import com.facebook.react.ReactRootView; 6 | import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; 7 | 8 | public class MainActivity extends ReactActivity { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. This is used to schedule 12 | * rendering of the component. 13 | */ 14 | @Override 15 | protected String getMainComponentName() { 16 | return "ReactNativeGalleryToolkitExample"; 17 | } 18 | 19 | @Override 20 | protected ReactActivityDelegate createReactActivityDelegate() { 21 | return new ReactActivityDelegate(this, getMainComponentName()) { 22 | @Override 23 | protected ReactRootView createRootView() { 24 | return new RNGestureHandlerEnabledRootView(MainActivity.this); 25 | } 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Example/android/app/src/main/java/com/reactnativegallerytoolkitexample/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.reactnativegallerytoolkitexample; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | import com.facebook.react.config.ReactFeatureFlags; 14 | import com.facebook.react.bridge.JSIModulePackage; // <- add 15 | import com.swmansion.reanimated.ReanimatedJSIModulePackage; // <- add 16 | 17 | public class MainApplication extends Application implements ReactApplication { 18 | private final ReactNativeHost mReactNativeHost = 19 | new ReactNativeHost(this) { 20 | @Override 21 | public boolean getUseDeveloperSupport() { 22 | return BuildConfig.DEBUG; 23 | } 24 | 25 | @Override 26 | protected List getPackages() { 27 | @SuppressWarnings("UnnecessaryLocalVariable") 28 | List packages = new PackageList(this).getPackages(); 29 | // Packages that cannot be autolinked yet can be added manually here, for example: 30 | // packages.add(new MyReactNativePackage()); 31 | return packages; 32 | } 33 | 34 | @Override 35 | protected String getJSMainModuleName() { 36 | return "index"; 37 | } 38 | 39 | @Override 40 | protected JSIModulePackage getJSIModulePackage() { 41 | return new ReanimatedJSIModulePackage(); // <- add 42 | } 43 | }; 44 | 45 | @Override 46 | public ReactNativeHost getReactNativeHost() { 47 | return mReactNativeHost; 48 | } 49 | 50 | @Override 51 | public void onCreate() { 52 | super.onCreate(); 53 | SoLoader.init(this, /* native exopackage */ false); 54 | // initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 55 | } 56 | 57 | /** 58 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 59 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 60 | * 61 | * @param context 62 | * @param reactInstanceManager 63 | */ 64 | // private static void initializeFlipper( 65 | // Context context, ReactInstanceManager reactInstanceManager) { 66 | // if (BuildConfig.DEBUG) { 67 | // try { 68 | // /* 69 | // We use reflection here to pick up the class that initializes Flipper, 70 | // since Flipper library is not available in release mode 71 | // */ 72 | // Class aClass = Class.forName("com.reactnativegallerytoolkitexample.ReactNativeFlipper"); 73 | // aClass 74 | // .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 75 | // .invoke(null, context, reactInstanceManager); 76 | // } catch (ClassNotFoundException e) { 77 | // e.printStackTrace(); 78 | // } catch (NoSuchMethodException e) { 79 | // e.printStackTrace(); 80 | // } catch (IllegalAccessException e) { 81 | // e.printStackTrace(); 82 | // } catch (InvocationTargetException e) { 83 | // e.printStackTrace(); 84 | // } 85 | // } 86 | // } 87 | } 88 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ReactNativeGalleryToolkitExample 3 | 4 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "30.0.2" 6 | minSdkVersion = 21 7 | compileSdkVersion = 30 8 | targetSdkVersion = 30 9 | } 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:4.2.1") 16 | 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenCentral() 25 | mavenLocal() 26 | maven { 27 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 28 | url("$rootDir/../node_modules/react-native/android") 29 | } 30 | maven { 31 | // Android JSC is installed from npm 32 | url("$rootDir/../node_modules/jsc-android/dist") 33 | } 34 | 35 | google() 36 | jcenter() 37 | maven { url 'https://www.jitpack.io' } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | # FLIPPER_VERSION=0.37.0 29 | -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /Example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" -------------------------------------------------------------------------------- /Example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega -------------------------------------------------------------------------------- /Example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ReactNativeGalleryToolkitExample' 2 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); 3 | applyNativeModulesSettingsGradle(settings) 4 | include ':app' 5 | -------------------------------------------------------------------------------- /Example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ReactNativeGalleryToolkitExample", 3 | "displayName": "ReactNativeGalleryToolkitExample" 4 | } -------------------------------------------------------------------------------- /Example/assets/images/Airplane.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/assets/images/Airplane.svg -------------------------------------------------------------------------------- /Example/assets/images/Bookmark.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/assets/images/Bookmark.svg -------------------------------------------------------------------------------- /Example/assets/images/Bubble.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/assets/images/Bubble.svg -------------------------------------------------------------------------------- /Example/assets/images/Heart.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terrysahaidak/react-native-gallery-toolkit/9c2557f1c855cfd43efa6d479581376c872e0254/Example/assets/images/Heart.svg -------------------------------------------------------------------------------- /Example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | plugins: [ 4 | 'react-native-reanimated/plugin', 5 | [ 6 | 'module-resolver', 7 | { 8 | alias: { 9 | 'react-native-gallery-toolkit': '../src/index', 10 | }, 11 | }, 12 | ], 13 | ], 14 | }; 15 | -------------------------------------------------------------------------------- /Example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import { AppRegistry } from 'react-native'; 6 | import { name as appName } from './app.json'; 7 | import App from './App.tsx'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /Example/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | platform :ios, '11.0' 4 | 5 | target 'ReactNativeGalleryToolkitExample' do 6 | config = use_native_modules! 7 | 8 | 9 | use_react_native!(:path => "../../node_modules/react-native") 10 | 11 | # Enables Flipper. 12 | # 13 | # Note that if you have use_frameworks! enabled, Flipper will not work and 14 | # you should disable these next few lines. 15 | # use_flipper! 16 | # post_install do |installer| 17 | # flipper_post_install(installer) 18 | # end 19 | 20 | post_install do |installer| 21 | react_native_post_install(installer) 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /Example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost-for-react-native (1.63.0) 3 | - DoubleConversion (1.1.6) 4 | - FBLazyVector (0.65.1) 5 | - FBReactNativeSpec (0.65.1): 6 | - RCT-Folly (= 2021.04.26.00) 7 | - RCTRequired (= 0.65.1) 8 | - RCTTypeSafety (= 0.65.1) 9 | - React-Core (= 0.65.1) 10 | - React-jsi (= 0.65.1) 11 | - ReactCommon/turbomodule/core (= 0.65.1) 12 | - fmt (6.2.1) 13 | - glog (0.3.5) 14 | - RCT-Folly (2021.04.26.00): 15 | - boost-for-react-native 16 | - DoubleConversion 17 | - fmt (~> 6.2.1) 18 | - glog 19 | - RCT-Folly/Default (= 2021.04.26.00) 20 | - RCT-Folly/Default (2021.04.26.00): 21 | - boost-for-react-native 22 | - DoubleConversion 23 | - fmt (~> 6.2.1) 24 | - glog 25 | - RCTRequired (0.65.1) 26 | - RCTTypeSafety (0.65.1): 27 | - FBLazyVector (= 0.65.1) 28 | - RCT-Folly (= 2021.04.26.00) 29 | - RCTRequired (= 0.65.1) 30 | - React-Core (= 0.65.1) 31 | - React (0.65.1): 32 | - React-Core (= 0.65.1) 33 | - React-Core/DevSupport (= 0.65.1) 34 | - React-Core/RCTWebSocket (= 0.65.1) 35 | - React-RCTActionSheet (= 0.65.1) 36 | - React-RCTAnimation (= 0.65.1) 37 | - React-RCTBlob (= 0.65.1) 38 | - React-RCTImage (= 0.65.1) 39 | - React-RCTLinking (= 0.65.1) 40 | - React-RCTNetwork (= 0.65.1) 41 | - React-RCTSettings (= 0.65.1) 42 | - React-RCTText (= 0.65.1) 43 | - React-RCTVibration (= 0.65.1) 44 | - React-callinvoker (0.65.1) 45 | - React-Core (0.65.1): 46 | - glog 47 | - RCT-Folly (= 2021.04.26.00) 48 | - React-Core/Default (= 0.65.1) 49 | - React-cxxreact (= 0.65.1) 50 | - React-jsi (= 0.65.1) 51 | - React-jsiexecutor (= 0.65.1) 52 | - React-perflogger (= 0.65.1) 53 | - Yoga 54 | - React-Core/CoreModulesHeaders (0.65.1): 55 | - glog 56 | - RCT-Folly (= 2021.04.26.00) 57 | - React-Core/Default 58 | - React-cxxreact (= 0.65.1) 59 | - React-jsi (= 0.65.1) 60 | - React-jsiexecutor (= 0.65.1) 61 | - React-perflogger (= 0.65.1) 62 | - Yoga 63 | - React-Core/Default (0.65.1): 64 | - glog 65 | - RCT-Folly (= 2021.04.26.00) 66 | - React-cxxreact (= 0.65.1) 67 | - React-jsi (= 0.65.1) 68 | - React-jsiexecutor (= 0.65.1) 69 | - React-perflogger (= 0.65.1) 70 | - Yoga 71 | - React-Core/DevSupport (0.65.1): 72 | - glog 73 | - RCT-Folly (= 2021.04.26.00) 74 | - React-Core/Default (= 0.65.1) 75 | - React-Core/RCTWebSocket (= 0.65.1) 76 | - React-cxxreact (= 0.65.1) 77 | - React-jsi (= 0.65.1) 78 | - React-jsiexecutor (= 0.65.1) 79 | - React-jsinspector (= 0.65.1) 80 | - React-perflogger (= 0.65.1) 81 | - Yoga 82 | - React-Core/RCTActionSheetHeaders (0.65.1): 83 | - glog 84 | - RCT-Folly (= 2021.04.26.00) 85 | - React-Core/Default 86 | - React-cxxreact (= 0.65.1) 87 | - React-jsi (= 0.65.1) 88 | - React-jsiexecutor (= 0.65.1) 89 | - React-perflogger (= 0.65.1) 90 | - Yoga 91 | - React-Core/RCTAnimationHeaders (0.65.1): 92 | - glog 93 | - RCT-Folly (= 2021.04.26.00) 94 | - React-Core/Default 95 | - React-cxxreact (= 0.65.1) 96 | - React-jsi (= 0.65.1) 97 | - React-jsiexecutor (= 0.65.1) 98 | - React-perflogger (= 0.65.1) 99 | - Yoga 100 | - React-Core/RCTBlobHeaders (0.65.1): 101 | - glog 102 | - RCT-Folly (= 2021.04.26.00) 103 | - React-Core/Default 104 | - React-cxxreact (= 0.65.1) 105 | - React-jsi (= 0.65.1) 106 | - React-jsiexecutor (= 0.65.1) 107 | - React-perflogger (= 0.65.1) 108 | - Yoga 109 | - React-Core/RCTImageHeaders (0.65.1): 110 | - glog 111 | - RCT-Folly (= 2021.04.26.00) 112 | - React-Core/Default 113 | - React-cxxreact (= 0.65.1) 114 | - React-jsi (= 0.65.1) 115 | - React-jsiexecutor (= 0.65.1) 116 | - React-perflogger (= 0.65.1) 117 | - Yoga 118 | - React-Core/RCTLinkingHeaders (0.65.1): 119 | - glog 120 | - RCT-Folly (= 2021.04.26.00) 121 | - React-Core/Default 122 | - React-cxxreact (= 0.65.1) 123 | - React-jsi (= 0.65.1) 124 | - React-jsiexecutor (= 0.65.1) 125 | - React-perflogger (= 0.65.1) 126 | - Yoga 127 | - React-Core/RCTNetworkHeaders (0.65.1): 128 | - glog 129 | - RCT-Folly (= 2021.04.26.00) 130 | - React-Core/Default 131 | - React-cxxreact (= 0.65.1) 132 | - React-jsi (= 0.65.1) 133 | - React-jsiexecutor (= 0.65.1) 134 | - React-perflogger (= 0.65.1) 135 | - Yoga 136 | - React-Core/RCTSettingsHeaders (0.65.1): 137 | - glog 138 | - RCT-Folly (= 2021.04.26.00) 139 | - React-Core/Default 140 | - React-cxxreact (= 0.65.1) 141 | - React-jsi (= 0.65.1) 142 | - React-jsiexecutor (= 0.65.1) 143 | - React-perflogger (= 0.65.1) 144 | - Yoga 145 | - React-Core/RCTTextHeaders (0.65.1): 146 | - glog 147 | - RCT-Folly (= 2021.04.26.00) 148 | - React-Core/Default 149 | - React-cxxreact (= 0.65.1) 150 | - React-jsi (= 0.65.1) 151 | - React-jsiexecutor (= 0.65.1) 152 | - React-perflogger (= 0.65.1) 153 | - Yoga 154 | - React-Core/RCTVibrationHeaders (0.65.1): 155 | - glog 156 | - RCT-Folly (= 2021.04.26.00) 157 | - React-Core/Default 158 | - React-cxxreact (= 0.65.1) 159 | - React-jsi (= 0.65.1) 160 | - React-jsiexecutor (= 0.65.1) 161 | - React-perflogger (= 0.65.1) 162 | - Yoga 163 | - React-Core/RCTWebSocket (0.65.1): 164 | - glog 165 | - RCT-Folly (= 2021.04.26.00) 166 | - React-Core/Default (= 0.65.1) 167 | - React-cxxreact (= 0.65.1) 168 | - React-jsi (= 0.65.1) 169 | - React-jsiexecutor (= 0.65.1) 170 | - React-perflogger (= 0.65.1) 171 | - Yoga 172 | - React-CoreModules (0.65.1): 173 | - FBReactNativeSpec (= 0.65.1) 174 | - RCT-Folly (= 2021.04.26.00) 175 | - RCTTypeSafety (= 0.65.1) 176 | - React-Core/CoreModulesHeaders (= 0.65.1) 177 | - React-jsi (= 0.65.1) 178 | - React-RCTImage (= 0.65.1) 179 | - ReactCommon/turbomodule/core (= 0.65.1) 180 | - React-cxxreact (0.65.1): 181 | - boost-for-react-native (= 1.63.0) 182 | - DoubleConversion 183 | - glog 184 | - RCT-Folly (= 2021.04.26.00) 185 | - React-callinvoker (= 0.65.1) 186 | - React-jsi (= 0.65.1) 187 | - React-jsinspector (= 0.65.1) 188 | - React-perflogger (= 0.65.1) 189 | - React-runtimeexecutor (= 0.65.1) 190 | - React-jsi (0.65.1): 191 | - boost-for-react-native (= 1.63.0) 192 | - DoubleConversion 193 | - glog 194 | - RCT-Folly (= 2021.04.26.00) 195 | - React-jsi/Default (= 0.65.1) 196 | - React-jsi/Default (0.65.1): 197 | - boost-for-react-native (= 1.63.0) 198 | - DoubleConversion 199 | - glog 200 | - RCT-Folly (= 2021.04.26.00) 201 | - React-jsiexecutor (0.65.1): 202 | - DoubleConversion 203 | - glog 204 | - RCT-Folly (= 2021.04.26.00) 205 | - React-cxxreact (= 0.65.1) 206 | - React-jsi (= 0.65.1) 207 | - React-perflogger (= 0.65.1) 208 | - React-jsinspector (0.65.1) 209 | - react-native-safe-area-context (3.3.2): 210 | - React-Core 211 | - react-native-video (5.1.1): 212 | - React-Core 213 | - react-native-video/Video (= 5.1.1) 214 | - react-native-video/Video (5.1.1): 215 | - React-Core 216 | - React-perflogger (0.65.1) 217 | - React-RCTActionSheet (0.65.1): 218 | - React-Core/RCTActionSheetHeaders (= 0.65.1) 219 | - React-RCTAnimation (0.65.1): 220 | - FBReactNativeSpec (= 0.65.1) 221 | - RCT-Folly (= 2021.04.26.00) 222 | - RCTTypeSafety (= 0.65.1) 223 | - React-Core/RCTAnimationHeaders (= 0.65.1) 224 | - React-jsi (= 0.65.1) 225 | - ReactCommon/turbomodule/core (= 0.65.1) 226 | - React-RCTBlob (0.65.1): 227 | - FBReactNativeSpec (= 0.65.1) 228 | - RCT-Folly (= 2021.04.26.00) 229 | - React-Core/RCTBlobHeaders (= 0.65.1) 230 | - React-Core/RCTWebSocket (= 0.65.1) 231 | - React-jsi (= 0.65.1) 232 | - React-RCTNetwork (= 0.65.1) 233 | - ReactCommon/turbomodule/core (= 0.65.1) 234 | - React-RCTImage (0.65.1): 235 | - FBReactNativeSpec (= 0.65.1) 236 | - RCT-Folly (= 2021.04.26.00) 237 | - RCTTypeSafety (= 0.65.1) 238 | - React-Core/RCTImageHeaders (= 0.65.1) 239 | - React-jsi (= 0.65.1) 240 | - React-RCTNetwork (= 0.65.1) 241 | - ReactCommon/turbomodule/core (= 0.65.1) 242 | - React-RCTLinking (0.65.1): 243 | - FBReactNativeSpec (= 0.65.1) 244 | - React-Core/RCTLinkingHeaders (= 0.65.1) 245 | - React-jsi (= 0.65.1) 246 | - ReactCommon/turbomodule/core (= 0.65.1) 247 | - React-RCTNetwork (0.65.1): 248 | - FBReactNativeSpec (= 0.65.1) 249 | - RCT-Folly (= 2021.04.26.00) 250 | - RCTTypeSafety (= 0.65.1) 251 | - React-Core/RCTNetworkHeaders (= 0.65.1) 252 | - React-jsi (= 0.65.1) 253 | - ReactCommon/turbomodule/core (= 0.65.1) 254 | - React-RCTSettings (0.65.1): 255 | - FBReactNativeSpec (= 0.65.1) 256 | - RCT-Folly (= 2021.04.26.00) 257 | - RCTTypeSafety (= 0.65.1) 258 | - React-Core/RCTSettingsHeaders (= 0.65.1) 259 | - React-jsi (= 0.65.1) 260 | - ReactCommon/turbomodule/core (= 0.65.1) 261 | - React-RCTText (0.65.1): 262 | - React-Core/RCTTextHeaders (= 0.65.1) 263 | - React-RCTVibration (0.65.1): 264 | - FBReactNativeSpec (= 0.65.1) 265 | - RCT-Folly (= 2021.04.26.00) 266 | - React-Core/RCTVibrationHeaders (= 0.65.1) 267 | - React-jsi (= 0.65.1) 268 | - ReactCommon/turbomodule/core (= 0.65.1) 269 | - React-runtimeexecutor (0.65.1): 270 | - React-jsi (= 0.65.1) 271 | - ReactCommon/turbomodule/core (0.65.1): 272 | - DoubleConversion 273 | - glog 274 | - RCT-Folly (= 2021.04.26.00) 275 | - React-callinvoker (= 0.65.1) 276 | - React-Core (= 0.65.1) 277 | - React-cxxreact (= 0.65.1) 278 | - React-jsi (= 0.65.1) 279 | - React-perflogger (= 0.65.1) 280 | - RNCMaskedView (0.2.6): 281 | - React-Core 282 | - RNGestureHandler (1.10.3): 283 | - React-Core 284 | - RNReanimated (2.2.3): 285 | - DoubleConversion 286 | - FBLazyVector 287 | - FBReactNativeSpec 288 | - glog 289 | - RCT-Folly 290 | - RCTRequired 291 | - RCTTypeSafety 292 | - React 293 | - React-callinvoker 294 | - React-Core 295 | - React-Core/DevSupport 296 | - React-Core/RCTWebSocket 297 | - React-CoreModules 298 | - React-cxxreact 299 | - React-jsi 300 | - React-jsiexecutor 301 | - React-jsinspector 302 | - React-RCTActionSheet 303 | - React-RCTAnimation 304 | - React-RCTBlob 305 | - React-RCTImage 306 | - React-RCTLinking 307 | - React-RCTNetwork 308 | - React-RCTSettings 309 | - React-RCTText 310 | - React-RCTVibration 311 | - ReactCommon/turbomodule/core 312 | - Yoga 313 | - RNScreens (2.18.1): 314 | - React-Core 315 | - Yoga (1.14.0) 316 | 317 | DEPENDENCIES: 318 | - DoubleConversion (from `../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 319 | - FBLazyVector (from `../../node_modules/react-native/Libraries/FBLazyVector`) 320 | - FBReactNativeSpec (from `../../node_modules/react-native/React/FBReactNativeSpec`) 321 | - glog (from `../../node_modules/react-native/third-party-podspecs/glog.podspec`) 322 | - RCT-Folly (from `../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 323 | - RCTRequired (from `../../node_modules/react-native/Libraries/RCTRequired`) 324 | - RCTTypeSafety (from `../../node_modules/react-native/Libraries/TypeSafety`) 325 | - React (from `../../node_modules/react-native/`) 326 | - React-callinvoker (from `../../node_modules/react-native/ReactCommon/callinvoker`) 327 | - React-Core (from `../../node_modules/react-native/`) 328 | - React-Core/DevSupport (from `../../node_modules/react-native/`) 329 | - React-Core/RCTWebSocket (from `../../node_modules/react-native/`) 330 | - React-CoreModules (from `../../node_modules/react-native/React/CoreModules`) 331 | - React-cxxreact (from `../../node_modules/react-native/ReactCommon/cxxreact`) 332 | - React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`) 333 | - React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`) 334 | - React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`) 335 | - react-native-safe-area-context (from `../../node_modules/react-native-safe-area-context`) 336 | - react-native-video (from `../../node_modules/react-native-video`) 337 | - React-perflogger (from `../../node_modules/react-native/ReactCommon/reactperflogger`) 338 | - React-RCTActionSheet (from `../../node_modules/react-native/Libraries/ActionSheetIOS`) 339 | - React-RCTAnimation (from `../../node_modules/react-native/Libraries/NativeAnimation`) 340 | - React-RCTBlob (from `../../node_modules/react-native/Libraries/Blob`) 341 | - React-RCTImage (from `../../node_modules/react-native/Libraries/Image`) 342 | - React-RCTLinking (from `../../node_modules/react-native/Libraries/LinkingIOS`) 343 | - React-RCTNetwork (from `../../node_modules/react-native/Libraries/Network`) 344 | - React-RCTSettings (from `../../node_modules/react-native/Libraries/Settings`) 345 | - React-RCTText (from `../../node_modules/react-native/Libraries/Text`) 346 | - React-RCTVibration (from `../../node_modules/react-native/Libraries/Vibration`) 347 | - React-runtimeexecutor (from `../../node_modules/react-native/ReactCommon/runtimeexecutor`) 348 | - ReactCommon/turbomodule/core (from `../../node_modules/react-native/ReactCommon`) 349 | - "RNCMaskedView (from `../../node_modules/@react-native-masked-view/masked-view`)" 350 | - RNGestureHandler (from `../../node_modules/react-native-gesture-handler`) 351 | - RNReanimated (from `../../node_modules/react-native-reanimated`) 352 | - RNScreens (from `../../node_modules/react-native-screens`) 353 | - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`) 354 | 355 | SPEC REPOS: 356 | trunk: 357 | - boost-for-react-native 358 | - fmt 359 | 360 | EXTERNAL SOURCES: 361 | DoubleConversion: 362 | :podspec: "../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 363 | FBLazyVector: 364 | :path: "../../node_modules/react-native/Libraries/FBLazyVector" 365 | FBReactNativeSpec: 366 | :path: "../../node_modules/react-native/React/FBReactNativeSpec" 367 | glog: 368 | :podspec: "../../node_modules/react-native/third-party-podspecs/glog.podspec" 369 | RCT-Folly: 370 | :podspec: "../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 371 | RCTRequired: 372 | :path: "../../node_modules/react-native/Libraries/RCTRequired" 373 | RCTTypeSafety: 374 | :path: "../../node_modules/react-native/Libraries/TypeSafety" 375 | React: 376 | :path: "../../node_modules/react-native/" 377 | React-callinvoker: 378 | :path: "../../node_modules/react-native/ReactCommon/callinvoker" 379 | React-Core: 380 | :path: "../../node_modules/react-native/" 381 | React-CoreModules: 382 | :path: "../../node_modules/react-native/React/CoreModules" 383 | React-cxxreact: 384 | :path: "../../node_modules/react-native/ReactCommon/cxxreact" 385 | React-jsi: 386 | :path: "../../node_modules/react-native/ReactCommon/jsi" 387 | React-jsiexecutor: 388 | :path: "../../node_modules/react-native/ReactCommon/jsiexecutor" 389 | React-jsinspector: 390 | :path: "../../node_modules/react-native/ReactCommon/jsinspector" 391 | react-native-safe-area-context: 392 | :path: "../../node_modules/react-native-safe-area-context" 393 | react-native-video: 394 | :path: "../../node_modules/react-native-video" 395 | React-perflogger: 396 | :path: "../../node_modules/react-native/ReactCommon/reactperflogger" 397 | React-RCTActionSheet: 398 | :path: "../../node_modules/react-native/Libraries/ActionSheetIOS" 399 | React-RCTAnimation: 400 | :path: "../../node_modules/react-native/Libraries/NativeAnimation" 401 | React-RCTBlob: 402 | :path: "../../node_modules/react-native/Libraries/Blob" 403 | React-RCTImage: 404 | :path: "../../node_modules/react-native/Libraries/Image" 405 | React-RCTLinking: 406 | :path: "../../node_modules/react-native/Libraries/LinkingIOS" 407 | React-RCTNetwork: 408 | :path: "../../node_modules/react-native/Libraries/Network" 409 | React-RCTSettings: 410 | :path: "../../node_modules/react-native/Libraries/Settings" 411 | React-RCTText: 412 | :path: "../../node_modules/react-native/Libraries/Text" 413 | React-RCTVibration: 414 | :path: "../../node_modules/react-native/Libraries/Vibration" 415 | React-runtimeexecutor: 416 | :path: "../../node_modules/react-native/ReactCommon/runtimeexecutor" 417 | ReactCommon: 418 | :path: "../../node_modules/react-native/ReactCommon" 419 | RNCMaskedView: 420 | :path: "../../node_modules/@react-native-masked-view/masked-view" 421 | RNGestureHandler: 422 | :path: "../../node_modules/react-native-gesture-handler" 423 | RNReanimated: 424 | :path: "../../node_modules/react-native-reanimated" 425 | RNScreens: 426 | :path: "../../node_modules/react-native-screens" 427 | Yoga: 428 | :path: "../../node_modules/react-native/ReactCommon/yoga" 429 | 430 | SPEC CHECKSUMS: 431 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 432 | DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 433 | FBLazyVector: 33c82491102f20ecddb6c6a2c273696ace3191e0 434 | FBReactNativeSpec: df8f81d2a7541ee6755a047b398a5cb5a72acd0e 435 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 436 | glog: 5337263514dd6f09803962437687240c5dc39aa4 437 | RCT-Folly: 0dd9e1eb86348ecab5ba76f910b56f4b5fef3c46 438 | RCTRequired: 6cf071ab2adfd769014b3d94373744ee6e789530 439 | RCTTypeSafety: b829c59453478bb5b02487b8de3336386ab93ab1 440 | React: 29d8a785041b96a2754c25cc16ddea57b7a618ce 441 | React-callinvoker: 2857b61132bd7878b736e282581f4b42fd93002b 442 | React-Core: 001e21bad5ca41e59e9d90df5c0b53da04c3ce8e 443 | React-CoreModules: 0a0410ab296a62ab38e2f8d321e822d1fcc2fe49 444 | React-cxxreact: 8d904967134ae8ff0119c5357c42eaae976806f8 445 | React-jsi: 12913c841713a15f64eabf5c9ad98592c0ec5940 446 | React-jsiexecutor: 43f2542aed3c26e42175b339f8d37fe3dd683765 447 | React-jsinspector: 41e58e5b8e3e0bf061fdf725b03f2144014a8fb0 448 | react-native-safe-area-context: 584dc04881deb49474363f3be89e4ca0e854c057 449 | react-native-video: 0bb76b6d6b77da3009611586c7dbf817b947f30e 450 | React-perflogger: fd28ee1f2b5b150b00043f0301d96bd417fdc339 451 | React-RCTActionSheet: 7f3fa0855c346aa5d7c60f9ced16e067db6d29fa 452 | React-RCTAnimation: 2119a18ee26159004b001bc56404ca5dbaae6077 453 | React-RCTBlob: a493cc306deeaba0c0efa8ecec2da154afd3a798 454 | React-RCTImage: 54999ddc896b7db6650af5760607aaebdf30425c 455 | React-RCTLinking: 7fb3fa6397d3700c69c3d361870a299f04f1a2e6 456 | React-RCTNetwork: 329ee4f75bd2deb8cf6c4b14231b5bb272cbd9af 457 | React-RCTSettings: 1a659d58e45719bc77c280dbebce6a5a5a2733f5 458 | React-RCTText: e12d7aae2a038be9ae72815436677a7c6549dd26 459 | React-RCTVibration: 92d41c2442e5328cc4d342cd7f78e5876b68bae5 460 | React-runtimeexecutor: 85187f19dd9c47a7c102f9994f9d14e4dc2110de 461 | ReactCommon: eafed38eec7b591c31751bfa7494801618460459 462 | RNCMaskedView: c298b644a10c0c142055b3ae24d83879ecb13ccd 463 | RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 464 | RNReanimated: aaf2cf65595b293daae808015761a6014a97b284 465 | RNScreens: f7ad633b2e0190b77b6a7aab7f914fad6f198d8d 466 | Yoga: aa0cb45287ebe1004c02a13f279c55a95f1572f4 467 | 468 | PODFILE CHECKSUM: 42ff09bf9e1260bad775ffe629bae00473f1162c 469 | 470 | COCOAPODS: 1.10.1 471 | -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample.xcodeproj/xcshareddata/xcschemes/ReactNativeGalleryToolkitExample-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample.xcodeproj/xcshareddata/xcschemes/ReactNativeGalleryToolkitExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | // #if DEBUG 8 | // #ifdef FB_SONARKIT_ENABLED 9 | // #import 10 | // #import 11 | // #import 12 | // #import 13 | // #import 14 | // #import 15 | // static void InitializeFlipper(UIApplication *application) { 16 | // FlipperClient *client = [FlipperClient sharedClient]; 17 | // SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | // [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | // [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | // [client addPlugin:[FlipperKitReactPlugin new]]; 21 | // [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | // [client start]; 23 | // } 24 | // #endif 25 | // #endif 26 | 27 | @implementation AppDelegate 28 | 29 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 30 | { 31 | // #if DEBUG 32 | // #ifdef FB_SONARKIT_ENABLED 33 | // InitializeFlipper(application); 34 | // #endif 35 | // #endif 36 | 37 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 38 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 39 | moduleName:@"ReactNativeGalleryToolkitExample" 40 | initialProperties:nil]; 41 | 42 | if (@available(iOS 13.0, *)) { 43 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 44 | } else { 45 | rootView.backgroundColor = [UIColor whiteColor]; 46 | } 47 | 48 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 49 | UIViewController *rootViewController = [UIViewController new]; 50 | rootViewController.view = rootView; 51 | self.window.rootViewController = rootViewController; 52 | [self.window makeKeyAndVisible]; 53 | return YES; 54 | } 55 | 56 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 57 | { 58 | #if DEBUG 59 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 60 | #else 61 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 62 | #endif 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ReactNativeGalleryToolkitExample 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSLocationWhenInUseUsageDescription 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UIViewControllerBasedStatusBarAppearance 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Example/ios/ReactNativeGalleryToolkitExample/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Example/metro.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-extraneous-dependencies */ 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const escape = require('escape-string-regexp'); 6 | const blacklist = require('metro-config/src/defaults/blacklist'); 7 | 8 | const root = path.resolve(__dirname, '..'); 9 | const packages = path.resolve(root, 'packages'); 10 | 11 | // List all packages under `packages/` 12 | const workspaces = fs 13 | .readdirSync(packages) 14 | .map((p) => path.join(packages, p)) 15 | .filter( 16 | (p) => 17 | fs.statSync(p).isDirectory() && 18 | fs.existsSync(path.join(p, 'package.json')), 19 | ); 20 | 21 | // Get the list of dependencies for all packages in the monorepo 22 | const modules = [] 23 | .concat( 24 | ...workspaces.map((it) => { 25 | const pak = JSON.parse( 26 | fs.readFileSync(path.join(it, 'package.json'), 'utf8'), 27 | ); 28 | 29 | // We need to make sure that only one version is loaded for peerDependencies 30 | // So we blacklist them at the root, and alias them to the versions in example's node_modules 31 | return pak.peerDependencies 32 | ? Object.keys(pak.peerDependencies) 33 | : []; 34 | }), 35 | ) 36 | .sort() 37 | .filter( 38 | (m, i, self) => 39 | // Remove duplicates and package names of the packages in the monorepo 40 | self.lastIndexOf(m) === i && !m.startsWith('@gallery-toolkit/'), 41 | ); 42 | 43 | module.exports = { 44 | projectRoot: __dirname, 45 | 46 | // We need to watch the root of the monorepo 47 | // This lets Metro find the monorepo packages automatically using haste 48 | // This also lets us import modules from monorepo root 49 | watchFolders: [root], 50 | 51 | resolver: { 52 | // We need to blacklist the peerDependencies we've collected in packages' node_modules 53 | blacklistRE: blacklist( 54 | [].concat( 55 | ...workspaces.map((it) => 56 | modules.map( 57 | (m) => 58 | new RegExp( 59 | `^${escape(path.join(it, 'node_modules', m))}\\/.*$`, 60 | ), 61 | ), 62 | ), 63 | ), 64 | ), 65 | 66 | // When we import a package from the monorepo, metro won't be able to find their deps 67 | // We need to specify them in `extraNodeModules` to tell metro where to find them 68 | extraNodeModules: modules.reduce((acc, name) => { 69 | acc[name] = path.join(root, 'node_modules', name); 70 | return acc; 71 | }, {}), 72 | }, 73 | 74 | transformer: { 75 | // there is no need for assets yet 76 | // assetPlugins: ['expo-asset/tools/hashAssetFiles'], 77 | getTransformOptions: async () => ({ 78 | transform: { 79 | experimentalImportSupport: false, 80 | inlineRequires: false, 81 | }, 82 | }), 83 | }, 84 | 85 | // server: { 86 | // enhanceMiddleware: (middleware) => { 87 | // return (req, res, next) => { 88 | // // When an asset is imported outside the project root, it has wrong path on Android 89 | // // So we fix the path to correct one 90 | // if (/\/packages\/.+\.png\?.+$/.test(req.url)) { 91 | // req.url = `/assets/../${req.url}`; 92 | // } 93 | 94 | // return middleware(req, res, next); 95 | // }; 96 | // }, 97 | // }, 98 | }; 99 | -------------------------------------------------------------------------------- /Example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ReactNativeGalleryToolkitExample", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "@react-native-masked-view/masked-view": "^0.2.6", 14 | "@react-navigation/native": "^5.7.3", 15 | "@react-navigation/stack": "^5.9.0", 16 | "@types/react-native-video": "^5.0.1", 17 | "metro-config": "^0.59.0", 18 | "react": "17.0.2", 19 | "react-native": "^0.65.1", 20 | "react-native-gesture-handler": "^1.10.3", 21 | "react-native-image": "^0.1.1", 22 | "react-native-portalize": "^1.0.7", 23 | "react-native-reanimated": "2.2.3", 24 | "react-native-safe-area-context": "^3.1.4", 25 | "react-native-screens": "^2.10.1", 26 | "react-native-video": "^5.1.0-alpha8" 27 | }, 28 | "devDependencies": { 29 | "@babel/core": "^7.12.9", 30 | "@babel/plugin-proposal-export-namespace-from": "^7.5.2", 31 | "@babel/runtime": "^7.12.5", 32 | "@react-native-community/eslint-config": "^2.0.0", 33 | "babel-eslint": "^10.0.3", 34 | "babel-jest": "^26.6.3", 35 | "babel-plugin-module-resolver": "^3.2.0", 36 | "eslint": "7.14.0", 37 | "eslint-config-airbnb": "^16.1.0", 38 | "eslint-config-prettier": "^6.1.0", 39 | "eslint-formatter-pretty": "^1.3.0", 40 | "eslint-import-resolver-alias": "^1.1.2", 41 | "eslint-plugin-babel": "^5.3.0", 42 | "eslint-plugin-import": "^2.18.2", 43 | "eslint-plugin-jsx-a11y": "^6.0.2", 44 | "eslint-plugin-prettier": "^3.1.0", 45 | "eslint-plugin-react": "^7.1.0", 46 | "eslint-plugin-react-native": "^3.1.0", 47 | "jest": "^26.6.3", 48 | "metro-react-native-babel-preset": "^0.66.0", 49 | "prettier": "^1.18.2", 50 | "react-native-codegen": "^0.0.7", 51 | "react-test-renderer": "17.0.2" 52 | }, 53 | "resolutions": { 54 | "@babel/runtime": "7.8.4" 55 | }, 56 | "jest": { 57 | "preset": "react-native" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Example/src/DetachedHeader.tsx: -------------------------------------------------------------------------------- 1 | import { useRoute } from '@react-navigation/native'; 2 | import { Header, StackHeaderProps } from '@react-navigation/stack'; 3 | import React, { useEffect, useState } from 'react'; 4 | import type { ViewStyle } from 'react-native'; 5 | import Animated from 'react-native-reanimated'; 6 | import { useSafeAreaInsets } from 'react-native-safe-area-context'; 7 | 8 | const headerPropsMap = new Map(); 9 | const subs: Array<() => void> = []; 10 | 11 | function setProps(name: string, props: StackHeaderProps) { 12 | headerPropsMap.set(name, props); 13 | 14 | setTimeout(() => { 15 | subs.forEach((cb) => cb()); 16 | }, 0); 17 | } 18 | 19 | function useHeaderProps() { 20 | const route = useRoute(); 21 | 22 | return headerPropsMap.get(route.name); 23 | } 24 | 25 | export function HeaderPropsScrapper(props: StackHeaderProps) { 26 | setProps(props.scene.route.name, props); 27 | 28 | return null; 29 | } 30 | 31 | export function DetachedHeader() { 32 | const [, forceUpdate] = useState(false); 33 | useEffect(() => { 34 | const onPropsChange = () => forceUpdate((v) => !v); 35 | 36 | subs.push(onPropsChange); 37 | 38 | return () => { 39 | const index = subs.findIndex((i) => i === onPropsChange); 40 | 41 | subs.splice(index); 42 | }; 43 | }, []); 44 | 45 | const headerProps = useHeaderProps(); 46 | 47 | return headerProps ?

: null; 48 | } 49 | 50 | DetachedHeader.Container = ({ 51 | children, 52 | style, 53 | }: { 54 | children: JSX.Element; 55 | style?: ViewStyle; 56 | }) => { 57 | const insets = useSafeAreaInsets(); 58 | return ( 59 | 65 | {children} 66 | 67 | ); 68 | }; 69 | -------------------------------------------------------------------------------- /Example/src/ImageTransformerExamples/ImageTransformerTest.tsx: -------------------------------------------------------------------------------- 1 | import { ImageTransformer } from '@gallery-toolkit/image-transformer'; 2 | import { useHeaderHeight } from '@react-navigation/stack'; 3 | import React from 'react'; 4 | import { Dimensions } from 'react-native'; 5 | 6 | const { height, width } = Dimensions.get('window'); 7 | 8 | const image = { 9 | id: '4', 10 | width: 400, 11 | height: 300, 12 | uri: 'https://placekitten.com/400/300', 13 | }; 14 | 15 | export default function StandaloneGalleryBasicScreen() { 16 | const headerHeight = useHeaderHeight(); 17 | return ( 18 | 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /Example/src/ImageTransformerExamples/index.tsx: -------------------------------------------------------------------------------- 1 | import { createStackNavigator } from '@react-navigation/stack'; 2 | import React from 'react'; 3 | import ImageTransformerTest from './ImageTransformerTest'; 4 | 5 | const Stack = createStackNavigator(); 6 | 7 | export default function App() { 8 | return ( 9 | 16 | 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /Example/src/PagerExamples/PagerExampleScreen.tsx: -------------------------------------------------------------------------------- 1 | import { Pager, RenderPageProps } from '@gallery-toolkit/pager'; 2 | import React, { useCallback } from 'react'; 3 | import { Image } from 'react-native'; 4 | import { generateImageList, ImageItem } from '../helpers'; 5 | 6 | const LIST = generateImageList(100); 7 | 8 | export function PagerExampleScreen() { 9 | const renderPage = useCallback( 10 | (props: RenderPageProps) => { 11 | return ( 12 | 16 | ); 17 | }, 18 | [], 19 | ); 20 | 21 | return ( 22 | item.id} 26 | pages={LIST.images} 27 | renderPage={renderPage} 28 | /> 29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /Example/src/PagerExamples/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createStackNavigator } from '@react-navigation/stack'; 3 | import { PagerExampleScreen } from './PagerExampleScreen'; 4 | 5 | const Stack = createStackNavigator(); 6 | 7 | export default function App() { 8 | return ( 9 | 16 | 17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /Example/src/ScalableImageExamples/InstagramFeed/InstagramFeed.tsx: -------------------------------------------------------------------------------- 1 | import { normalizeDimensions } from '@gallery-toolkit/common'; 2 | import { Pager, RenderPageProps } from '@gallery-toolkit/pager'; 3 | import { ScalableImage } from '@gallery-toolkit/scalable-image'; 4 | import type { SimpleGalleryItemType } from '@gallery-toolkit/simple-gallery'; 5 | import React, { useCallback, useMemo, useRef } from 'react'; 6 | import { 7 | Dimensions, FlatList, FlatListProps, Image, StatusBar, StyleSheet, Text, View 8 | } from 'react-native'; 9 | import { ScrollView } from 'react-native-gesture-handler'; 10 | import Animated, { 11 | Extrapolate, 12 | interpolate, runOnJS, useAnimatedStyle, 13 | useSharedValue, useWorkletCallback, withDelay, withTiming 14 | } from 'react-native-reanimated'; 15 | import { DetachedHeader } from '../../DetachedHeader'; 16 | import { generateImageList } from '../../helpers'; 17 | import { useControls } from '../../hooks/useControls'; 18 | 19 | const s = StyleSheet.create({ 20 | overlay: { 21 | position: 'absolute', 22 | top: 0, 23 | left: 0, 24 | bottom: 0, 25 | right: 0, 26 | backgroundColor: 'black', 27 | }, 28 | itemContainer: { 29 | backgroundColor: 'white', 30 | }, 31 | itemHeader: { 32 | flexDirection: 'row', 33 | alignItems: 'center', 34 | margin: 12, 35 | }, 36 | itemText: { 37 | fontWeight: 'bold', 38 | fontSize: 14, 39 | marginLeft: 8, 40 | }, 41 | itemPager: {}, 42 | row: { 43 | flexDirection: 'row', 44 | }, 45 | icon: { 46 | height: 28, 47 | width: 28, 48 | marginRight: 12, 49 | }, 50 | iconBookmark: { 51 | height: 28, 52 | width: 28, 53 | }, 54 | image: { 55 | height: 32, 56 | width: 32, 57 | borderRadius: 16, 58 | }, 59 | footerItem: { 60 | zIndex: -1, 61 | flexDirection: 'row', 62 | justifyContent: 'space-between', 63 | margin: 12, 64 | }, 65 | paginationContainer: { 66 | justifyContent: 'center', 67 | alignItems: 'center', 68 | flexDirection: 'row', 69 | position: 'absolute', 70 | left: 0, 71 | right: 0, 72 | bottom: -28, 73 | zIndex: -1, 74 | }, 75 | }); 76 | 77 | 78 | const { width } = Dimensions.get('window'); 79 | 80 | const heart = require('../../../assets/images/Heart.svg'); 81 | const bubble = require('../../../assets/images/Bubble.svg'); 82 | const airplane = require('../../../assets/images/Airplane.svg'); 83 | const bookmark = require('../../../assets/images/Bookmark.svg'); 84 | 85 | interface ListItemT { 86 | id: string; 87 | name: string; 88 | images: SimpleGalleryItemType[]; 89 | } 90 | 91 | const data: ListItemT[] = [ 92 | { 93 | id: '1', 94 | name: 'spock', 95 | images: generateImageList(1, 256, 300).images, 96 | }, 97 | { 98 | id: '2', 99 | name: 'kirk', 100 | images: generateImageList(6, 180, 400).images, 101 | }, 102 | { 103 | id: '3', 104 | name: 'leonard', 105 | images: generateImageList(4, 50, 350).images, 106 | }, 107 | { 108 | id: '4', 109 | name: 'james', 110 | images: generateImageList(1, 20, 250).images, 111 | }, 112 | { 113 | id: '5', 114 | name: 'hikaru', 115 | images: generateImageList(5, 213, 400).images, 116 | }, 117 | { 118 | id: '6', 119 | name: 'scotty', 120 | images: generateImageList(5, 14, 450).images, 121 | }, 122 | ]; 123 | 124 | const Header = ({ uri, name }: { 125 | uri: string; 126 | name: string; 127 | }) => ( 128 | 129 | 130 | {name} 131 | 132 | ); 133 | const Footer = () => ( 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | ); 143 | 144 | const Pagination = ({ length, activeIndexInPager }: { 145 | length: number; 146 | activeIndexInPager: Animated.SharedValue; 147 | }) => { 148 | const dots = Array.from({ length: length }, (_, i) => { 149 | const animatedDotStyle = useAnimatedStyle(() => { 150 | const color = 151 | activeIndexInPager.value === i ? '#178EED' : '#A7A7A7'; 152 | const size = activeIndexInPager.value === i ? 6 : 4.5; 153 | 154 | return { 155 | backgroundColor: color, 156 | width: size, 157 | height: size, 158 | borderRadius: 3, 159 | marginHorizontal: 1.5, 160 | }; 161 | }, []); 162 | 163 | return ( 164 | 165 | ); 166 | }); 167 | 168 | return {dots}; 169 | }; 170 | 171 | interface RenderItemProps { 172 | index: number; 173 | activeItemIndex: Animated.SharedValue; 174 | item: ListItemT; 175 | setControlsHidden: (shouldHide: boolean) => void; 176 | scrollViewRef: React.Ref; 177 | } 178 | 179 | function RenderItem({ 180 | index: _index, 181 | activeItemIndex, 182 | item: { images, name }, 183 | setControlsHidden, 184 | scrollViewRef, 185 | }: RenderItemProps) { 186 | const opacity = useSharedValue(0); 187 | const backgroundScale = useSharedValue(0); 188 | const activeIndexInPager = useSharedValue(0); 189 | 190 | const normalizedImages = useMemo( 191 | () => 192 | images.map((item) => { 193 | const { targetWidth, targetHeight } = normalizeDimensions( 194 | item, 195 | ); 196 | 197 | return { 198 | ...item, 199 | width: targetWidth, 200 | height: targetHeight, 201 | }; 202 | }), 203 | [images], 204 | ); 205 | 206 | const onScale = useWorkletCallback((scale: number) => { 207 | opacity.value = interpolate( 208 | scale, 209 | [1, 2], 210 | [0, 0.7], 211 | Extrapolate.CLAMP, 212 | ); 213 | 214 | backgroundScale.value = interpolate( 215 | scale, 216 | [1, 1.01, 2], 217 | [0, 4, 5], 218 | Extrapolate.CLAMP, 219 | ); 220 | }, []); 221 | 222 | const onGestureStart = useWorkletCallback(() => { 223 | setControlsHidden(true); 224 | runOnJS(StatusBar.setHidden)(true); 225 | activeItemIndex.value = _index; 226 | }, []); 227 | 228 | const onGestureRelease = useWorkletCallback(() => { 229 | //delay for smooth hiding background opacity 230 | activeItemIndex.value = withDelay(200, withTiming(-1)); 231 | setControlsHidden(false); 232 | runOnJS(StatusBar.setHidden)(false); 233 | }, []); 234 | 235 | const overlayStyles = useAnimatedStyle(() => { 236 | return { 237 | opacity: opacity.value, 238 | transform: [ 239 | { 240 | scale: backgroundScale.value, 241 | }, 242 | ], 243 | }; 244 | }); 245 | 246 | const keyExtractor = useCallback( 247 | ({ id }: { id: string }) => id, 248 | [], 249 | ); 250 | 251 | const canvasHeight = useMemo( 252 | () => Math.max(...normalizedImages.map((item) => item.height)), 253 | [normalizedImages], 254 | ); 255 | 256 | const renderPage = useCallback(({ item, pagerRefs }: RenderPageProps) => { 257 | return ( 258 | 267 | ); 268 | }, []); 269 | 270 | const onIndexChangeWorklet = useWorkletCallback((nextIndex: number) => { 271 | activeIndexInPager.value = nextIndex; 272 | }, []); 273 | 274 | const content = (() => { 275 | if (images.length === 1) { 276 | return ( 277 | 286 | ); 287 | } else { 288 | return ( 289 | <> 290 | 303 | 304 | 308 | 309 | ); 310 | } 311 | })(); 312 | 313 | return ( 314 | 315 |
316 | 317 | 321 | 322 | 323 | {content} 324 | 325 | 326 |