├── example ├── .watchmanconfig ├── .gitattributes ├── .babelrc ├── app.json ├── android │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ └── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── AndroidManifest.xml │ │ ├── BUCK │ │ ├── proguard-rules.pro │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── keystores │ │ ├── debug.keystore.properties │ │ └── BUCK │ ├── settings.gradle │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew.bat │ └── gradlew ├── .buckconfig ├── __tests__ │ ├── index.ios.js │ └── index.android.js ├── ios │ ├── example │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── AppDelegate.m │ │ ├── Info.plist │ │ └── Base.lproj │ │ │ └── LaunchScreen.xib │ ├── exampleTests │ │ ├── Info.plist │ │ └── exampleTests.m │ ├── example-tvOSTests │ │ └── Info.plist │ ├── example-tvOS │ │ └── Info.plist │ └── example.xcodeproj │ │ ├── xcshareddata │ │ └── xcschemes │ │ │ ├── example.xcscheme │ │ │ └── example-tvOS.xcscheme │ │ └── project.pbxproj ├── package.json ├── .gitignore ├── index.android.js ├── .flowconfig └── index.ios.js ├── index.js ├── android ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── reactnative │ │ └── photoview │ │ ├── PhotoViewPackage.java │ │ ├── ResourceDrawableIdHelper.java │ │ ├── ImageEvent.java │ │ ├── PhotoViewManager.java │ │ └── PhotoView.java ├── build.gradle ├── gradlew.bat └── gradlew ├── ios ├── RNPhotoViewManager.h ├── MWTapDetectingView.h ├── MWTapDetectingImageView.h ├── RNPhotoViewManager.m ├── RNPhotoView.h ├── MWTapDetectingView.m ├── MWTapDetectingImageView.m ├── RNPhotoView.xcodeproj │ └── project.pbxproj └── RNPhotoView.m ├── react-native-photo-view.podspec ├── package.json ├── .gitignore ├── .npmignore ├── LICENSE ├── PhotoView.ios.js ├── PhotoView.android.js └── README.md /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /example/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import PhotoView from './PhotoView' 2 | export default PhotoView -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | example 4 | 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alwx/react-native-photo-view/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ios/RNPhotoViewManager.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RNPhotoViewManager : RCTViewManager 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /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/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alwx/react-native-photo-view/HEAD/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alwx/react-native-photo-view/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alwx/react-native-photo-view/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alwx/react-native-photo-view/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alwx/react-native-photo-view/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | 3 | include ':app' 4 | include ':react-native-photo-view' 5 | project(':react-native-photo-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-photo-view/android') 6 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 7 | -------------------------------------------------------------------------------- /example/__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /example/__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.reactnative.photoview.PhotoViewPackage; 5 | 6 | public class MainActivity extends ReactActivity { 7 | 8 | /** 9 | * Returns the name of the main component registered from JavaScript. 10 | * This is used to schedule rendering of the component. 11 | */ 12 | @Override 13 | protected String getMainComponentName() { 14 | return "example"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /example/ios/example/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "react": "16.0.0-alpha.12", 11 | "react-native": "0.47.2", 12 | "react-native-photo-view": "^1.4.0" 13 | }, 14 | "devDependencies": { 15 | "babel-jest": "20.0.3", 16 | "babel-preset-react-native": "3.0.2", 17 | "jest": "20.0.4", 18 | "react-test-renderer": "16.0.0-alpha.12" 19 | }, 20 | "jest": { 21 | "preset": "react-native" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /react-native-photo-view.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "react-native-photo-view" 7 | s.version = package["version"] 8 | s.summary = package['description'] 9 | s.author = package['author'] 10 | s.homepage = package['homepage'] 11 | s.license = package['license'] 12 | s.ios.deployment_target = "7.0" 13 | s.tvos.deployment_target = "9.0" 14 | s.source = { :git => "https://github.com/alwx/react-native-photo-view.git", :tag => "v#{s.version}" } 15 | s.source_files = "ios/*.{h,m}" 16 | s.dependency "React-Core" 17 | end 18 | -------------------------------------------------------------------------------- /ios/MWTapDetectingView.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewTap.h 3 | // Momento 4 | // 5 | // Created by Michael Waterfall on 04/11/2009. 6 | // Copyright 2009 d3i. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @protocol MWTapDetectingViewDelegate; 13 | 14 | @interface MWTapDetectingView : UIView {} 15 | 16 | @property (nonatomic, weak) id tapDelegate; 17 | 18 | @end 19 | 20 | @protocol MWTapDetectingViewDelegate 21 | 22 | @optional 23 | 24 | - (void)view:(UIView *)view singleTapDetected:(UITouch *)touch; 25 | - (void)view:(UIView *)view doubleTapDetected:(UITouch *)touch; 26 | - (void)view:(UIView *)view tripleTapDetected:(UITouch *)touch; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /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 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ios/MWTapDetectingImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageViewTap.h 3 | // Momento 4 | // 5 | // Created by Michael Waterfall on 04/11/2009. 6 | // Copyright 2009 d3i. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @protocol MWTapDetectingImageViewDelegate; 13 | 14 | @interface MWTapDetectingImageView : UIImageView {} 15 | 16 | @property (nonatomic, weak) id tapDelegate; 17 | 18 | @end 19 | 20 | @protocol MWTapDetectingImageViewDelegate 21 | 22 | @optional 23 | 24 | - (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch; 25 | - (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch; 26 | - (void)imageView:(UIImageView *)imageView tripleTapDetected:(UITouch *)touch; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-photo-view", 3 | "version": "1.5.3", 4 | "description": "Displaying photos with pinch-to-zoom", 5 | "main": "index.js", 6 | "author": { 7 | "name": "Alexander Pantyukhov", 8 | "email": "alwxndr@gmail.com" 9 | }, 10 | "license": "MIT", 11 | "keywords": [ 12 | "react-native", 13 | "react-component", 14 | "ios", 15 | "android", 16 | "gallery", 17 | "lightbox", 18 | "pinch", 19 | "pinch-to-zoom", 20 | "mobile" 21 | ], 22 | "homepage": "https://github.com/alwx/react-native-photo-view", 23 | "bugs": { 24 | "url": "https://github.com/alwx/react-native-photo-view/issues" 25 | }, 26 | "repository": { 27 | "type": "git", 28 | "url": "git://github.com/alwx/react-native-photo-view.git" 29 | }, 30 | "dependencies": { 31 | "prop-types": "^15.5.10" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /example/ios/exampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/example-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | google() 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.3.2' 10 | } 11 | } 12 | 13 | apply plugin: 'com.android.library' 14 | 15 | android { 16 | compileSdkVersion 28 17 | buildToolsVersion "28.0.3" 18 | 19 | defaultConfig { 20 | minSdkVersion 16 21 | targetSdkVersion 28 22 | versionCode 1 23 | } 24 | lintOptions { 25 | abortOnError false 26 | } 27 | } 28 | 29 | repositories { 30 | mavenCentral() 31 | google() 32 | } 33 | 34 | dependencies { 35 | implementation 'com.facebook.react:react-native:+' 36 | implementation 'com.facebook.fresco:fresco:1.12.1' 37 | implementation 'me.relex:photodraweeview:1.1.3' 38 | } 39 | -------------------------------------------------------------------------------- /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 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /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 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 50 | 51 | fastlane/report.xml 52 | fastlane/Preview.html 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | npm-debug.log 29 | 30 | # OSX 31 | # 32 | .DS_Store 33 | 34 | examples/ 35 | 36 | # Xcode 37 | # 38 | build/ 39 | *.pbxuser 40 | !default.pbxuser 41 | *.mode1v3 42 | !default.mode1v3 43 | *.mode2v3 44 | !default.mode2v3 45 | *.perspectivev3 46 | !default.perspectivev3 47 | xcuserdata 48 | *.xccheckout 49 | *.moved-aside 50 | DerivedData 51 | *.hmap 52 | *.ipa 53 | *.xcuserstate 54 | project.xcworkspace 55 | 56 | # Android/IJ 57 | # 58 | react-native-dialogs.iml 59 | .idea 60 | .gradle 61 | local.properties 62 | android/*.iml 63 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | npm-debug.log 29 | 30 | # OSX 31 | # 32 | .DS_Store 33 | 34 | examples/ 35 | 36 | # Xcode 37 | # 38 | build/ 39 | *.pbxuser 40 | !default.pbxuser 41 | *.mode1v3 42 | !default.mode1v3 43 | *.mode2v3 44 | !default.mode2v3 45 | *.perspectivev3 46 | !default.perspectivev3 47 | xcuserdata 48 | *.xccheckout 49 | *.moved-aside 50 | DerivedData 51 | *.hmap 52 | *.ipa 53 | *.xcuserstate 54 | project.xcworkspace 55 | 56 | # Android/IJ 57 | # 58 | react-native-dialogs.iml 59 | .idea 60 | .gradle 61 | local.properties 62 | android/*.iml 63 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.shell.MainReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 17 | @Override 18 | public boolean getUseDeveloperSupport() { 19 | return BuildConfig.DEBUG; 20 | } 21 | 22 | @Override 23 | protected List getPackages() { 24 | return Arrays.asList( 25 | new MainReactPackage() 26 | ); 27 | } 28 | }; 29 | 30 | @Override 31 | public ReactNativeHost getReactNativeHost() { 32 | return mReactNativeHost; 33 | } 34 | 35 | @Override 36 | public void onCreate() { 37 | super.onCreate(); 38 | SoLoader.init(this, /* native exopackage */ false); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Alexander Pantyukhov (alwxndr@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /ios/RNPhotoViewManager.m: -------------------------------------------------------------------------------- 1 | #import "RNPhotoViewManager.h" 2 | #import "RNPhotoView.h" 3 | 4 | @implementation RNPhotoViewManager 5 | 6 | RCT_EXPORT_MODULE() 7 | 8 | - (UIView *)view { 9 | return [[RNPhotoView alloc] initWithBridge:self.bridge]; 10 | } 11 | 12 | RCT_REMAP_VIEW_PROPERTY(src, source, NSDictionary) 13 | RCT_EXPORT_VIEW_PROPERTY(loadingIndicatorSrc, NSString) 14 | 15 | RCT_REMAP_VIEW_PROPERTY(maximumZoomScale, maxZoomScale, CGFloat) 16 | RCT_REMAP_VIEW_PROPERTY(minimumZoomScale, minZoomScale, CGFloat) 17 | 18 | RCT_EXPORT_VIEW_PROPERTY(showsHorizontalScrollIndicator, BOOL) 19 | RCT_EXPORT_VIEW_PROPERTY(showsVerticalScrollIndicator, BOOL) 20 | 21 | RCT_EXPORT_VIEW_PROPERTY(onPhotoViewerError, RCTDirectEventBlock) 22 | RCT_EXPORT_VIEW_PROPERTY(onPhotoViewerScale, RCTDirectEventBlock) 23 | RCT_EXPORT_VIEW_PROPERTY(onPhotoViewerViewTap, RCTBubblingEventBlock) 24 | RCT_EXPORT_VIEW_PROPERTY(onPhotoViewerTap, RCTBubblingEventBlock) 25 | RCT_EXPORT_VIEW_PROPERTY(onPhotoViewerLoadStart, RCTDirectEventBlock) 26 | RCT_EXPORT_VIEW_PROPERTY(onPhotoViewerLoad, RCTDirectEventBlock) 27 | RCT_EXPORT_VIEW_PROPERTY(onPhotoViewerLoadEnd, RCTDirectEventBlock) 28 | RCT_EXPORT_VIEW_PROPERTY(onPhotoViewerProgress, RCTDirectEventBlock); 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnative/photoview/PhotoViewPackage.java: -------------------------------------------------------------------------------- 1 | package com.reactnative.photoview; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.JavaScriptModule; 5 | import com.facebook.react.bridge.NativeModule; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.react.uimanager.ViewManager; 8 | 9 | import java.util.ArrayList; 10 | import java.util.Collections; 11 | import java.util.List; 12 | 13 | /** 14 | * @author alwx (https://github.com/alwx) 15 | * @version 1.0 16 | */ 17 | public class PhotoViewPackage implements ReactPackage { 18 | // Deprecated from RN 0.47 19 | public List> createJSModules() { 20 | return Collections.emptyList(); 21 | } 22 | 23 | @Override 24 | public List createViewManagers(ReactApplicationContext reactContext) { 25 | List viewManagers = new ArrayList<>(); 26 | viewManagers.add(new PhotoViewManager(reactContext)); 27 | return viewManagers; 28 | } 29 | 30 | @Override 31 | public List createNativeModules(ReactApplicationContext reactContext) { 32 | return Collections.emptyList(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /example/index.android.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { 3 | AppRegistry, 4 | StyleSheet, 5 | View 6 | } from 'react-native'; 7 | import PhotoView from 'react-native-photo-view'; 8 | 9 | export default class Example extends Component { 10 | render() { 11 | return ( 12 | 13 | console.log("onLoad called")} 16 | onTap={() => console.log("onTap called")} 17 | minimumZoomScale={0.5} 18 | maximumZoomScale={3} 19 | androidScaleType="center" 20 | style={styles.photo} /> 21 | 22 | ); 23 | } 24 | } 25 | 26 | const styles = StyleSheet.create({ 27 | container: { 28 | flex: 1, 29 | justifyContent: 'center', 30 | alignItems: 'center', 31 | backgroundColor: '#F5FCFF', 32 | }, 33 | photo: { 34 | width: 300, 35 | height: 300, 36 | justifyContent: 'center', 37 | alignItems: 'center', 38 | backgroundColor: 'black' 39 | }, 40 | text: { 41 | backgroundColor: "transparent", 42 | color: "#FFF", 43 | } 44 | }); 45 | 46 | AppRegistry.registerComponent('example', () => Example); 47 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ios/RNPhotoView.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "MWTapDetectingImageView.h" 4 | #import "MWTapDetectingView.h" 5 | 6 | @class RCTBridge; 7 | 8 | @interface RNPhotoView : UIScrollView 9 | 10 | #pragma mark - Data 11 | 12 | @property (nonatomic, strong) NSDictionary *source; 13 | @property (nonatomic, strong) NSDictionary *src; 14 | @property (nonatomic, strong) NSString *loadingIndicatorSrc; 15 | @property (nonatomic, assign) NSInteger scale; 16 | @property (nonatomic, assign) CGFloat minZoomScale; 17 | @property (nonatomic, assign) CGFloat maxZoomScale; 18 | 19 | #pragma mark - Block 20 | 21 | @property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerError; 22 | @property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerScale; 23 | @property (nonatomic, copy) RCTBubblingEventBlock onPhotoViewerViewTap; 24 | @property (nonatomic, copy) RCTBubblingEventBlock onPhotoViewerTap; 25 | @property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerLoadStart; 26 | @property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerLoad; 27 | @property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerLoadEnd; 28 | @property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerProgress; 29 | 30 | - (instancetype)initWithBridge:(RCTBridge *)bridge; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"example" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /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 unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/Libraries/react-native/react-native-interface.js 21 | node_modules/react-native/flow 22 | flow/ 23 | 24 | [options] 25 | emoji=true 26 | 27 | module.system=haste 28 | 29 | munge_underscores=true 30 | 31 | 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\)$' -> 'RelativeImageStub' 32 | 33 | suppress_type=$FlowIssue 34 | suppress_type=$FlowFixMe 35 | suppress_type=$FixMe 36 | 37 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 38 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 40 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 41 | 42 | unsafe.enable_getters_and_setters=true 43 | 44 | [version] 45 | ^0.49.1 46 | -------------------------------------------------------------------------------- /ios/MWTapDetectingView.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewTap.m 3 | // Momento 4 | // 5 | // Created by Michael Waterfall on 04/11/2009. 6 | // Copyright 2009 d3i. All rights reserved. 7 | // 8 | 9 | #import "MWTapDetectingView.h" 10 | 11 | @implementation MWTapDetectingView 12 | 13 | - (id)init { 14 | if ((self = [super init])) { 15 | self.userInteractionEnabled = YES; 16 | } 17 | return self; 18 | } 19 | 20 | - (id)initWithFrame:(CGRect)frame { 21 | if ((self = [super initWithFrame:frame])) { 22 | self.userInteractionEnabled = YES; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 28 | UITouch *touch = [touches anyObject]; 29 | NSUInteger tapCount = touch.tapCount; 30 | switch (tapCount) { 31 | case 1: 32 | [self handleSingleTap:touch]; 33 | break; 34 | case 2: 35 | [self handleDoubleTap:touch]; 36 | break; 37 | case 3: 38 | [self handleTripleTap:touch]; 39 | break; 40 | default: 41 | break; 42 | } 43 | [[self nextResponder] touchesEnded:touches withEvent:event]; 44 | } 45 | 46 | - (void)handleSingleTap:(UITouch *)touch { 47 | if ([_tapDelegate respondsToSelector:@selector(view:singleTapDetected:)]) 48 | [_tapDelegate view:self singleTapDetected:touch]; 49 | } 50 | 51 | - (void)handleDoubleTap:(UITouch *)touch { 52 | if ([_tapDelegate respondsToSelector:@selector(view:doubleTapDetected:)]) 53 | [_tapDelegate view:self doubleTapDetected:touch]; 54 | } 55 | 56 | - (void)handleTripleTap:(UITouch *)touch { 57 | if ([_tapDelegate respondsToSelector:@selector(view:tripleTapDetected:)]) 58 | [_tapDelegate view:self tripleTapDetected:touch]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /example/ios/example-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /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 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 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 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.example", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.example", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnative/photoview/ResourceDrawableIdHelper.java: -------------------------------------------------------------------------------- 1 | // Copyright 2004-present Facebook. All Rights Reserved. 2 | 3 | package com.reactnative.photoview; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | import android.content.Context; 11 | import android.graphics.drawable.Drawable; 12 | import android.net.Uri; 13 | 14 | import com.facebook.common.util.UriUtil; 15 | 16 | /** 17 | * Helper class for obtaining information about local images. 18 | */ 19 | /* package */ class ResourceDrawableIdHelper { 20 | 21 | private Map mResourceDrawableIdMap; 22 | 23 | public ResourceDrawableIdHelper() { 24 | mResourceDrawableIdMap = new HashMap(); 25 | } 26 | 27 | public int getResourceDrawableId(Context context, @Nullable String name) { 28 | if (name == null || name.isEmpty()) { 29 | return 0; 30 | } 31 | name = name.toLowerCase().replace("-", "_"); 32 | if (mResourceDrawableIdMap.containsKey(name)) { 33 | return mResourceDrawableIdMap.get(name); 34 | } 35 | int id = context.getResources().getIdentifier( 36 | name, 37 | "drawable", 38 | context.getPackageName()); 39 | mResourceDrawableIdMap.put(name, id); 40 | return id; 41 | } 42 | 43 | public @Nullable Drawable getResourceDrawable(Context context, @Nullable String name) { 44 | int resId = getResourceDrawableId(context, name); 45 | return resId > 0 ? context.getResources().getDrawable(resId) : null; 46 | } 47 | 48 | public Uri getResourceDrawableUri(Context context, @Nullable String name) { 49 | int resId = getResourceDrawableId(context, name); 50 | return resId > 0 ? new Uri.Builder() 51 | .scheme(UriUtil.LOCAL_RESOURCE_SCHEME) 52 | .path(String.valueOf(resId)) 53 | .build() : Uri.EMPTY; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 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 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | 46 | NSExceptionDomains 47 | 48 | localhost 49 | 50 | NSExceptionAllowsInsecureHTTPLoads 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /example/index.ios.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { 3 | AppRegistry, 4 | StyleSheet, 5 | View 6 | } from 'react-native'; 7 | import PhotoView from 'react-native-photo-view'; 8 | 9 | export default class Example extends Component { 10 | _onScale = (event) => { 11 | console.log('_onScale', event.nativeEvent); 12 | }; 13 | _onTap = (event) => { 14 | console.log('_onTap', event.nativeEvent); 15 | }; 16 | _onViewTap = (event) => { 17 | console.log('_onViewTap', event.nativeEvent); 18 | }; 19 | _onLoadStart = (event) => { 20 | console.log('_onLoadStart', event.nativeEvent); 21 | }; 22 | _onLoad = (event) => { 23 | console.log('_onLoad', event.nativeEvent); 24 | }; 25 | _onLoadEnd = (event) => { 26 | console.log('_onLoadEnd', event.nativeEvent); 27 | }; 28 | render() { 29 | return ( 30 | 31 | 44 | 45 | ); 46 | } 47 | } 48 | 49 | const styles = StyleSheet.create({ 50 | container: { 51 | flex: 1, 52 | justifyContent: 'center', 53 | alignItems: 'center', 54 | backgroundColor: '#F5FCFF', 55 | }, 56 | photo: { 57 | width: 300, 58 | height: 300, 59 | justifyContent: 'center', 60 | alignItems: 'center' 61 | }, 62 | text: { 63 | backgroundColor: "transparent", 64 | color: "#FFF", 65 | } 66 | }); 67 | 68 | AppRegistry.registerComponent('example', () => Example); 69 | -------------------------------------------------------------------------------- /ios/MWTapDetectingImageView.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageViewTap.m 3 | // Momento 4 | // 5 | // Created by Michael Waterfall on 04/11/2009. 6 | // Copyright 2009 d3i. All rights reserved. 7 | // 8 | 9 | #import "MWTapDetectingImageView.h" 10 | 11 | @implementation MWTapDetectingImageView 12 | 13 | - (id)initWithFrame:(CGRect)frame { 14 | if ((self = [super initWithFrame:frame])) { 15 | self.userInteractionEnabled = YES; 16 | } 17 | return self; 18 | } 19 | 20 | - (id)initWithImage:(UIImage *)image { 21 | if ((self = [super initWithImage:image])) { 22 | self.userInteractionEnabled = YES; 23 | } 24 | return self; 25 | } 26 | 27 | - (id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage { 28 | if ((self = [super initWithImage:image highlightedImage:highlightedImage])) { 29 | self.userInteractionEnabled = YES; 30 | } 31 | return self; 32 | } 33 | 34 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 35 | UITouch *touch = [touches anyObject]; 36 | NSUInteger tapCount = touch.tapCount; 37 | switch (tapCount) { 38 | case 1: 39 | [self handleSingleTap:touch]; 40 | break; 41 | case 2: 42 | [self handleDoubleTap:touch]; 43 | break; 44 | case 3: 45 | [self handleTripleTap:touch]; 46 | break; 47 | default: 48 | break; 49 | } 50 | [[self nextResponder] touchesEnded:touches withEvent:event]; 51 | } 52 | 53 | - (void)handleSingleTap:(UITouch *)touch { 54 | if ([_tapDelegate respondsToSelector:@selector(imageView:singleTapDetected:)]) 55 | [_tapDelegate imageView:self singleTapDetected:touch]; 56 | } 57 | 58 | - (void)handleDoubleTap:(UITouch *)touch { 59 | if ([_tapDelegate respondsToSelector:@selector(imageView:doubleTapDetected:)]) 60 | [_tapDelegate imageView:self doubleTapDetected:touch]; 61 | } 62 | 63 | - (void)handleTripleTap:(UITouch *)touch { 64 | if ([_tapDelegate respondsToSelector:@selector(imageView:tripleTapDetected:)]) 65 | [_tapDelegate imageView:self tripleTapDetected:touch]; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /example/ios/exampleTests/exampleTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface exampleTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation exampleTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnative/photoview/ImageEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | package com.reactnative.photoview; 11 | 12 | import android.support.annotation.IntDef; 13 | import com.facebook.react.bridge.WritableMap; 14 | import com.facebook.react.uimanager.events.Event; 15 | import com.facebook.react.uimanager.events.RCTEventEmitter; 16 | 17 | import java.lang.annotation.Retention; 18 | import java.lang.annotation.RetentionPolicy; 19 | 20 | public class ImageEvent extends Event { 21 | @IntDef({ON_ERROR, ON_LOAD, ON_LOAD_END, ON_LOAD_START, ON_TAP, ON_VIEW_TAP, ON_SCALE}) 22 | @Retention(RetentionPolicy.SOURCE) 23 | @interface ImageEventType {} 24 | 25 | public static final int ON_ERROR = 1; 26 | public static final int ON_LOAD = 2; 27 | public static final int ON_LOAD_END = 3; 28 | public static final int ON_LOAD_START = 4; 29 | public static final int ON_TAP = 5; 30 | public static final int ON_VIEW_TAP = 6; 31 | public static final int ON_SCALE = 7; 32 | 33 | private final int mEventType; 34 | private WritableMap mMap; 35 | 36 | public ImageEvent(int viewId, @ImageEventType int eventType) { 37 | super(viewId); 38 | mEventType = eventType; 39 | mMap = null; 40 | } 41 | 42 | public static String eventNameForType(@ImageEventType int eventType) { 43 | switch(eventType) { 44 | case ON_ERROR: 45 | return "photoViewError"; 46 | case ON_LOAD: 47 | return "photoViewLoad"; 48 | case ON_LOAD_END: 49 | return "photoViewLoadEnd"; 50 | case ON_LOAD_START: 51 | return "photoViewLoadStart"; 52 | case ON_TAP: 53 | return "photoViewTap"; 54 | case ON_VIEW_TAP: 55 | return "photoViewViewTap"; 56 | case ON_SCALE: 57 | return "photoViewScale"; 58 | default: 59 | throw new IllegalStateException("Invalid image event: " + Integer.toString(eventType)); 60 | } 61 | } 62 | 63 | @Override 64 | public String getEventName() { 65 | return ImageEvent.eventNameForType(mEventType); 66 | } 67 | 68 | @Override 69 | public short getCoalescingKey() { 70 | // Intentionally casting mEventType because it is guaranteed to be small 71 | // enough to fit into short. 72 | return (short) mEventType; 73 | } 74 | 75 | @Override 76 | public void dispatch(RCTEventEmitter rctEventEmitter) { 77 | rctEventEmitter.receiveEvent(getViewTag(), getEventName(), mMap); 78 | } 79 | 80 | public ImageEvent setExtras(WritableMap map){ 81 | this.mMap = map; 82 | return this; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /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 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /PhotoView.ios.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { requireNativeComponent, View } from 'react-native'; 4 | import ViewPropTypes from 'react-native/Libraries/Components/View/ViewPropTypes'; 5 | 6 | const resolveAssetSource = require('react-native/Libraries/Image/resolveAssetSource'); 7 | 8 | export default class PhotoView extends Component { 9 | static propTypes = { 10 | source: PropTypes.oneOfType([ 11 | PropTypes.shape({ 12 | uri: PropTypes.string 13 | }), 14 | // Opaque type returned by require('./image.jpg') 15 | PropTypes.number 16 | ]), 17 | loadingIndicatorSource: PropTypes.oneOfType([ 18 | PropTypes.shape({ 19 | uri: PropTypes.string 20 | }), 21 | // Opaque type returned by require('./image.jpg') 22 | PropTypes.number 23 | ]), 24 | fadeDuration: PropTypes.number, 25 | minimumZoomScale: PropTypes.number, 26 | maximumZoomScale: PropTypes.number, 27 | scale: PropTypes.number, 28 | onLoadStart: PropTypes.func, 29 | onLoad: PropTypes.func, 30 | onLoadEnd: PropTypes.func, 31 | onProgress: PropTypes.func, 32 | onTap: PropTypes.func, 33 | onViewTap: PropTypes.func, 34 | onScale: PropTypes.func, 35 | showsHorizontalScrollIndicator: PropTypes.bool, 36 | showsVerticalScrollIndicator: PropTypes.bool, 37 | ...ViewPropTypes 38 | }; 39 | 40 | render() { 41 | const source = resolveAssetSource(this.props.source); 42 | var loadingIndicatorSource = resolveAssetSource(this.props.loadingIndicatorSource); 43 | 44 | if (source && source.uri === '') { 45 | console.warn('source.uri should not be an empty string'); 46 | } 47 | 48 | if (this.props.src) { 49 | console.warn('The component requires a `source` property rather than `src`.'); 50 | } 51 | 52 | if (source && source.uri) { 53 | var {onLoadStart, onLoad, onLoadEnd, onProgress, onTap, onViewTap, onScale, onError, ...props} = this.props; 54 | 55 | var nativeProps = { 56 | onPhotoViewerError: onError, 57 | onPhotoViewerLoadStart: onLoadStart, 58 | onPhotoViewerLoad: onLoad, 59 | onPhotoViewerLoadEnd: onLoadEnd, 60 | onPhotoViewerProgress: onProgress, 61 | onPhotoViewerTap: onTap, 62 | onPhotoViewerViewTap: onViewTap, 63 | onPhotoViewerScale: onScale, 64 | ...props, 65 | src: source, 66 | loadingIndicatorSrc: loadingIndicatorSource ? loadingIndicatorSource.uri : null, 67 | }; 68 | 69 | return 70 | } 71 | return null 72 | } 73 | } 74 | 75 | var cfg = { 76 | nativeOnly: { 77 | onPhotoViewerError: true, 78 | onPhotoViewerLoadStart: true, 79 | onPhotoViewerLoad: true, 80 | onPhotoViewerLoadEnd: true, 81 | onPhotoViewerProgress: true, 82 | onPhotoViewerTap: true, 83 | onPhotoViewerViewTap: true, 84 | onPhotoViewerScale: true, 85 | src: true, 86 | loadingIndicatorSrc: true 87 | } 88 | }; 89 | 90 | const RNPhotoView = requireNativeComponent('RNPhotoView', PhotoView, cfg); 91 | -------------------------------------------------------------------------------- /PhotoView.android.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { requireNativeComponent, View } from 'react-native'; 4 | import ViewPropTypes from 'react-native/Libraries/Components/View/ViewPropTypes'; 5 | 6 | const resolveAssetSource = require('react-native/Libraries/Image/resolveAssetSource'); 7 | 8 | export default class PhotoView extends Component { 9 | static propTypes = { 10 | source: PropTypes.oneOfType([ 11 | PropTypes.shape({ 12 | uri: PropTypes.string 13 | }), 14 | // Opaque type returned by require('./image.jpg') 15 | PropTypes.number 16 | ]), 17 | loadingIndicatorSource: PropTypes.oneOfType([ 18 | PropTypes.shape({ 19 | uri: PropTypes.string 20 | }), 21 | // Opaque type returned by require('./image.jpg') 22 | PropTypes.number 23 | ]), 24 | fadeDuration: PropTypes.number, 25 | minimumZoomScale: PropTypes.number, 26 | maximumZoomScale: PropTypes.number, 27 | scale: PropTypes.number, 28 | androidZoomTransitionDuration: PropTypes.number, 29 | androidScaleType: PropTypes.oneOf(["center", "centerCrop", "centerInside", "fitCenter", "fitStart", "fitEnd", "fitXY", "matrix"]), 30 | onLoadStart: PropTypes.func, 31 | onError: PropTypes.func, 32 | onLoad: PropTypes.func, 33 | onLoadEnd: PropTypes.func, 34 | onTap: PropTypes.func, 35 | onViewTap: PropTypes.func, 36 | onScale: PropTypes.func, 37 | ...ViewPropTypes 38 | }; 39 | 40 | render() { 41 | const source = resolveAssetSource(this.props.source); 42 | var loadingIndicatorSource = resolveAssetSource(this.props.loadingIndicatorSource); 43 | 44 | if (source && source.uri === '') { 45 | console.warn('source.uri should not be an empty string'); 46 | } 47 | 48 | if (this.props.src) { 49 | console.warn('The component requires a `source` property rather than `src`.'); 50 | } 51 | 52 | if (source && source.uri) { 53 | var {onLoadStart, onLoad, onLoadEnd, onTap, onViewTap, onScale, onError, ...props} = this.props; 54 | 55 | var nativeProps = { 56 | onPhotoViewerError: onError, 57 | onPhotoViewerLoadStart: onLoadStart, 58 | onPhotoViewerLoad: onLoad, 59 | onPhotoViewerLoadEnd: onLoadEnd, 60 | onPhotoViewerTap: onTap, 61 | onPhotoViewerViewTap: onViewTap, 62 | onPhotoViewerScale: onScale, 63 | ...props, 64 | shouldNotifyLoadEvents: !!(onLoadStart || onLoad || onLoadEnd || onError), 65 | src: source, 66 | loadingIndicatorSrc: loadingIndicatorSource ? loadingIndicatorSource.uri : null, 67 | }; 68 | 69 | return 70 | } 71 | return null 72 | } 73 | } 74 | 75 | var cfg = { 76 | nativeOnly: { 77 | onPhotoViewerError: true, 78 | onPhotoViewerLoadStart: true, 79 | onPhotoViewerLoad: true, 80 | onPhotoViewerLoadEnd: true, 81 | onPhotoViewerTap: true, 82 | onPhotoViewerViewTap: true, 83 | onPhotoViewerScale: true, 84 | shouldNotifyLoadEvents: true, 85 | src: true, 86 | loadingIndicatorSrc: true 87 | } 88 | }; 89 | 90 | const PhotoViewAndroid = requireNativeComponent('PhotoViewAndroid', PhotoView, cfg); 91 | -------------------------------------------------------------------------------- /example/ios/example/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-photo-view 2 | 3 | Provides custom Image view for React Native that allows to perform 4 | pinch-to-zoom on images. Works on both iOS and Android. 5 | 6 | This component uses [PhotoDraweeView](https://github.com/ongakuer/PhotoDraweeView) for Android and [MWPhotobrowser](https://github.com/mwaterfall/MWPhotoBrowser) on iOS. 7 | 8 | ## Usage 9 | 10 | ```javascript 11 | import PhotoView from 'react-native-photo-view'; 12 | ``` 13 | 14 | Basics: 15 | ```javascript 16 | console.log("Image loaded!")} 22 | style={{width: 300, height: 300}} /> 23 | ``` 24 | 25 | ## Properties 26 | 27 | | Property | Type | Description | 28 | |-----------------|----------|--------------------------------------------------------------| 29 | | source | Object | same as source for other React images | 30 | | loadingIndicatorSource | Object | source for loading indicator | 31 | | fadeDuration | int | duration of image fade (in ms) | 32 | | minimumZoomScale | float | The minimum allowed zoom scale. The default value is 1.0 | 33 | | maximumZoomScale | float | The maximum allowed zoom scale. The default value is 3.0 | 34 | | showsHorizontalScrollIndicator | bool | **iOS only**: When true, shows a horizontal scroll indicator. The default value is true. | 35 | | showsVerticalScrollIndicator | bool | **iOS only**: When true, shows a vertical scroll indicator. The default value is true. | 36 | | scale | float | Set zoom scale programmatically | 37 | androidZoomTransitionDuration | int | **Android only**: Double-tap zoom transition duration | 38 | | androidScaleType | String | **Android only**: One of the default *Android* scale types: "center", "centerCrop", "centerInside", "fitCenter", "fitStart", "fitEnd", "fitXY" | 39 | | onLoadStart | func | Callback function | 40 | | onLoad | func | Callback function | 41 | | onLoadEnd | func | Callback function | 42 | | onProgress | func | **iOS only**: Callback function, invoked on download progress with {nativeEvent: {loaded, total}}. | 43 | | onTap | func | Callback function (called on image tap) | 44 | | onViewTap | func | Callback function (called on tap outside of image) | 45 | | onScale | func | Callback function | 46 | 47 | ## Compared to [react-native-image-zoom](https://github.com/Anthonyzou/react-native-image-zoom) 48 | 49 | react-native-image-zoom functionality is similar, but there are several major differencies: 50 | 51 | * PhotoView is based on PhotoDraweeView which is the "PhotoView For Fresco". It works better, it supports several 52 | important callbacks out-of-box and it is, actually, recommended by Chris Banes, because his 53 | [PhotoView](https://github.com/chrisbanes/PhotoView) (base for react-native-image-zoom) doesn't completely 54 | support Facebook Fresco; 55 | * PhotoView has more options like fadeDuration and minimumZoomScale/maximumZoomScale and more important callbacks; 56 | * PhotoView is written in the same manner as default React Image, and it supports most of the 57 | features Image has (the goal is to be fully compaitable with Image and support absolutely everything); 58 | * It is possible to use PhotoView as a container (currently iOS only)! 59 | 60 | ## Automatic installation 61 | 62 | Just two simple steps: 63 | 64 | ```console 65 | npm install --save react-native-photo-view 66 | ``` 67 | 68 | ```console 69 | react-native link react-native-photo-view 70 | ``` 71 | 72 | ## Manual installation 73 | 74 | 75 | ### Android 76 | 1. Add these lines to `android/settings.gradle` 77 | ``` 78 | include ':react-native-photo-view' 79 | project(':react-native-photo-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-photo-view/android') 80 | ``` 81 | 82 | 2. Add one more dependency to `android/app/build.gradle` 83 | ``` 84 | dependencies { 85 | compile project(':react-native-photo-view') 86 | } 87 | ``` 88 | 89 | 3. Add it to your `MainActivity.java` for RN < 0.29 and to your `MainApplication.java` for RN >=0.29 90 | 91 | To register `PhotoViewPackage`, you need to change the `MainActivity` or `MainApplication` depending on React Native version of your app: 92 | ```java 93 | import com.reactnative.photoview.PhotoViewPackage; 94 | 95 | // ... 96 | 97 | public class MainActivity extends ReactActivity { 98 | // ... 99 | 100 | @Override 101 | protected List getPackages() { 102 | return Arrays.asList( 103 | new MainReactPackage(), 104 | new PhotoViewPackage() // add this manager 105 | ); 106 | } 107 | 108 | // ... 109 | } 110 | ``` 111 | 112 | ### IOS 113 | 1. Add this line to your podfile 114 | ``` 115 | pod 'react-native-photo-view', path: './node_modules/react-native-photo-view' 116 | ``` 117 | 118 | 2. Run `pod install` 119 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnative/photoview/PhotoViewManager.java: -------------------------------------------------------------------------------- 1 | package com.reactnative.photoview; 2 | 3 | import android.widget.ImageView.ScaleType; 4 | import com.facebook.drawee.backends.pipeline.Fresco; 5 | import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; 6 | import com.facebook.drawee.drawable.ScalingUtils; 7 | import com.facebook.drawee.generic.GenericDraweeHierarchy; 8 | import com.facebook.react.bridge.ReactApplicationContext; 9 | import com.facebook.react.bridge.ReadableMap; 10 | import com.facebook.react.common.MapBuilder; 11 | import com.facebook.react.uimanager.SimpleViewManager; 12 | import com.facebook.react.uimanager.ThemedReactContext; 13 | import com.facebook.react.uimanager.annotations.ReactProp; 14 | 15 | import javax.annotation.Nullable; 16 | import java.util.Map; 17 | 18 | /** 19 | * @author alwx (https://github.com/alwx) 20 | * @version 1.0 21 | */ 22 | public class PhotoViewManager extends SimpleViewManager { 23 | private static final String REACT_CLASS = "PhotoViewAndroid"; 24 | 25 | private ResourceDrawableIdHelper mResourceDrawableIdHelper; 26 | 27 | PhotoViewManager(ReactApplicationContext context) { 28 | mResourceDrawableIdHelper = new ResourceDrawableIdHelper(); 29 | } 30 | 31 | @Override 32 | public String getName() { 33 | return REACT_CLASS; 34 | } 35 | 36 | @Override 37 | protected PhotoView createViewInstance(ThemedReactContext reactContext) { 38 | return new PhotoView(reactContext); 39 | } 40 | 41 | @ReactProp(name = "src") 42 | public void setSource(PhotoView view, @Nullable ReadableMap source) { 43 | view.setSource(source, mResourceDrawableIdHelper); 44 | } 45 | 46 | @ReactProp(name = "loadingIndicatorSrc") 47 | public void setLoadingIndicatorSource(PhotoView view, @Nullable String source) { 48 | view.setLoadingIndicatorSource(source, mResourceDrawableIdHelper); 49 | } 50 | 51 | @ReactProp(name = "fadeDuration") 52 | public void setFadeDuration(PhotoView view, int durationMs) { 53 | view.setFadeDuration(durationMs); 54 | } 55 | 56 | @ReactProp(name = "shouldNotifyLoadEvents") 57 | public void setLoadHandlersRegistered(PhotoView view, boolean shouldNotifyLoadEvents) { 58 | view.setShouldNotifyLoadEvents(shouldNotifyLoadEvents); 59 | } 60 | 61 | @ReactProp(name = "minimumZoomScale") 62 | public void setMinimumZoomScale(PhotoView view, float minimumZoomScale) { 63 | view.setMinimumScale(minimumZoomScale); 64 | } 65 | 66 | @ReactProp(name = "maximumZoomScale") 67 | public void setMaximumZoomScale(PhotoView view, float maximumZoomScale) { 68 | view.setMaximumScale(maximumZoomScale); 69 | } 70 | 71 | @ReactProp(name = "scale") 72 | public void setScale(PhotoView view, float scale) { 73 | view.setScale(scale, true); 74 | } 75 | 76 | @ReactProp(name = "androidZoomTransitionDuration") 77 | public void setScale(PhotoView view, int durationMs) { 78 | view.setZoomTransitionDuration(durationMs); 79 | } 80 | 81 | @ReactProp(name = "androidScaleType") 82 | public void setScaleType(PhotoView view, String scaleType) { 83 | ScalingUtils.ScaleType value = ScalingUtils.ScaleType.CENTER; 84 | 85 | switch (scaleType) { 86 | case "center": 87 | value = ScalingUtils.ScaleType.CENTER; 88 | break; 89 | case "centerCrop": 90 | value = ScalingUtils.ScaleType.CENTER_CROP; 91 | break; 92 | case "centerInside": 93 | value = ScalingUtils.ScaleType.CENTER_INSIDE; 94 | break; 95 | case "fitCenter": 96 | value = ScalingUtils.ScaleType.FIT_CENTER; 97 | break; 98 | case "fitStart": 99 | value = ScalingUtils.ScaleType.FIT_START; 100 | break; 101 | case "fitEnd": 102 | value = ScalingUtils.ScaleType.FIT_END; 103 | break; 104 | case "fitXY": 105 | value = ScalingUtils.ScaleType.FIT_XY; 106 | break; 107 | } 108 | GenericDraweeHierarchy hierarchy = view.getHierarchy(); 109 | hierarchy.setActualImageScaleType(value); 110 | } 111 | 112 | @Override 113 | public @Nullable 114 | Map getExportedCustomDirectEventTypeConstants() { 115 | return MapBuilder.of( 116 | ImageEvent.eventNameForType(ImageEvent.ON_ERROR), MapBuilder.of("registrationName", "onPhotoViewerError"), 117 | ImageEvent.eventNameForType(ImageEvent.ON_LOAD_START), MapBuilder.of("registrationName", "onPhotoViewerLoadStart"), 118 | ImageEvent.eventNameForType(ImageEvent.ON_LOAD), MapBuilder.of("registrationName", "onPhotoViewerLoad"), 119 | ImageEvent.eventNameForType(ImageEvent.ON_LOAD_END), MapBuilder.of("registrationName", "onPhotoViewerLoadEnd"), 120 | ImageEvent.eventNameForType(ImageEvent.ON_TAP), MapBuilder.of("registrationName", "onPhotoViewerTap"), 121 | ImageEvent.eventNameForType(ImageEvent.ON_VIEW_TAP), MapBuilder.of("registrationName", "onPhotoViewerViewTap"), 122 | ImageEvent.eventNameForType(ImageEvent.ON_SCALE), MapBuilder.of("registrationName", "onPhotoViewerScale") 123 | ); 124 | } 125 | 126 | @Override 127 | protected void onAfterUpdateTransaction(PhotoView view) { 128 | super.onAfterUpdateTransaction(view); 129 | view.maybeUpdateView(Fresco.newDraweeControllerBuilder()); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /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 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | apply from: "../../node_modules/react-native/react.gradle" 76 | 77 | /** 78 | * Set this to true to create two separate APKs instead of one: 79 | * - An APK that only works on ARM devices 80 | * - An APK that only works on x86 devices 81 | * The advantage is the size of the APK is reduced by about 4MB. 82 | * Upload all the APKs to the Play Store and people will download 83 | * the correct one based on the CPU architecture of their device. 84 | */ 85 | def enableSeparateBuildPerCPUArchitecture = false 86 | 87 | /** 88 | * Run Proguard to shrink the Java bytecode in release builds. 89 | */ 90 | def enableProguardInReleaseBuilds = false 91 | 92 | android { 93 | compileSdkVersion 23 94 | buildToolsVersion "23.0.1" 95 | 96 | defaultConfig { 97 | applicationId "com.example" 98 | minSdkVersion 16 99 | targetSdkVersion 22 100 | versionCode 1 101 | versionName "1.0" 102 | ndk { 103 | abiFilters "armeabi-v7a", "x86" 104 | } 105 | } 106 | splits { 107 | abi { 108 | reset() 109 | enable enableSeparateBuildPerCPUArchitecture 110 | universalApk false // If true, also generate a universal APK 111 | include "armeabi-v7a", "x86" 112 | } 113 | } 114 | buildTypes { 115 | release { 116 | minifyEnabled enableProguardInReleaseBuilds 117 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 118 | } 119 | } 120 | // applicationVariants are e.g. debug, release 121 | applicationVariants.all { variant -> 122 | variant.outputs.each { output -> 123 | // For each separate APK per architecture, set a unique version code as described here: 124 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 125 | def versionCodes = ["armeabi-v7a":1, "x86":2] 126 | def abi = output.getFilter(OutputFile.ABI) 127 | if (abi != null) { // null for the universal-debug, universal-release variants 128 | output.versionCodeOverride = 129 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 130 | } 131 | } 132 | } 133 | } 134 | 135 | dependencies { 136 | compile project(':react-native-photo-view') 137 | compile fileTree(dir: "libs", include: ["*.jar"]) 138 | compile "com.android.support:appcompat-v7:23.0.1" 139 | compile "com.facebook.react:react-native:+" // From node_modules 140 | } 141 | 142 | // Run this once to be able to run the application with BUCK 143 | // puts all compile dependencies into folder libs for BUCK to use 144 | task copyDownloadableDepsToLibs(type: Copy) { 145 | from configurations.compile 146 | into 'libs' 147 | } 148 | -------------------------------------------------------------------------------- /ios/RNPhotoView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13BE3DEE1AC21097009241FE /* RNPhotoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* RNPhotoView.m */; }; 11 | 28829E221F1F5DB900A2FFDB /* RNPhotoViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 28829E211F1F5DB900A2FFDB /* RNPhotoViewManager.m */; }; 12 | 28829E271F1F670500A2FFDB /* MWTapDetectingImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28829E241F1F670500A2FFDB /* MWTapDetectingImageView.m */; }; 13 | 28829E281F1F670500A2FFDB /* MWTapDetectingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28829E261F1F670500A2FFDB /* MWTapDetectingView.m */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXCopyFilesBuildPhase section */ 17 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 18 | isa = PBXCopyFilesBuildPhase; 19 | buildActionMask = 2147483647; 20 | dstPath = "include/$(PRODUCT_NAME)"; 21 | dstSubfolderSpec = 16; 22 | files = ( 23 | ); 24 | runOnlyForDeploymentPostprocessing = 0; 25 | }; 26 | /* End PBXCopyFilesBuildPhase section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | 134814201AA4EA6300B7C361 /* libRNPhotoView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNPhotoView.a; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 13BE3DEC1AC21097009241FE /* RNPhotoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPhotoView.h; sourceTree = ""; }; 31 | 13BE3DED1AC21097009241FE /* RNPhotoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPhotoView.m; sourceTree = ""; }; 32 | 28829E201F1F5DB900A2FFDB /* RNPhotoViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPhotoViewManager.h; sourceTree = ""; }; 33 | 28829E211F1F5DB900A2FFDB /* RNPhotoViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPhotoViewManager.m; sourceTree = ""; }; 34 | 28829E231F1F670500A2FFDB /* MWTapDetectingImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWTapDetectingImageView.h; sourceTree = ""; }; 35 | 28829E241F1F670500A2FFDB /* MWTapDetectingImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWTapDetectingImageView.m; sourceTree = ""; }; 36 | 28829E251F1F670500A2FFDB /* MWTapDetectingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWTapDetectingView.h; sourceTree = ""; }; 37 | 28829E261F1F670500A2FFDB /* MWTapDetectingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWTapDetectingView.m; sourceTree = ""; }; 38 | /* End PBXFileReference section */ 39 | 40 | /* Begin PBXFrameworksBuildPhase section */ 41 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 42 | isa = PBXFrameworksBuildPhase; 43 | buildActionMask = 2147483647; 44 | files = ( 45 | ); 46 | runOnlyForDeploymentPostprocessing = 0; 47 | }; 48 | /* End PBXFrameworksBuildPhase section */ 49 | 50 | /* Begin PBXGroup section */ 51 | 134814211AA4EA7D00B7C361 /* Products */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | 134814201AA4EA6300B7C361 /* libRNPhotoView.a */, 55 | ); 56 | name = Products; 57 | sourceTree = ""; 58 | }; 59 | 58B511D21A9E6C8500147676 = { 60 | isa = PBXGroup; 61 | children = ( 62 | 28829E231F1F670500A2FFDB /* MWTapDetectingImageView.h */, 63 | 28829E241F1F670500A2FFDB /* MWTapDetectingImageView.m */, 64 | 28829E251F1F670500A2FFDB /* MWTapDetectingView.h */, 65 | 28829E261F1F670500A2FFDB /* MWTapDetectingView.m */, 66 | 28829E201F1F5DB900A2FFDB /* RNPhotoViewManager.h */, 67 | 28829E211F1F5DB900A2FFDB /* RNPhotoViewManager.m */, 68 | 13BE3DEC1AC21097009241FE /* RNPhotoView.h */, 69 | 13BE3DED1AC21097009241FE /* RNPhotoView.m */, 70 | 134814211AA4EA7D00B7C361 /* Products */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | /* End PBXGroup section */ 75 | 76 | /* Begin PBXNativeTarget section */ 77 | 58B511DA1A9E6C8500147676 /* RNPhotoView */ = { 78 | isa = PBXNativeTarget; 79 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNPhotoView" */; 80 | buildPhases = ( 81 | 58B511D71A9E6C8500147676 /* Sources */, 82 | 58B511D81A9E6C8500147676 /* Frameworks */, 83 | 58B511D91A9E6C8500147676 /* CopyFiles */, 84 | ); 85 | buildRules = ( 86 | ); 87 | dependencies = ( 88 | ); 89 | name = RNPhotoView; 90 | productName = RCTDataManager; 91 | productReference = 134814201AA4EA6300B7C361 /* libRNPhotoView.a */; 92 | productType = "com.apple.product-type.library.static"; 93 | }; 94 | /* End PBXNativeTarget section */ 95 | 96 | /* Begin PBXProject section */ 97 | 58B511D31A9E6C8500147676 /* Project object */ = { 98 | isa = PBXProject; 99 | attributes = { 100 | LastUpgradeCheck = 0610; 101 | ORGANIZATIONNAME = Facebook; 102 | TargetAttributes = { 103 | 58B511DA1A9E6C8500147676 = { 104 | CreatedOnToolsVersion = 6.1.1; 105 | }; 106 | }; 107 | }; 108 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNPhotoView" */; 109 | compatibilityVersion = "Xcode 3.2"; 110 | developmentRegion = English; 111 | hasScannedForEncodings = 0; 112 | knownRegions = ( 113 | en, 114 | ); 115 | mainGroup = 58B511D21A9E6C8500147676; 116 | productRefGroup = 58B511D21A9E6C8500147676; 117 | projectDirPath = ""; 118 | projectRoot = ""; 119 | targets = ( 120 | 58B511DA1A9E6C8500147676 /* RNPhotoView */, 121 | ); 122 | }; 123 | /* End PBXProject section */ 124 | 125 | /* Begin PBXSourcesBuildPhase section */ 126 | 58B511D71A9E6C8500147676 /* Sources */ = { 127 | isa = PBXSourcesBuildPhase; 128 | buildActionMask = 2147483647; 129 | files = ( 130 | 28829E271F1F670500A2FFDB /* MWTapDetectingImageView.m in Sources */, 131 | 13BE3DEE1AC21097009241FE /* RNPhotoView.m in Sources */, 132 | 28829E281F1F670500A2FFDB /* MWTapDetectingView.m in Sources */, 133 | 28829E221F1F5DB900A2FFDB /* RNPhotoViewManager.m in Sources */, 134 | ); 135 | runOnlyForDeploymentPostprocessing = 0; 136 | }; 137 | /* End PBXSourcesBuildPhase section */ 138 | 139 | /* Begin XCBuildConfiguration section */ 140 | 58B511ED1A9E6C8500147676 /* Debug */ = { 141 | isa = XCBuildConfiguration; 142 | buildSettings = { 143 | ALWAYS_SEARCH_USER_PATHS = NO; 144 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 145 | CLANG_CXX_LIBRARY = "libc++"; 146 | CLANG_ENABLE_MODULES = YES; 147 | CLANG_ENABLE_OBJC_ARC = YES; 148 | CLANG_WARN_BOOL_CONVERSION = YES; 149 | CLANG_WARN_CONSTANT_CONVERSION = YES; 150 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 151 | CLANG_WARN_EMPTY_BODY = YES; 152 | CLANG_WARN_ENUM_CONVERSION = YES; 153 | CLANG_WARN_INT_CONVERSION = YES; 154 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 155 | CLANG_WARN_UNREACHABLE_CODE = YES; 156 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 157 | COPY_PHASE_STRIP = NO; 158 | ENABLE_STRICT_OBJC_MSGSEND = YES; 159 | GCC_C_LANGUAGE_STANDARD = gnu99; 160 | GCC_DYNAMIC_NO_PIC = NO; 161 | GCC_OPTIMIZATION_LEVEL = 0; 162 | GCC_PREPROCESSOR_DEFINITIONS = ( 163 | "DEBUG=1", 164 | "$(inherited)", 165 | ); 166 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 167 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 168 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 169 | GCC_WARN_UNDECLARED_SELECTOR = YES; 170 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 171 | GCC_WARN_UNUSED_FUNCTION = YES; 172 | GCC_WARN_UNUSED_VARIABLE = YES; 173 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 174 | MTL_ENABLE_DEBUG_INFO = YES; 175 | ONLY_ACTIVE_ARCH = YES; 176 | SDKROOT = iphoneos; 177 | }; 178 | name = Debug; 179 | }; 180 | 58B511EE1A9E6C8500147676 /* Release */ = { 181 | isa = XCBuildConfiguration; 182 | buildSettings = { 183 | ALWAYS_SEARCH_USER_PATHS = NO; 184 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 185 | CLANG_CXX_LIBRARY = "libc++"; 186 | CLANG_ENABLE_MODULES = YES; 187 | CLANG_ENABLE_OBJC_ARC = YES; 188 | CLANG_WARN_BOOL_CONVERSION = YES; 189 | CLANG_WARN_CONSTANT_CONVERSION = YES; 190 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 191 | CLANG_WARN_EMPTY_BODY = YES; 192 | CLANG_WARN_ENUM_CONVERSION = YES; 193 | CLANG_WARN_INT_CONVERSION = YES; 194 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | COPY_PHASE_STRIP = YES; 198 | ENABLE_NS_ASSERTIONS = NO; 199 | ENABLE_STRICT_OBJC_MSGSEND = YES; 200 | GCC_C_LANGUAGE_STANDARD = gnu99; 201 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 202 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 203 | GCC_WARN_UNDECLARED_SELECTOR = YES; 204 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 205 | GCC_WARN_UNUSED_FUNCTION = YES; 206 | GCC_WARN_UNUSED_VARIABLE = YES; 207 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 208 | MTL_ENABLE_DEBUG_INFO = NO; 209 | SDKROOT = iphoneos; 210 | VALIDATE_PRODUCT = YES; 211 | }; 212 | name = Release; 213 | }; 214 | 58B511F01A9E6C8500147676 /* Debug */ = { 215 | isa = XCBuildConfiguration; 216 | buildSettings = { 217 | HEADER_SEARCH_PATHS = ( 218 | "$(inherited)", 219 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 220 | "$(SRCROOT)/../../React/**", 221 | "$(SRCROOT)/../../node_modules/react-native/React/**", 222 | ); 223 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 224 | OTHER_LDFLAGS = "-ObjC"; 225 | PRODUCT_NAME = RNPhotoView; 226 | SKIP_INSTALL = YES; 227 | }; 228 | name = Debug; 229 | }; 230 | 58B511F11A9E6C8500147676 /* Release */ = { 231 | isa = XCBuildConfiguration; 232 | buildSettings = { 233 | HEADER_SEARCH_PATHS = ( 234 | "$(inherited)", 235 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 236 | "$(SRCROOT)/../../React/**", 237 | ); 238 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 239 | OTHER_LDFLAGS = "-ObjC"; 240 | PRODUCT_NAME = RNPhotoView; 241 | SKIP_INSTALL = YES; 242 | }; 243 | name = Release; 244 | }; 245 | /* End XCBuildConfiguration section */ 246 | 247 | /* Begin XCConfigurationList section */ 248 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNPhotoView" */ = { 249 | isa = XCConfigurationList; 250 | buildConfigurations = ( 251 | 58B511ED1A9E6C8500147676 /* Debug */, 252 | 58B511EE1A9E6C8500147676 /* Release */, 253 | ); 254 | defaultConfigurationIsVisible = 0; 255 | defaultConfigurationName = Release; 256 | }; 257 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNPhotoView" */ = { 258 | isa = XCConfigurationList; 259 | buildConfigurations = ( 260 | 58B511F01A9E6C8500147676 /* Debug */, 261 | 58B511F11A9E6C8500147676 /* Release */, 262 | ); 263 | defaultConfigurationIsVisible = 0; 264 | defaultConfigurationName = Release; 265 | }; 266 | /* End XCConfigurationList section */ 267 | }; 268 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 269 | } 270 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnative/photoview/PhotoView.java: -------------------------------------------------------------------------------- 1 | package com.reactnative.photoview; 2 | 3 | import android.content.Context; 4 | import android.graphics.drawable.Animatable; 5 | import android.graphics.drawable.Drawable; 6 | import android.net.Uri; 7 | import android.support.annotation.NonNull; 8 | import android.util.Log; 9 | import android.view.View; 10 | import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; 11 | import com.facebook.drawee.controller.BaseControllerListener; 12 | import com.facebook.drawee.controller.ControllerListener; 13 | import com.facebook.drawee.drawable.AutoRotateDrawable; 14 | import com.facebook.drawee.drawable.ScalingUtils; 15 | import com.facebook.drawee.generic.GenericDraweeHierarchy; 16 | import com.facebook.imagepipeline.common.ResizeOptions; 17 | import com.facebook.imagepipeline.image.ImageInfo; 18 | import com.facebook.imagepipeline.request.ImageRequest; 19 | import com.facebook.imagepipeline.request.ImageRequestBuilder; 20 | import com.facebook.react.bridge.Arguments; 21 | import com.facebook.react.bridge.ReactContext; 22 | import com.facebook.react.bridge.ReadableMap; 23 | import com.facebook.react.bridge.WritableMap; 24 | import com.facebook.react.common.SystemClock; 25 | import com.facebook.react.modules.fresco.ReactNetworkImageRequest; 26 | import com.facebook.react.uimanager.UIManagerModule; 27 | import com.facebook.react.uimanager.events.EventDispatcher; 28 | import me.relex.photodraweeview.OnPhotoTapListener; 29 | import me.relex.photodraweeview.OnScaleChangeListener; 30 | import me.relex.photodraweeview.OnViewTapListener; 31 | import me.relex.photodraweeview.PhotoDraweeView; 32 | 33 | import javax.annotation.Nullable; 34 | import javax.microedition.khronos.egl.EGL10; 35 | import javax.microedition.khronos.egl.EGLConfig; 36 | import javax.microedition.khronos.egl.EGLContext; 37 | import javax.microedition.khronos.egl.EGLDisplay; 38 | 39 | import static com.facebook.react.views.image.ReactImageView.REMOTE_IMAGE_FADE_DURATION_MS; 40 | 41 | /** 42 | * @author alwx (https://github.com/alwx) 43 | * @version 1.0 44 | */ 45 | public class PhotoView extends PhotoDraweeView { 46 | private Uri mUri; 47 | private ReadableMap mHeaders; 48 | private boolean mIsDirty; 49 | private boolean mIsLocalImage; 50 | private Drawable mLoadingImageDrawable; 51 | private PipelineDraweeControllerBuilder mDraweeControllerBuilder; 52 | private int mFadeDurationMs = -1; 53 | private ControllerListener mControllerListener; 54 | 55 | public PhotoView(Context context) { 56 | super(context); 57 | } 58 | 59 | public void setSource(@Nullable ReadableMap source, 60 | @NonNull ResourceDrawableIdHelper resourceDrawableIdHelper) { 61 | mUri = null; 62 | if (source != null) { 63 | String uri = source.getString("uri"); 64 | try { 65 | mUri = Uri.parse(uri); 66 | // Verify scheme is set, so that relative uri (used by static resources) are not handled. 67 | if (mUri.getScheme() == null) { 68 | mUri = null; 69 | } 70 | if (source.hasKey("headers")) { 71 | mHeaders = source.getMap("headers"); 72 | } 73 | } catch (Exception e) { 74 | // ignore malformed uri, then attempt to extract resource ID. 75 | } 76 | if (mUri == null) { 77 | mUri = resourceDrawableIdHelper.getResourceDrawableUri(getContext(), uri); 78 | mIsLocalImage = true; 79 | } else { 80 | mIsLocalImage = false; 81 | } 82 | } 83 | mIsDirty = true; 84 | } 85 | 86 | public void setLoadingIndicatorSource(@Nullable String name, 87 | ResourceDrawableIdHelper resourceDrawableIdHelper) { 88 | Drawable drawable = resourceDrawableIdHelper.getResourceDrawable(getContext(), name); 89 | mLoadingImageDrawable = 90 | drawable != null ? (Drawable) new AutoRotateDrawable(drawable, 1000) : null; 91 | mIsDirty = true; 92 | } 93 | 94 | public void setFadeDuration(int durationMs) { 95 | mFadeDurationMs = durationMs; 96 | // no worth marking as dirty if it already rendered.. 97 | } 98 | 99 | public void setShouldNotifyLoadEvents(boolean shouldNotify) { 100 | if (!shouldNotify) { 101 | mControllerListener = null; 102 | } else { 103 | final EventDispatcher eventDispatcher = ((ReactContext) getContext()) 104 | .getNativeModule(UIManagerModule.class).getEventDispatcher(); 105 | mControllerListener = new BaseControllerListener() { 106 | @Override 107 | public void onSubmit(String id, Object callerContext) { 108 | eventDispatcher.dispatchEvent( 109 | new ImageEvent(getId(), ImageEvent.ON_LOAD_START) 110 | ); 111 | } 112 | 113 | @Override 114 | public void onFinalImageSet( 115 | String id, 116 | @Nullable final ImageInfo imageInfo, 117 | @Nullable Animatable animatable) { 118 | if (imageInfo != null) { 119 | eventDispatcher.dispatchEvent( 120 | new ImageEvent(getId(), ImageEvent.ON_LOAD) 121 | ); 122 | eventDispatcher.dispatchEvent( 123 | new ImageEvent(getId(), ImageEvent.ON_LOAD_END) 124 | ); 125 | update(imageInfo.getWidth(), imageInfo.getHeight()); 126 | } 127 | } 128 | 129 | @Override 130 | public void onFailure(String id, Throwable throwable) { 131 | eventDispatcher.dispatchEvent( 132 | new ImageEvent(getId(), ImageEvent.ON_ERROR) 133 | ); 134 | eventDispatcher.dispatchEvent( 135 | new ImageEvent(getId(), ImageEvent.ON_LOAD_END) 136 | ); 137 | } 138 | }; 139 | } 140 | mIsDirty = true; 141 | } 142 | 143 | public void maybeUpdateView(@NonNull PipelineDraweeControllerBuilder builder) { 144 | if (!mIsDirty) { 145 | return; 146 | } 147 | 148 | GenericDraweeHierarchy hierarchy = getHierarchy(); 149 | if (mLoadingImageDrawable != null) { 150 | hierarchy.setPlaceholderImage(mLoadingImageDrawable, ScalingUtils.ScaleType.CENTER); 151 | } 152 | hierarchy.setFadeDuration( 153 | mFadeDurationMs >= 0 154 | ? mFadeDurationMs 155 | : mIsLocalImage ? 0 : REMOTE_IMAGE_FADE_DURATION_MS); 156 | 157 | ImageRequestBuilder imageRequestBuilder = ImageRequestBuilder.newBuilderWithSource(mUri) 158 | .setAutoRotateEnabled(true).setResizeOptions(new ResizeOptions(getMaxTextureSize(), getMaxTextureSize())); 159 | 160 | ImageRequest imageRequest = ReactNetworkImageRequest 161 | .fromBuilderWithHeaders(imageRequestBuilder, mHeaders); 162 | 163 | mDraweeControllerBuilder = builder; 164 | mDraweeControllerBuilder.setImageRequest(imageRequest); 165 | mDraweeControllerBuilder.setAutoPlayAnimations(true); 166 | mDraweeControllerBuilder.setOldController(getController()); 167 | mDraweeControllerBuilder.setControllerListener(new BaseControllerListener() { 168 | @Override 169 | public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) { 170 | super.onFinalImageSet(id, imageInfo, animatable); 171 | if (imageInfo == null) { 172 | return; 173 | } 174 | update(imageInfo.getWidth(), imageInfo.getHeight()); 175 | } 176 | }); 177 | 178 | if (mControllerListener != null) { 179 | mDraweeControllerBuilder.setControllerListener(mControllerListener); 180 | } 181 | 182 | setController(mDraweeControllerBuilder.build()); 183 | setViewCallbacks(); 184 | 185 | mIsDirty = false; 186 | } 187 | 188 | private void setViewCallbacks() { 189 | final EventDispatcher eventDispatcher = ((ReactContext) getContext()) 190 | .getNativeModule(UIManagerModule.class).getEventDispatcher(); 191 | 192 | setOnPhotoTapListener(new OnPhotoTapListener() { 193 | @Override 194 | public void onPhotoTap(View view, float x, float y) { 195 | WritableMap scaleChange = Arguments.createMap(); 196 | scaleChange.putDouble("x", x); 197 | scaleChange.putDouble("y", y); 198 | scaleChange.putDouble("scale", PhotoView.this.getScale()); 199 | eventDispatcher.dispatchEvent( 200 | new ImageEvent(getId(), ImageEvent.ON_TAP).setExtras(scaleChange) 201 | ); 202 | } 203 | }); 204 | 205 | setOnScaleChangeListener(new OnScaleChangeListener() { 206 | @Override 207 | public void onScaleChange(float scaleFactor, float focusX, float focusY) { 208 | WritableMap scaleChange = Arguments.createMap(); 209 | scaleChange.putDouble("scale", PhotoView.this.getScale()); 210 | scaleChange.putDouble("scaleFactor", scaleFactor); 211 | scaleChange.putDouble("focusX", focusX); 212 | scaleChange.putDouble("focusY", focusY); 213 | eventDispatcher.dispatchEvent( 214 | new ImageEvent(getId(), ImageEvent.ON_SCALE).setExtras(scaleChange) 215 | ); 216 | } 217 | }); 218 | 219 | setOnViewTapListener(new OnViewTapListener() { 220 | @Override 221 | public void onViewTap(View view, float x, float y) { 222 | WritableMap scaleChange = Arguments.createMap(); 223 | scaleChange.putDouble("x", x); 224 | scaleChange.putDouble("y", y); 225 | eventDispatcher.dispatchEvent( 226 | new ImageEvent(getId(), ImageEvent.ON_VIEW_TAP).setExtras(scaleChange) 227 | ); 228 | } 229 | }); 230 | } 231 | 232 | private int getMaxTextureSize() { 233 | // Safe minimum default size 234 | final int IMAGE_MAX_BITMAP_DIMENSION = 2048; 235 | 236 | // Get EGL Display 237 | EGL10 egl = (EGL10) EGLContext.getEGL(); 238 | EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); 239 | 240 | // Initialise 241 | int[] version = new int[2]; 242 | egl.eglInitialize(display, version); 243 | 244 | // Query total number of configurations 245 | int[] totalConfigurations = new int[1]; 246 | egl.eglGetConfigs(display, null, 0, totalConfigurations); 247 | 248 | // Query actual list configurations 249 | EGLConfig[] configurationsList = new EGLConfig[totalConfigurations[0]]; 250 | egl.eglGetConfigs(display, configurationsList, totalConfigurations[0], totalConfigurations); 251 | 252 | int[] textureSize = new int[1]; 253 | int maximumTextureSize = 0; 254 | 255 | // Iterate through all the configurations to located the maximum texture size 256 | for (int i = 0; i < totalConfigurations[0]; i++) { 257 | // Only need to check for width since opengl textures are always squared 258 | egl.eglGetConfigAttrib(display, configurationsList[i], EGL10.EGL_MAX_PBUFFER_WIDTH, textureSize); 259 | 260 | // Keep track of the maximum texture size 261 | if (maximumTextureSize < textureSize[0]) 262 | maximumTextureSize = textureSize[0]; 263 | } 264 | 265 | // Release 266 | egl.eglTerminate(display); 267 | 268 | // Return largest texture size found, or default 269 | return Math.max(maximumTextureSize, IMAGE_MAX_BITMAP_DIMENSION); 270 | } 271 | } 272 | 273 | -------------------------------------------------------------------------------- /ios/RNPhotoView.m: -------------------------------------------------------------------------------- 1 | #import "RNPhotoView.h" 2 | 3 | #import 4 | #import 5 | #import 6 | #import 7 | #import 8 | #import 9 | #import 10 | 11 | @interface RNPhotoView() 12 | 13 | #pragma mark - View 14 | 15 | @property (nonatomic, strong) MWTapDetectingImageView *photoImageView; 16 | @property (nonatomic, strong) MWTapDetectingView *tapView; 17 | @property (nonatomic, strong) UIImageView *loadingImageView; 18 | 19 | #pragma mark - Data 20 | 21 | @property (nonatomic, strong) UIImage *image; 22 | @property (nonatomic, strong) UIImage *loadingImage; 23 | 24 | @end 25 | 26 | @implementation RNPhotoView 27 | { 28 | __weak RCTBridge *_bridge; 29 | } 30 | 31 | - (instancetype)initWithBridge:(RCTBridge *)bridge 32 | { 33 | if ((self = [super init])) { 34 | _bridge = bridge; 35 | [self initView]; 36 | } 37 | return self; 38 | } 39 | 40 | #pragma mark - UIScrollViewDelegate 41 | 42 | - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { 43 | return _photoImageView; 44 | } 45 | 46 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { 47 | 48 | } 49 | 50 | - (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view { 51 | self.scrollEnabled = YES; // reset 52 | } 53 | 54 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { 55 | 56 | } 57 | 58 | - (void)scrollViewDidZoom:(UIScrollView *)scrollView { 59 | [self setNeedsLayout]; 60 | [self layoutIfNeeded]; 61 | } 62 | 63 | #pragma mark - Tap Detection 64 | 65 | - (void)handleDoubleTap:(CGPoint)touchPoint { 66 | // Zoom 67 | if (self.zoomScale != self.minimumZoomScale && self.zoomScale != [self initialZoomScaleWithMinScale]) { 68 | // Zoom out 69 | [self setZoomScale:self.minimumZoomScale animated:YES]; 70 | } else { 71 | // Zoom in to twice the size 72 | CGFloat newZoomScale = ((self.maximumZoomScale + self.minimumZoomScale) / 2); 73 | CGFloat xsize = self.bounds.size.width / newZoomScale; 74 | CGFloat ysize = self.bounds.size.height / newZoomScale; 75 | [self zoomToRect:CGRectMake(touchPoint.x - xsize/2, touchPoint.y - ysize/2, xsize, ysize) animated:YES]; 76 | } 77 | } 78 | 79 | #pragma mark - MWTapDetectingImageViewDelegate 80 | 81 | // Image View 82 | - (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch { 83 | // Translate touch location to image view location 84 | CGFloat touchX = [touch locationInView:imageView].x; 85 | CGFloat touchY = [touch locationInView:imageView].y; 86 | touchX *= 1/self.zoomScale; 87 | touchY *= 1/self.zoomScale; 88 | touchX += self.contentOffset.x; 89 | touchY += self.contentOffset.y; 90 | 91 | if (_onPhotoViewerTap) { 92 | _onPhotoViewerTap(@{ 93 | @"point": @{ 94 | @"x": @(touchX), 95 | @"y": @(touchY), 96 | }, 97 | @"target": self.reactTag 98 | }); 99 | } 100 | } 101 | 102 | - (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch { 103 | [self handleDoubleTap:[touch locationInView:imageView]]; 104 | } 105 | 106 | #pragma mark - MWTapDetectingViewDelegate 107 | 108 | // Background View 109 | - (void)view:(UIView *)view singleTapDetected:(UITouch *)touch { 110 | // Translate touch location to image view location 111 | CGFloat touchX = [touch locationInView:view].x; 112 | CGFloat touchY = [touch locationInView:view].y; 113 | touchX *= 1/self.zoomScale; 114 | touchY *= 1/self.zoomScale; 115 | touchX += self.contentOffset.x; 116 | touchY += self.contentOffset.y; 117 | 118 | if (_onPhotoViewerViewTap) { 119 | _onPhotoViewerViewTap(@{ 120 | @"point": @{ 121 | @"x": @(touchX), 122 | @"y": @(touchY), 123 | }, 124 | @"target": self.reactTag, 125 | }); 126 | } 127 | } 128 | 129 | - (void)view:(UIView *)view doubleTapDetected:(UITouch *)touch { 130 | // Translate touch location to image view location 131 | CGFloat touchX = [touch locationInView:view].x; 132 | CGFloat touchY = [touch locationInView:view].y; 133 | touchX *= 1/self.zoomScale; 134 | touchY *= 1/self.zoomScale; 135 | touchX += self.contentOffset.x; 136 | touchY += self.contentOffset.y; 137 | [self handleDoubleTap:CGPointMake(touchX, touchY)]; 138 | } 139 | 140 | #pragma mark - Setup 141 | 142 | - (CGFloat)initialZoomScaleWithMinScale { 143 | CGFloat minZoom = self.minimumZoomScale; 144 | CGFloat zoomScale = self.minimumZoomScale; 145 | if (_photoImageView) { 146 | // Zoom image to fill if the aspect ratios are fairly similar 147 | CGSize boundsSize = self.bounds.size; 148 | CGSize imageSize = _photoImageView.image.size; 149 | CGFloat boundsAR = boundsSize.width / boundsSize.height; 150 | CGFloat imageAR = imageSize.width / imageSize.height; 151 | CGFloat xScale = boundsSize.width / imageSize.width; // the scale needed to perfectly fit the image width-wise 152 | CGFloat yScale = boundsSize.height / imageSize.height; // the scale needed to perfectly fit the image height-wise 153 | // Zooms standard portrait images on a 3.5in screen but not on a 4in screen. 154 | if (ABS(boundsAR - imageAR) < 0.17) { 155 | zoomScale = MAX(xScale, yScale); 156 | // Ensure we don't zoom in or out too far, just in case 157 | zoomScale = MIN(MAX(minZoom, zoomScale), minZoom); 158 | } 159 | } 160 | return zoomScale; 161 | } 162 | 163 | - (void)setMaxMinZoomScalesForCurrentBounds { 164 | 165 | // Reset 166 | self.maximumZoomScale = 1; 167 | self.minimumZoomScale = 1; 168 | self.zoomScale = 1; 169 | 170 | // Bail if no image 171 | if (_photoImageView.image == nil) return; 172 | 173 | // Reset position 174 | _photoImageView.frame = CGRectMake(0, 0, _photoImageView.frame.size.width, _photoImageView.frame.size.height); 175 | 176 | // Sizes 177 | CGSize boundsSize = self.bounds.size; 178 | CGSize imageSize = _photoImageView.image.size; 179 | 180 | // Calculate Min 181 | CGFloat xScale = boundsSize.width / imageSize.width; // the scale needed to perfectly fit the image width-wise 182 | CGFloat yScale = boundsSize.height / imageSize.height; // the scale needed to perfectly fit the image height-wise 183 | CGFloat minScale = MIN(xScale, yScale); // use minimum of these to allow the image to become fully visible 184 | 185 | /** 186 | [attention] 187 | original maximumZoomScale and minimumZoomScale is scaled to image, 188 | but we need scaled to scrollView, 189 | so has the next convert 190 | */ 191 | CGFloat maxScale = minScale * _maxZoomScale; 192 | minScale = minScale * _minZoomScale; 193 | 194 | // Set min/max zoom 195 | self.maximumZoomScale = maxScale; 196 | self.minimumZoomScale = minScale; 197 | 198 | // Initial zoom 199 | self.zoomScale = [self initialZoomScaleWithMinScale]; 200 | 201 | // If we're zooming to fill then centralise 202 | if (self.zoomScale != minScale) { 203 | 204 | // Centralise 205 | self.contentOffset = CGPointMake((imageSize.width * self.zoomScale - boundsSize.width) / 2.0, 206 | (imageSize.height * self.zoomScale - boundsSize.height) / 2.0); 207 | 208 | } 209 | 210 | // Disable scrolling initially until the first pinch to fix issues with swiping on an initally zoomed in photo 211 | self.scrollEnabled = NO; 212 | 213 | // Layout 214 | [self setNeedsLayout]; 215 | 216 | } 217 | 218 | #pragma mark - Layout 219 | 220 | - (void)layoutSubviews { 221 | 222 | // Update tap view frame 223 | _tapView.frame = self.bounds; 224 | 225 | // Super 226 | [super layoutSubviews]; 227 | 228 | // Center the image as it becomes smaller than the size of the screen 229 | CGSize boundsSize = self.bounds.size; 230 | CGRect frameToCenter = _photoImageView.frame; 231 | 232 | // Horizontally 233 | if (frameToCenter.size.width < boundsSize.width) { 234 | frameToCenter.origin.x = floorf((boundsSize.width - frameToCenter.size.width) / 2.0); 235 | } else { 236 | frameToCenter.origin.x = 0; 237 | } 238 | 239 | // Vertically 240 | if (frameToCenter.size.height < boundsSize.height) { 241 | frameToCenter.origin.y = floorf((boundsSize.height - frameToCenter.size.height) / 2.0); 242 | } else { 243 | frameToCenter.origin.y = 0; 244 | } 245 | 246 | // Center 247 | if (!CGRectEqualToRect(_photoImageView.frame, frameToCenter)) 248 | _photoImageView.frame = frameToCenter; 249 | if (_onPhotoViewerScale) { 250 | _onPhotoViewerScale(@{ 251 | @"scale": @(self.zoomScale), 252 | @"target": self.reactTag 253 | }); 254 | } 255 | } 256 | 257 | #pragma mark - Image 258 | 259 | // Get and display image 260 | - (void)displayWithImage:(UIImage*)image { 261 | if (image && !_photoImageView.image) { 262 | 263 | // Reset 264 | // self.maximumZoomScale = 1; 265 | // self.minimumZoomScale = 1; 266 | self.zoomScale = 1; 267 | self.contentSize = CGSizeMake(0, 0); 268 | 269 | // Set image 270 | _photoImageView.image = image; 271 | _photoImageView.hidden = NO; 272 | 273 | // Setup photo frame 274 | CGRect photoImageViewFrame; 275 | photoImageViewFrame.origin = CGPointZero; 276 | photoImageViewFrame.size = image.size; 277 | _photoImageView.frame = photoImageViewFrame; 278 | self.contentSize = photoImageViewFrame.size; 279 | 280 | // Set zoom to minimum zoom 281 | [self setMaxMinZoomScalesForCurrentBounds]; 282 | [self setNeedsLayout]; 283 | } 284 | } 285 | 286 | #pragma mark - Setter 287 | 288 | - (void)setSource:(NSDictionary *)source { 289 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 290 | if ([_source isEqualToDictionary:source]) { 291 | return; 292 | } 293 | NSString *uri = source[@"uri"]; 294 | if (!uri) { 295 | return; 296 | } 297 | _source = source; 298 | NSURL *imageURL = [NSURL URLWithString:uri]; 299 | 300 | if (![[uri substringToIndex:4] isEqualToString:@"http"]) { 301 | @try { 302 | UIImage *image = RCTImageFromLocalAssetURL(imageURL); 303 | if (image) { // if local image 304 | [self setImage:image]; 305 | if (_onPhotoViewerLoad) { 306 | _onPhotoViewerLoad(nil); 307 | } 308 | if (_onPhotoViewerLoadEnd) { 309 | _onPhotoViewerLoadEnd(nil); 310 | } 311 | return; 312 | } 313 | } 314 | @catch (NSException *exception) { 315 | NSLog(@"%@", exception.reason); 316 | } 317 | } 318 | 319 | NSURLRequest *request = [[NSURLRequest alloc] initWithURL:imageURL]; 320 | 321 | if (source[@"headers"]) { 322 | NSMutableURLRequest *mutableRequest = [request mutableCopy]; 323 | 324 | NSDictionary *headers = source[@"headers"]; 325 | NSEnumerator *enumerator = [headers keyEnumerator]; 326 | id key; 327 | while((key = [enumerator nextObject])) 328 | [mutableRequest addValue:[headers objectForKey:key] forHTTPHeaderField:key]; 329 | request = [mutableRequest copy]; 330 | } 331 | 332 | __weak RNPhotoView *weakSelf = self; 333 | if (_onPhotoViewerLoadStart) { 334 | _onPhotoViewerLoadStart(nil); 335 | } 336 | 337 | // use default values from [imageLoader loadImageWithURLRequest:request callback:callback] method 338 | [[_bridge moduleForClass:[RCTImageLoader class]] loadImageWithURLRequest:request 339 | size:CGSizeZero 340 | scale:1 341 | clipped:YES 342 | resizeMode:RCTResizeModeStretch 343 | progressBlock:^(int64_t progress, int64_t total) { 344 | if (_onPhotoViewerProgress) { 345 | _onPhotoViewerProgress(@{ 346 | @"loaded": @((double)progress), 347 | @"total": @((double)total), 348 | }); 349 | } 350 | } 351 | partialLoadBlock:nil 352 | completionBlock:^(NSError *error, UIImage *image) { 353 | if (image) { 354 | dispatch_async(dispatch_get_main_queue(), ^{ 355 | [weakSelf setImage:image]; 356 | }); 357 | if (_onPhotoViewerLoad) { 358 | _onPhotoViewerLoad(nil); 359 | } 360 | } else { 361 | if (_onPhotoViewerError) { 362 | _onPhotoViewerError(nil); 363 | } 364 | } 365 | if (_onPhotoViewerLoadEnd) { 366 | _onPhotoViewerLoadEnd(nil); 367 | } 368 | }]; 369 | }); 370 | } 371 | 372 | - (void)setLoadingIndicatorSrc:(NSString *)loadingIndicatorSrc { 373 | if (!loadingIndicatorSrc) { 374 | return; 375 | } 376 | if ([_loadingIndicatorSrc isEqualToString:loadingIndicatorSrc]) { 377 | return; 378 | } 379 | _loadingIndicatorSrc = loadingIndicatorSrc; 380 | NSURL *imageURL = [NSURL URLWithString:_loadingIndicatorSrc]; 381 | UIImage *image = RCTImageFromLocalAssetURL(imageURL); 382 | if (image) { 383 | [self setLoadingImage:image]; 384 | } 385 | } 386 | 387 | - (void)setImage:(UIImage *)image { 388 | _image = image; 389 | [self displayWithImage:_image]; 390 | } 391 | 392 | - (void)setLoadingImage:(UIImage *)loadingImage { 393 | _loadingImage = loadingImage; 394 | if (_loadingImageView) { 395 | [_loadingImageView setImage:_loadingImage]; 396 | } else { 397 | _loadingImageView = [[UIImageView alloc] initWithImage:_loadingImage]; 398 | _loadingImageView.center = self.center; 399 | _loadingImageView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin; 400 | _loadingImageView.backgroundColor = [UIColor clearColor]; 401 | [_tapView addSubview:_loadingImageView]; 402 | } 403 | } 404 | 405 | - (void)setScale:(NSInteger)scale { 406 | _scale = scale; 407 | [self setZoomScale:_scale]; 408 | } 409 | 410 | #pragma mark - Private 411 | 412 | - (void)initView { 413 | _minZoomScale = 1.0; 414 | _maxZoomScale = 5.0; 415 | 416 | // Setup 417 | self.backgroundColor = [UIColor clearColor]; 418 | self.delegate = self; 419 | self.decelerationRate = UIScrollViewDecelerationRateFast; 420 | self.showsVerticalScrollIndicator = YES; 421 | self.showsHorizontalScrollIndicator = YES; 422 | 423 | // Tap view for background 424 | _tapView = [[MWTapDetectingView alloc] initWithFrame:self.bounds]; 425 | _tapView.tapDelegate = self; 426 | _tapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 427 | _tapView.backgroundColor = [UIColor clearColor]; 428 | [self addSubview:_tapView]; 429 | 430 | // Image view 431 | _photoImageView = [[MWTapDetectingImageView alloc] initWithFrame:self.bounds]; 432 | _photoImageView.backgroundColor = [UIColor clearColor]; 433 | _photoImageView.contentMode = UIViewContentModeCenter; 434 | _photoImageView.tapDelegate = self; 435 | [self addSubview:_photoImageView]; 436 | } 437 | 438 | @end 439 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 00E356F31AD99517003FC87E /* exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* exampleTests.m */; }; 16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 23 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 25 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 26 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 27 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 28 | 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 29 | 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */; }; 30 | 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */; }; 31 | 2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */; }; 32 | 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */; }; 33 | 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; }; 34 | 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; }; 35 | 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; }; 36 | 2DCD954D1E0B4F2C00145EB5 /* exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* exampleTests.m */; }; 37 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 38 | 6D6A495278AF4303B338A780 /* libRNPhotoView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A6AAF614B921440F8C4455C1 /* libRNPhotoView.a */; }; 39 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 40 | /* End PBXBuildFile section */ 41 | 42 | /* Begin PBXContainerItemProxy section */ 43 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 44 | isa = PBXContainerItemProxy; 45 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 46 | proxyType = 2; 47 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 48 | remoteInfo = RCTActionSheet; 49 | }; 50 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 51 | isa = PBXContainerItemProxy; 52 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 53 | proxyType = 2; 54 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 55 | remoteInfo = RCTGeolocation; 56 | }; 57 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 58 | isa = PBXContainerItemProxy; 59 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 60 | proxyType = 2; 61 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 62 | remoteInfo = RCTImage; 63 | }; 64 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 65 | isa = PBXContainerItemProxy; 66 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 67 | proxyType = 2; 68 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 69 | remoteInfo = RCTNetwork; 70 | }; 71 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 72 | isa = PBXContainerItemProxy; 73 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 74 | proxyType = 2; 75 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 76 | remoteInfo = RCTVibration; 77 | }; 78 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 79 | isa = PBXContainerItemProxy; 80 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 81 | proxyType = 1; 82 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 83 | remoteInfo = example; 84 | }; 85 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 86 | isa = PBXContainerItemProxy; 87 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 88 | proxyType = 2; 89 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 90 | remoteInfo = RCTSettings; 91 | }; 92 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 93 | isa = PBXContainerItemProxy; 94 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 95 | proxyType = 2; 96 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 97 | remoteInfo = RCTWebSocket; 98 | }; 99 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 100 | isa = PBXContainerItemProxy; 101 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 102 | proxyType = 2; 103 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 104 | remoteInfo = React; 105 | }; 106 | 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = { 107 | isa = PBXContainerItemProxy; 108 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 109 | proxyType = 1; 110 | remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7; 111 | remoteInfo = "example-tvOS"; 112 | }; 113 | 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = { 114 | isa = PBXContainerItemProxy; 115 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 116 | proxyType = 2; 117 | remoteGlobalIDString = 2D2A283A1D9B042B00D4039D; 118 | remoteInfo = "RCTImage-tvOS"; 119 | }; 120 | 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */ = { 121 | isa = PBXContainerItemProxy; 122 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 123 | proxyType = 2; 124 | remoteGlobalIDString = 2D2A28471D9B043800D4039D; 125 | remoteInfo = "RCTLinking-tvOS"; 126 | }; 127 | 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 128 | isa = PBXContainerItemProxy; 129 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 130 | proxyType = 2; 131 | remoteGlobalIDString = 2D2A28541D9B044C00D4039D; 132 | remoteInfo = "RCTNetwork-tvOS"; 133 | }; 134 | 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 135 | isa = PBXContainerItemProxy; 136 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 137 | proxyType = 2; 138 | remoteGlobalIDString = 2D2A28611D9B046600D4039D; 139 | remoteInfo = "RCTSettings-tvOS"; 140 | }; 141 | 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = { 142 | isa = PBXContainerItemProxy; 143 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 144 | proxyType = 2; 145 | remoteGlobalIDString = 2D2A287B1D9B048500D4039D; 146 | remoteInfo = "RCTText-tvOS"; 147 | }; 148 | 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */ = { 149 | isa = PBXContainerItemProxy; 150 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 151 | proxyType = 2; 152 | remoteGlobalIDString = 2D2A28881D9B049200D4039D; 153 | remoteInfo = "RCTWebSocket-tvOS"; 154 | }; 155 | 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */ = { 156 | isa = PBXContainerItemProxy; 157 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 158 | proxyType = 2; 159 | remoteGlobalIDString = 2D2A28131D9B038B00D4039D; 160 | remoteInfo = "React-tvOS"; 161 | }; 162 | 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */ = { 163 | isa = PBXContainerItemProxy; 164 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 165 | proxyType = 2; 166 | remoteGlobalIDString = 3D3C059A1DE3340900C268FA; 167 | remoteInfo = yoga; 168 | }; 169 | 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */ = { 170 | isa = PBXContainerItemProxy; 171 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 172 | proxyType = 2; 173 | remoteGlobalIDString = 3D3C06751DE3340C00C268FA; 174 | remoteInfo = "yoga-tvOS"; 175 | }; 176 | 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */ = { 177 | isa = PBXContainerItemProxy; 178 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 179 | proxyType = 2; 180 | remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4; 181 | remoteInfo = cxxreact; 182 | }; 183 | 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 184 | isa = PBXContainerItemProxy; 185 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 186 | proxyType = 2; 187 | remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4; 188 | remoteInfo = "cxxreact-tvOS"; 189 | }; 190 | 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 191 | isa = PBXContainerItemProxy; 192 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 193 | proxyType = 2; 194 | remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4; 195 | remoteInfo = jschelpers; 196 | }; 197 | 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 198 | isa = PBXContainerItemProxy; 199 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 200 | proxyType = 2; 201 | remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4; 202 | remoteInfo = "jschelpers-tvOS"; 203 | }; 204 | 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 205 | isa = PBXContainerItemProxy; 206 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 207 | proxyType = 2; 208 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 209 | remoteInfo = RCTAnimation; 210 | }; 211 | 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 212 | isa = PBXContainerItemProxy; 213 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 214 | proxyType = 2; 215 | remoteGlobalIDString = 2D2A28201D9B03D100D4039D; 216 | remoteInfo = "RCTAnimation-tvOS"; 217 | }; 218 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 219 | isa = PBXContainerItemProxy; 220 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 221 | proxyType = 2; 222 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 223 | remoteInfo = RCTLinking; 224 | }; 225 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 226 | isa = PBXContainerItemProxy; 227 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 228 | proxyType = 2; 229 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 230 | remoteInfo = RCTText; 231 | }; 232 | B268E82A1F598DF0009BE326 /* PBXContainerItemProxy */ = { 233 | isa = PBXContainerItemProxy; 234 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 235 | proxyType = 2; 236 | remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7; 237 | remoteInfo = "third-party"; 238 | }; 239 | B268E82C1F598DF0009BE326 /* PBXContainerItemProxy */ = { 240 | isa = PBXContainerItemProxy; 241 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 242 | proxyType = 2; 243 | remoteGlobalIDString = 3D383D3C1EBD27B6005632C8; 244 | remoteInfo = "third-party-tvOS"; 245 | }; 246 | B268E82E1F598DF0009BE326 /* PBXContainerItemProxy */ = { 247 | isa = PBXContainerItemProxy; 248 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 249 | proxyType = 2; 250 | remoteGlobalIDString = 139D7E881E25C6D100323FB7; 251 | remoteInfo = "double-conversion"; 252 | }; 253 | B268E8301F598DF0009BE326 /* PBXContainerItemProxy */ = { 254 | isa = PBXContainerItemProxy; 255 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 256 | proxyType = 2; 257 | remoteGlobalIDString = 3D383D621EBD27B9005632C8; 258 | remoteInfo = "double-conversion-tvOS"; 259 | }; 260 | B268E8331F598DF0009BE326 /* PBXContainerItemProxy */ = { 261 | isa = PBXContainerItemProxy; 262 | containerPortal = 2C1F612316F9458C8E707963 /* RNPhotoView.xcodeproj */; 263 | proxyType = 2; 264 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 265 | remoteInfo = RNPhotoView; 266 | }; 267 | /* End PBXContainerItemProxy section */ 268 | 269 | /* Begin PBXFileReference section */ 270 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 271 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 272 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 273 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 274 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 275 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 276 | 00E356EE1AD99517003FC87E /* exampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = exampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 277 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 278 | 00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = ""; }; 279 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 280 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 281 | 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 282 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = ""; }; 283 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = ""; }; 284 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 285 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 286 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 287 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = ""; }; 288 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 289 | 2C1F612316F9458C8E707963 /* RNPhotoView.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNPhotoView.xcodeproj; path = "../node_modules/react-native-photo-view/ios/RNPhotoView.xcodeproj"; sourceTree = ""; }; 290 | 2D02E47B1E0B4A5D006451C7 /* example-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 291 | 2D02E4901E0B4A5D006451C7 /* example-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "example-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 292 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 293 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 294 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 295 | A6AAF614B921440F8C4455C1 /* libRNPhotoView.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNPhotoView.a; sourceTree = ""; }; 296 | /* End PBXFileReference section */ 297 | 298 | /* Begin PBXFrameworksBuildPhase section */ 299 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 300 | isa = PBXFrameworksBuildPhase; 301 | buildActionMask = 2147483647; 302 | files = ( 303 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | }; 307 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 308 | isa = PBXFrameworksBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 312 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 313 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 314 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 315 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 316 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 317 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 318 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 319 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 320 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 321 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 322 | 6D6A495278AF4303B338A780 /* libRNPhotoView.a in Frameworks */, 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | }; 326 | 2D02E4781E0B4A5D006451C7 /* Frameworks */ = { 327 | isa = PBXFrameworksBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */, 331 | 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */, 332 | 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */, 333 | 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */, 334 | 2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */, 335 | 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */, 336 | 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */, 337 | 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */, 338 | ); 339 | runOnlyForDeploymentPostprocessing = 0; 340 | }; 341 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = { 342 | isa = PBXFrameworksBuildPhase; 343 | buildActionMask = 2147483647; 344 | files = ( 345 | ); 346 | runOnlyForDeploymentPostprocessing = 0; 347 | }; 348 | /* End PBXFrameworksBuildPhase section */ 349 | 350 | /* Begin PBXGroup section */ 351 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 352 | isa = PBXGroup; 353 | children = ( 354 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 355 | ); 356 | name = Products; 357 | sourceTree = ""; 358 | }; 359 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 360 | isa = PBXGroup; 361 | children = ( 362 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 363 | ); 364 | name = Products; 365 | sourceTree = ""; 366 | }; 367 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 368 | isa = PBXGroup; 369 | children = ( 370 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 371 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */, 372 | ); 373 | name = Products; 374 | sourceTree = ""; 375 | }; 376 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 377 | isa = PBXGroup; 378 | children = ( 379 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 380 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */, 381 | ); 382 | name = Products; 383 | sourceTree = ""; 384 | }; 385 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 386 | isa = PBXGroup; 387 | children = ( 388 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 389 | ); 390 | name = Products; 391 | sourceTree = ""; 392 | }; 393 | 00E356EF1AD99517003FC87E /* exampleTests */ = { 394 | isa = PBXGroup; 395 | children = ( 396 | 00E356F21AD99517003FC87E /* exampleTests.m */, 397 | 00E356F01AD99517003FC87E /* Supporting Files */, 398 | ); 399 | path = exampleTests; 400 | sourceTree = ""; 401 | }; 402 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 403 | isa = PBXGroup; 404 | children = ( 405 | 00E356F11AD99517003FC87E /* Info.plist */, 406 | ); 407 | name = "Supporting Files"; 408 | sourceTree = ""; 409 | }; 410 | 139105B71AF99BAD00B5F7CC /* Products */ = { 411 | isa = PBXGroup; 412 | children = ( 413 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 414 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */, 415 | ); 416 | name = Products; 417 | sourceTree = ""; 418 | }; 419 | 139FDEE71B06529A00C62182 /* Products */ = { 420 | isa = PBXGroup; 421 | children = ( 422 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 423 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */, 424 | ); 425 | name = Products; 426 | sourceTree = ""; 427 | }; 428 | 13B07FAE1A68108700A75B9A /* example */ = { 429 | isa = PBXGroup; 430 | children = ( 431 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 432 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 433 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 434 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 435 | 13B07FB61A68108700A75B9A /* Info.plist */, 436 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 437 | 13B07FB71A68108700A75B9A /* main.m */, 438 | ); 439 | name = example; 440 | sourceTree = ""; 441 | }; 442 | 146834001AC3E56700842450 /* Products */ = { 443 | isa = PBXGroup; 444 | children = ( 445 | 146834041AC3E56700842450 /* libReact.a */, 446 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */, 447 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */, 448 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */, 449 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */, 450 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */, 451 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */, 452 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */, 453 | B268E82B1F598DF0009BE326 /* libthird-party.a */, 454 | B268E82D1F598DF0009BE326 /* libthird-party.a */, 455 | B268E82F1F598DF0009BE326 /* libdouble-conversion.a */, 456 | B268E8311F598DF0009BE326 /* libdouble-conversion.a */, 457 | ); 458 | name = Products; 459 | sourceTree = ""; 460 | }; 461 | 5E91572E1DD0AC6500FF2AA8 /* Products */ = { 462 | isa = PBXGroup; 463 | children = ( 464 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */, 465 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */, 466 | ); 467 | name = Products; 468 | sourceTree = ""; 469 | }; 470 | 78C398B11ACF4ADC00677621 /* Products */ = { 471 | isa = PBXGroup; 472 | children = ( 473 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 474 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */, 475 | ); 476 | name = Products; 477 | sourceTree = ""; 478 | }; 479 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 480 | isa = PBXGroup; 481 | children = ( 482 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 483 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 484 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 485 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 486 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 487 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 488 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 489 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 490 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 491 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 492 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 493 | 2C1F612316F9458C8E707963 /* RNPhotoView.xcodeproj */, 494 | ); 495 | name = Libraries; 496 | sourceTree = ""; 497 | }; 498 | 832341B11AAA6A8300B99B32 /* Products */ = { 499 | isa = PBXGroup; 500 | children = ( 501 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 502 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */, 503 | ); 504 | name = Products; 505 | sourceTree = ""; 506 | }; 507 | 83CBB9F61A601CBA00E9B192 = { 508 | isa = PBXGroup; 509 | children = ( 510 | 13B07FAE1A68108700A75B9A /* example */, 511 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 512 | 00E356EF1AD99517003FC87E /* exampleTests */, 513 | 83CBBA001A601CBA00E9B192 /* Products */, 514 | ); 515 | indentWidth = 2; 516 | sourceTree = ""; 517 | tabWidth = 2; 518 | }; 519 | 83CBBA001A601CBA00E9B192 /* Products */ = { 520 | isa = PBXGroup; 521 | children = ( 522 | 13B07F961A680F5B00A75B9A /* example.app */, 523 | 00E356EE1AD99517003FC87E /* exampleTests.xctest */, 524 | 2D02E47B1E0B4A5D006451C7 /* example-tvOS.app */, 525 | 2D02E4901E0B4A5D006451C7 /* example-tvOSTests.xctest */, 526 | ); 527 | name = Products; 528 | sourceTree = ""; 529 | }; 530 | B268E80B1F598DEF009BE326 /* Products */ = { 531 | isa = PBXGroup; 532 | children = ( 533 | B268E8341F598DF0009BE326 /* libRNPhotoView.a */, 534 | ); 535 | name = Products; 536 | sourceTree = ""; 537 | }; 538 | /* End PBXGroup section */ 539 | 540 | /* Begin PBXNativeTarget section */ 541 | 00E356ED1AD99517003FC87E /* exampleTests */ = { 542 | isa = PBXNativeTarget; 543 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */; 544 | buildPhases = ( 545 | 00E356EA1AD99517003FC87E /* Sources */, 546 | 00E356EB1AD99517003FC87E /* Frameworks */, 547 | 00E356EC1AD99517003FC87E /* Resources */, 548 | ); 549 | buildRules = ( 550 | ); 551 | dependencies = ( 552 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 553 | ); 554 | name = exampleTests; 555 | productName = exampleTests; 556 | productReference = 00E356EE1AD99517003FC87E /* exampleTests.xctest */; 557 | productType = "com.apple.product-type.bundle.unit-test"; 558 | }; 559 | 13B07F861A680F5B00A75B9A /* example */ = { 560 | isa = PBXNativeTarget; 561 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; 562 | buildPhases = ( 563 | 13B07F871A680F5B00A75B9A /* Sources */, 564 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 565 | 13B07F8E1A680F5B00A75B9A /* Resources */, 566 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 567 | ); 568 | buildRules = ( 569 | ); 570 | dependencies = ( 571 | ); 572 | name = example; 573 | productName = "Hello World"; 574 | productReference = 13B07F961A680F5B00A75B9A /* example.app */; 575 | productType = "com.apple.product-type.application"; 576 | }; 577 | 2D02E47A1E0B4A5D006451C7 /* example-tvOS */ = { 578 | isa = PBXNativeTarget; 579 | buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "example-tvOS" */; 580 | buildPhases = ( 581 | 2D02E4771E0B4A5D006451C7 /* Sources */, 582 | 2D02E4781E0B4A5D006451C7 /* Frameworks */, 583 | 2D02E4791E0B4A5D006451C7 /* Resources */, 584 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */, 585 | ); 586 | buildRules = ( 587 | ); 588 | dependencies = ( 589 | ); 590 | name = "example-tvOS"; 591 | productName = "example-tvOS"; 592 | productReference = 2D02E47B1E0B4A5D006451C7 /* example-tvOS.app */; 593 | productType = "com.apple.product-type.application"; 594 | }; 595 | 2D02E48F1E0B4A5D006451C7 /* example-tvOSTests */ = { 596 | isa = PBXNativeTarget; 597 | buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "example-tvOSTests" */; 598 | buildPhases = ( 599 | 2D02E48C1E0B4A5D006451C7 /* Sources */, 600 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */, 601 | 2D02E48E1E0B4A5D006451C7 /* Resources */, 602 | ); 603 | buildRules = ( 604 | ); 605 | dependencies = ( 606 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */, 607 | ); 608 | name = "example-tvOSTests"; 609 | productName = "example-tvOSTests"; 610 | productReference = 2D02E4901E0B4A5D006451C7 /* example-tvOSTests.xctest */; 611 | productType = "com.apple.product-type.bundle.unit-test"; 612 | }; 613 | /* End PBXNativeTarget section */ 614 | 615 | /* Begin PBXProject section */ 616 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 617 | isa = PBXProject; 618 | attributes = { 619 | LastUpgradeCheck = 610; 620 | ORGANIZATIONNAME = Facebook; 621 | TargetAttributes = { 622 | 00E356ED1AD99517003FC87E = { 623 | CreatedOnToolsVersion = 6.2; 624 | TestTargetID = 13B07F861A680F5B00A75B9A; 625 | }; 626 | 2D02E47A1E0B4A5D006451C7 = { 627 | CreatedOnToolsVersion = 8.2.1; 628 | ProvisioningStyle = Automatic; 629 | }; 630 | 2D02E48F1E0B4A5D006451C7 = { 631 | CreatedOnToolsVersion = 8.2.1; 632 | ProvisioningStyle = Automatic; 633 | TestTargetID = 2D02E47A1E0B4A5D006451C7; 634 | }; 635 | }; 636 | }; 637 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */; 638 | compatibilityVersion = "Xcode 3.2"; 639 | developmentRegion = English; 640 | hasScannedForEncodings = 0; 641 | knownRegions = ( 642 | en, 643 | Base, 644 | ); 645 | mainGroup = 83CBB9F61A601CBA00E9B192; 646 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 647 | projectDirPath = ""; 648 | projectReferences = ( 649 | { 650 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 651 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 652 | }, 653 | { 654 | ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */; 655 | ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 656 | }, 657 | { 658 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 659 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 660 | }, 661 | { 662 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 663 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 664 | }, 665 | { 666 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 667 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 668 | }, 669 | { 670 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 671 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 672 | }, 673 | { 674 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 675 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 676 | }, 677 | { 678 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 679 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 680 | }, 681 | { 682 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 683 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 684 | }, 685 | { 686 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 687 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 688 | }, 689 | { 690 | ProductGroup = 146834001AC3E56700842450 /* Products */; 691 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 692 | }, 693 | { 694 | ProductGroup = B268E80B1F598DEF009BE326 /* Products */; 695 | ProjectRef = 2C1F612316F9458C8E707963 /* RNPhotoView.xcodeproj */; 696 | }, 697 | ); 698 | projectRoot = ""; 699 | targets = ( 700 | 13B07F861A680F5B00A75B9A /* example */, 701 | 00E356ED1AD99517003FC87E /* exampleTests */, 702 | 2D02E47A1E0B4A5D006451C7 /* example-tvOS */, 703 | 2D02E48F1E0B4A5D006451C7 /* example-tvOSTests */, 704 | ); 705 | }; 706 | /* End PBXProject section */ 707 | 708 | /* Begin PBXReferenceProxy section */ 709 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 710 | isa = PBXReferenceProxy; 711 | fileType = archive.ar; 712 | path = libRCTActionSheet.a; 713 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 714 | sourceTree = BUILT_PRODUCTS_DIR; 715 | }; 716 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 717 | isa = PBXReferenceProxy; 718 | fileType = archive.ar; 719 | path = libRCTGeolocation.a; 720 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 721 | sourceTree = BUILT_PRODUCTS_DIR; 722 | }; 723 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 724 | isa = PBXReferenceProxy; 725 | fileType = archive.ar; 726 | path = libRCTImage.a; 727 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 728 | sourceTree = BUILT_PRODUCTS_DIR; 729 | }; 730 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 731 | isa = PBXReferenceProxy; 732 | fileType = archive.ar; 733 | path = libRCTNetwork.a; 734 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 735 | sourceTree = BUILT_PRODUCTS_DIR; 736 | }; 737 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 738 | isa = PBXReferenceProxy; 739 | fileType = archive.ar; 740 | path = libRCTVibration.a; 741 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 742 | sourceTree = BUILT_PRODUCTS_DIR; 743 | }; 744 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 745 | isa = PBXReferenceProxy; 746 | fileType = archive.ar; 747 | path = libRCTSettings.a; 748 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 749 | sourceTree = BUILT_PRODUCTS_DIR; 750 | }; 751 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 752 | isa = PBXReferenceProxy; 753 | fileType = archive.ar; 754 | path = libRCTWebSocket.a; 755 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 756 | sourceTree = BUILT_PRODUCTS_DIR; 757 | }; 758 | 146834041AC3E56700842450 /* libReact.a */ = { 759 | isa = PBXReferenceProxy; 760 | fileType = archive.ar; 761 | path = libReact.a; 762 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 763 | sourceTree = BUILT_PRODUCTS_DIR; 764 | }; 765 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = { 766 | isa = PBXReferenceProxy; 767 | fileType = archive.ar; 768 | path = "libRCTImage-tvOS.a"; 769 | remoteRef = 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */; 770 | sourceTree = BUILT_PRODUCTS_DIR; 771 | }; 772 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */ = { 773 | isa = PBXReferenceProxy; 774 | fileType = archive.ar; 775 | path = "libRCTLinking-tvOS.a"; 776 | remoteRef = 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */; 777 | sourceTree = BUILT_PRODUCTS_DIR; 778 | }; 779 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */ = { 780 | isa = PBXReferenceProxy; 781 | fileType = archive.ar; 782 | path = "libRCTNetwork-tvOS.a"; 783 | remoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */; 784 | sourceTree = BUILT_PRODUCTS_DIR; 785 | }; 786 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */ = { 787 | isa = PBXReferenceProxy; 788 | fileType = archive.ar; 789 | path = "libRCTSettings-tvOS.a"; 790 | remoteRef = 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */; 791 | sourceTree = BUILT_PRODUCTS_DIR; 792 | }; 793 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = { 794 | isa = PBXReferenceProxy; 795 | fileType = archive.ar; 796 | path = "libRCTText-tvOS.a"; 797 | remoteRef = 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */; 798 | sourceTree = BUILT_PRODUCTS_DIR; 799 | }; 800 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */ = { 801 | isa = PBXReferenceProxy; 802 | fileType = archive.ar; 803 | path = "libRCTWebSocket-tvOS.a"; 804 | remoteRef = 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */; 805 | sourceTree = BUILT_PRODUCTS_DIR; 806 | }; 807 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */ = { 808 | isa = PBXReferenceProxy; 809 | fileType = archive.ar; 810 | path = libReact.a; 811 | remoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */; 812 | sourceTree = BUILT_PRODUCTS_DIR; 813 | }; 814 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */ = { 815 | isa = PBXReferenceProxy; 816 | fileType = archive.ar; 817 | path = libyoga.a; 818 | remoteRef = 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */; 819 | sourceTree = BUILT_PRODUCTS_DIR; 820 | }; 821 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */ = { 822 | isa = PBXReferenceProxy; 823 | fileType = archive.ar; 824 | path = libyoga.a; 825 | remoteRef = 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */; 826 | sourceTree = BUILT_PRODUCTS_DIR; 827 | }; 828 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */ = { 829 | isa = PBXReferenceProxy; 830 | fileType = archive.ar; 831 | path = libcxxreact.a; 832 | remoteRef = 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */; 833 | sourceTree = BUILT_PRODUCTS_DIR; 834 | }; 835 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */ = { 836 | isa = PBXReferenceProxy; 837 | fileType = archive.ar; 838 | path = libcxxreact.a; 839 | remoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */; 840 | sourceTree = BUILT_PRODUCTS_DIR; 841 | }; 842 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = { 843 | isa = PBXReferenceProxy; 844 | fileType = archive.ar; 845 | path = libjschelpers.a; 846 | remoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */; 847 | sourceTree = BUILT_PRODUCTS_DIR; 848 | }; 849 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = { 850 | isa = PBXReferenceProxy; 851 | fileType = archive.ar; 852 | path = libjschelpers.a; 853 | remoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */; 854 | sourceTree = BUILT_PRODUCTS_DIR; 855 | }; 856 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 857 | isa = PBXReferenceProxy; 858 | fileType = archive.ar; 859 | path = libRCTAnimation.a; 860 | remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 861 | sourceTree = BUILT_PRODUCTS_DIR; 862 | }; 863 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 864 | isa = PBXReferenceProxy; 865 | fileType = archive.ar; 866 | path = libRCTAnimation.a; 867 | remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 868 | sourceTree = BUILT_PRODUCTS_DIR; 869 | }; 870 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 871 | isa = PBXReferenceProxy; 872 | fileType = archive.ar; 873 | path = libRCTLinking.a; 874 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 875 | sourceTree = BUILT_PRODUCTS_DIR; 876 | }; 877 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 878 | isa = PBXReferenceProxy; 879 | fileType = archive.ar; 880 | path = libRCTText.a; 881 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 882 | sourceTree = BUILT_PRODUCTS_DIR; 883 | }; 884 | B268E82B1F598DF0009BE326 /* libthird-party.a */ = { 885 | isa = PBXReferenceProxy; 886 | fileType = archive.ar; 887 | path = "libthird-party.a"; 888 | remoteRef = B268E82A1F598DF0009BE326 /* PBXContainerItemProxy */; 889 | sourceTree = BUILT_PRODUCTS_DIR; 890 | }; 891 | B268E82D1F598DF0009BE326 /* libthird-party.a */ = { 892 | isa = PBXReferenceProxy; 893 | fileType = archive.ar; 894 | path = "libthird-party.a"; 895 | remoteRef = B268E82C1F598DF0009BE326 /* PBXContainerItemProxy */; 896 | sourceTree = BUILT_PRODUCTS_DIR; 897 | }; 898 | B268E82F1F598DF0009BE326 /* libdouble-conversion.a */ = { 899 | isa = PBXReferenceProxy; 900 | fileType = archive.ar; 901 | path = "libdouble-conversion.a"; 902 | remoteRef = B268E82E1F598DF0009BE326 /* PBXContainerItemProxy */; 903 | sourceTree = BUILT_PRODUCTS_DIR; 904 | }; 905 | B268E8311F598DF0009BE326 /* libdouble-conversion.a */ = { 906 | isa = PBXReferenceProxy; 907 | fileType = archive.ar; 908 | path = "libdouble-conversion.a"; 909 | remoteRef = B268E8301F598DF0009BE326 /* PBXContainerItemProxy */; 910 | sourceTree = BUILT_PRODUCTS_DIR; 911 | }; 912 | B268E8341F598DF0009BE326 /* libRNPhotoView.a */ = { 913 | isa = PBXReferenceProxy; 914 | fileType = archive.ar; 915 | path = libRNPhotoView.a; 916 | remoteRef = B268E8331F598DF0009BE326 /* PBXContainerItemProxy */; 917 | sourceTree = BUILT_PRODUCTS_DIR; 918 | }; 919 | /* End PBXReferenceProxy section */ 920 | 921 | /* Begin PBXResourcesBuildPhase section */ 922 | 00E356EC1AD99517003FC87E /* Resources */ = { 923 | isa = PBXResourcesBuildPhase; 924 | buildActionMask = 2147483647; 925 | files = ( 926 | ); 927 | runOnlyForDeploymentPostprocessing = 0; 928 | }; 929 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 930 | isa = PBXResourcesBuildPhase; 931 | buildActionMask = 2147483647; 932 | files = ( 933 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 934 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 935 | ); 936 | runOnlyForDeploymentPostprocessing = 0; 937 | }; 938 | 2D02E4791E0B4A5D006451C7 /* Resources */ = { 939 | isa = PBXResourcesBuildPhase; 940 | buildActionMask = 2147483647; 941 | files = ( 942 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */, 943 | ); 944 | runOnlyForDeploymentPostprocessing = 0; 945 | }; 946 | 2D02E48E1E0B4A5D006451C7 /* Resources */ = { 947 | isa = PBXResourcesBuildPhase; 948 | buildActionMask = 2147483647; 949 | files = ( 950 | ); 951 | runOnlyForDeploymentPostprocessing = 0; 952 | }; 953 | /* End PBXResourcesBuildPhase section */ 954 | 955 | /* Begin PBXShellScriptBuildPhase section */ 956 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 957 | isa = PBXShellScriptBuildPhase; 958 | buildActionMask = 2147483647; 959 | files = ( 960 | ); 961 | inputPaths = ( 962 | ); 963 | name = "Bundle React Native code and images"; 964 | outputPaths = ( 965 | ); 966 | runOnlyForDeploymentPostprocessing = 0; 967 | shellPath = /bin/sh; 968 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 969 | }; 970 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { 971 | isa = PBXShellScriptBuildPhase; 972 | buildActionMask = 2147483647; 973 | files = ( 974 | ); 975 | inputPaths = ( 976 | ); 977 | name = "Bundle React Native Code And Images"; 978 | outputPaths = ( 979 | ); 980 | runOnlyForDeploymentPostprocessing = 0; 981 | shellPath = /bin/sh; 982 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 983 | }; 984 | /* End PBXShellScriptBuildPhase section */ 985 | 986 | /* Begin PBXSourcesBuildPhase section */ 987 | 00E356EA1AD99517003FC87E /* Sources */ = { 988 | isa = PBXSourcesBuildPhase; 989 | buildActionMask = 2147483647; 990 | files = ( 991 | 00E356F31AD99517003FC87E /* exampleTests.m in Sources */, 992 | ); 993 | runOnlyForDeploymentPostprocessing = 0; 994 | }; 995 | 13B07F871A680F5B00A75B9A /* Sources */ = { 996 | isa = PBXSourcesBuildPhase; 997 | buildActionMask = 2147483647; 998 | files = ( 999 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 1000 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 1001 | ); 1002 | runOnlyForDeploymentPostprocessing = 0; 1003 | }; 1004 | 2D02E4771E0B4A5D006451C7 /* Sources */ = { 1005 | isa = PBXSourcesBuildPhase; 1006 | buildActionMask = 2147483647; 1007 | files = ( 1008 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */, 1009 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */, 1010 | ); 1011 | runOnlyForDeploymentPostprocessing = 0; 1012 | }; 1013 | 2D02E48C1E0B4A5D006451C7 /* Sources */ = { 1014 | isa = PBXSourcesBuildPhase; 1015 | buildActionMask = 2147483647; 1016 | files = ( 1017 | 2DCD954D1E0B4F2C00145EB5 /* exampleTests.m in Sources */, 1018 | ); 1019 | runOnlyForDeploymentPostprocessing = 0; 1020 | }; 1021 | /* End PBXSourcesBuildPhase section */ 1022 | 1023 | /* Begin PBXTargetDependency section */ 1024 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 1025 | isa = PBXTargetDependency; 1026 | target = 13B07F861A680F5B00A75B9A /* example */; 1027 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 1028 | }; 1029 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = { 1030 | isa = PBXTargetDependency; 1031 | target = 2D02E47A1E0B4A5D006451C7 /* example-tvOS */; 1032 | targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */; 1033 | }; 1034 | /* End PBXTargetDependency section */ 1035 | 1036 | /* Begin PBXVariantGroup section */ 1037 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 1038 | isa = PBXVariantGroup; 1039 | children = ( 1040 | 13B07FB21A68108700A75B9A /* Base */, 1041 | ); 1042 | name = LaunchScreen.xib; 1043 | path = example; 1044 | sourceTree = ""; 1045 | }; 1046 | /* End PBXVariantGroup section */ 1047 | 1048 | /* Begin XCBuildConfiguration section */ 1049 | 00E356F61AD99517003FC87E /* Debug */ = { 1050 | isa = XCBuildConfiguration; 1051 | buildSettings = { 1052 | BUNDLE_LOADER = "$(TEST_HOST)"; 1053 | GCC_PREPROCESSOR_DEFINITIONS = ( 1054 | "DEBUG=1", 1055 | "$(inherited)", 1056 | ); 1057 | INFOPLIST_FILE = exampleTests/Info.plist; 1058 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1059 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1060 | LIBRARY_SEARCH_PATHS = ( 1061 | "$(inherited)", 1062 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 1063 | ); 1064 | OTHER_LDFLAGS = ( 1065 | "-ObjC", 1066 | "-lc++", 1067 | ); 1068 | PRODUCT_NAME = "$(TARGET_NAME)"; 1069 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/example"; 1070 | }; 1071 | name = Debug; 1072 | }; 1073 | 00E356F71AD99517003FC87E /* Release */ = { 1074 | isa = XCBuildConfiguration; 1075 | buildSettings = { 1076 | BUNDLE_LOADER = "$(TEST_HOST)"; 1077 | COPY_PHASE_STRIP = NO; 1078 | INFOPLIST_FILE = exampleTests/Info.plist; 1079 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1080 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1081 | LIBRARY_SEARCH_PATHS = ( 1082 | "$(inherited)", 1083 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 1084 | ); 1085 | OTHER_LDFLAGS = ( 1086 | "-ObjC", 1087 | "-lc++", 1088 | ); 1089 | PRODUCT_NAME = "$(TARGET_NAME)"; 1090 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/example"; 1091 | }; 1092 | name = Release; 1093 | }; 1094 | 13B07F941A680F5B00A75B9A /* Debug */ = { 1095 | isa = XCBuildConfiguration; 1096 | buildSettings = { 1097 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1098 | CURRENT_PROJECT_VERSION = 1; 1099 | DEAD_CODE_STRIPPING = NO; 1100 | INFOPLIST_FILE = example/Info.plist; 1101 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1102 | OTHER_LDFLAGS = ( 1103 | "$(inherited)", 1104 | "-ObjC", 1105 | "-lc++", 1106 | ); 1107 | PRODUCT_NAME = example; 1108 | VERSIONING_SYSTEM = "apple-generic"; 1109 | }; 1110 | name = Debug; 1111 | }; 1112 | 13B07F951A680F5B00A75B9A /* Release */ = { 1113 | isa = XCBuildConfiguration; 1114 | buildSettings = { 1115 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1116 | CURRENT_PROJECT_VERSION = 1; 1117 | INFOPLIST_FILE = example/Info.plist; 1118 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1119 | OTHER_LDFLAGS = ( 1120 | "$(inherited)", 1121 | "-ObjC", 1122 | "-lc++", 1123 | ); 1124 | PRODUCT_NAME = example; 1125 | VERSIONING_SYSTEM = "apple-generic"; 1126 | }; 1127 | name = Release; 1128 | }; 1129 | 2D02E4971E0B4A5E006451C7 /* Debug */ = { 1130 | isa = XCBuildConfiguration; 1131 | buildSettings = { 1132 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; 1133 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 1134 | CLANG_ANALYZER_NONNULL = YES; 1135 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1136 | CLANG_WARN_INFINITE_RECURSION = YES; 1137 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1138 | DEBUG_INFORMATION_FORMAT = dwarf; 1139 | ENABLE_TESTABILITY = YES; 1140 | GCC_NO_COMMON_BLOCKS = YES; 1141 | INFOPLIST_FILE = "example-tvOS/Info.plist"; 1142 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1143 | LIBRARY_SEARCH_PATHS = ( 1144 | "$(inherited)", 1145 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 1146 | ); 1147 | OTHER_LDFLAGS = ( 1148 | "-ObjC", 1149 | "-lc++", 1150 | ); 1151 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.example-tvOS"; 1152 | PRODUCT_NAME = "$(TARGET_NAME)"; 1153 | SDKROOT = appletvos; 1154 | TARGETED_DEVICE_FAMILY = 3; 1155 | TVOS_DEPLOYMENT_TARGET = 9.2; 1156 | }; 1157 | name = Debug; 1158 | }; 1159 | 2D02E4981E0B4A5E006451C7 /* Release */ = { 1160 | isa = XCBuildConfiguration; 1161 | buildSettings = { 1162 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; 1163 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 1164 | CLANG_ANALYZER_NONNULL = YES; 1165 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1166 | CLANG_WARN_INFINITE_RECURSION = YES; 1167 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1168 | COPY_PHASE_STRIP = NO; 1169 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1170 | GCC_NO_COMMON_BLOCKS = YES; 1171 | INFOPLIST_FILE = "example-tvOS/Info.plist"; 1172 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1173 | LIBRARY_SEARCH_PATHS = ( 1174 | "$(inherited)", 1175 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 1176 | ); 1177 | OTHER_LDFLAGS = ( 1178 | "-ObjC", 1179 | "-lc++", 1180 | ); 1181 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.example-tvOS"; 1182 | PRODUCT_NAME = "$(TARGET_NAME)"; 1183 | SDKROOT = appletvos; 1184 | TARGETED_DEVICE_FAMILY = 3; 1185 | TVOS_DEPLOYMENT_TARGET = 9.2; 1186 | }; 1187 | name = Release; 1188 | }; 1189 | 2D02E4991E0B4A5E006451C7 /* Debug */ = { 1190 | isa = XCBuildConfiguration; 1191 | buildSettings = { 1192 | BUNDLE_LOADER = "$(TEST_HOST)"; 1193 | CLANG_ANALYZER_NONNULL = YES; 1194 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1195 | CLANG_WARN_INFINITE_RECURSION = YES; 1196 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1197 | DEBUG_INFORMATION_FORMAT = dwarf; 1198 | ENABLE_TESTABILITY = YES; 1199 | GCC_NO_COMMON_BLOCKS = YES; 1200 | INFOPLIST_FILE = "example-tvOSTests/Info.plist"; 1201 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1202 | LIBRARY_SEARCH_PATHS = ( 1203 | "$(inherited)", 1204 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 1205 | ); 1206 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.example-tvOSTests"; 1207 | PRODUCT_NAME = "$(TARGET_NAME)"; 1208 | SDKROOT = appletvos; 1209 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example-tvOS.app/example-tvOS"; 1210 | TVOS_DEPLOYMENT_TARGET = 10.1; 1211 | }; 1212 | name = Debug; 1213 | }; 1214 | 2D02E49A1E0B4A5E006451C7 /* Release */ = { 1215 | isa = XCBuildConfiguration; 1216 | buildSettings = { 1217 | BUNDLE_LOADER = "$(TEST_HOST)"; 1218 | CLANG_ANALYZER_NONNULL = YES; 1219 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1220 | CLANG_WARN_INFINITE_RECURSION = YES; 1221 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1222 | COPY_PHASE_STRIP = NO; 1223 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1224 | GCC_NO_COMMON_BLOCKS = YES; 1225 | INFOPLIST_FILE = "example-tvOSTests/Info.plist"; 1226 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1227 | LIBRARY_SEARCH_PATHS = ( 1228 | "$(inherited)", 1229 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 1230 | ); 1231 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.example-tvOSTests"; 1232 | PRODUCT_NAME = "$(TARGET_NAME)"; 1233 | SDKROOT = appletvos; 1234 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example-tvOS.app/example-tvOS"; 1235 | TVOS_DEPLOYMENT_TARGET = 10.1; 1236 | }; 1237 | name = Release; 1238 | }; 1239 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 1240 | isa = XCBuildConfiguration; 1241 | buildSettings = { 1242 | ALWAYS_SEARCH_USER_PATHS = NO; 1243 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 1244 | CLANG_CXX_LIBRARY = "libc++"; 1245 | CLANG_ENABLE_MODULES = YES; 1246 | CLANG_ENABLE_OBJC_ARC = YES; 1247 | CLANG_WARN_BOOL_CONVERSION = YES; 1248 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1249 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1250 | CLANG_WARN_EMPTY_BODY = YES; 1251 | CLANG_WARN_ENUM_CONVERSION = YES; 1252 | CLANG_WARN_INT_CONVERSION = YES; 1253 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1254 | CLANG_WARN_UNREACHABLE_CODE = YES; 1255 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1256 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 1257 | COPY_PHASE_STRIP = NO; 1258 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1259 | GCC_C_LANGUAGE_STANDARD = gnu99; 1260 | GCC_DYNAMIC_NO_PIC = NO; 1261 | GCC_OPTIMIZATION_LEVEL = 0; 1262 | GCC_PREPROCESSOR_DEFINITIONS = ( 1263 | "DEBUG=1", 1264 | "$(inherited)", 1265 | ); 1266 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 1267 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1268 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1269 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1270 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1271 | GCC_WARN_UNUSED_FUNCTION = YES; 1272 | GCC_WARN_UNUSED_VARIABLE = YES; 1273 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1274 | MTL_ENABLE_DEBUG_INFO = YES; 1275 | ONLY_ACTIVE_ARCH = YES; 1276 | SDKROOT = iphoneos; 1277 | }; 1278 | name = Debug; 1279 | }; 1280 | 83CBBA211A601CBA00E9B192 /* Release */ = { 1281 | isa = XCBuildConfiguration; 1282 | buildSettings = { 1283 | ALWAYS_SEARCH_USER_PATHS = NO; 1284 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 1285 | CLANG_CXX_LIBRARY = "libc++"; 1286 | CLANG_ENABLE_MODULES = YES; 1287 | CLANG_ENABLE_OBJC_ARC = YES; 1288 | CLANG_WARN_BOOL_CONVERSION = YES; 1289 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1291 | CLANG_WARN_EMPTY_BODY = YES; 1292 | CLANG_WARN_ENUM_CONVERSION = YES; 1293 | CLANG_WARN_INT_CONVERSION = YES; 1294 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1295 | CLANG_WARN_UNREACHABLE_CODE = YES; 1296 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1297 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 1298 | COPY_PHASE_STRIP = YES; 1299 | ENABLE_NS_ASSERTIONS = NO; 1300 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1301 | GCC_C_LANGUAGE_STANDARD = gnu99; 1302 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1303 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1304 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1305 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1306 | GCC_WARN_UNUSED_FUNCTION = YES; 1307 | GCC_WARN_UNUSED_VARIABLE = YES; 1308 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1309 | MTL_ENABLE_DEBUG_INFO = NO; 1310 | SDKROOT = iphoneos; 1311 | VALIDATE_PRODUCT = YES; 1312 | }; 1313 | name = Release; 1314 | }; 1315 | /* End XCBuildConfiguration section */ 1316 | 1317 | /* Begin XCConfigurationList section */ 1318 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */ = { 1319 | isa = XCConfigurationList; 1320 | buildConfigurations = ( 1321 | 00E356F61AD99517003FC87E /* Debug */, 1322 | 00E356F71AD99517003FC87E /* Release */, 1323 | ); 1324 | defaultConfigurationIsVisible = 0; 1325 | defaultConfigurationName = Release; 1326 | }; 1327 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = { 1328 | isa = XCConfigurationList; 1329 | buildConfigurations = ( 1330 | 13B07F941A680F5B00A75B9A /* Debug */, 1331 | 13B07F951A680F5B00A75B9A /* Release */, 1332 | ); 1333 | defaultConfigurationIsVisible = 0; 1334 | defaultConfigurationName = Release; 1335 | }; 1336 | 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "example-tvOS" */ = { 1337 | isa = XCConfigurationList; 1338 | buildConfigurations = ( 1339 | 2D02E4971E0B4A5E006451C7 /* Debug */, 1340 | 2D02E4981E0B4A5E006451C7 /* Release */, 1341 | ); 1342 | defaultConfigurationIsVisible = 0; 1343 | defaultConfigurationName = Release; 1344 | }; 1345 | 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "example-tvOSTests" */ = { 1346 | isa = XCConfigurationList; 1347 | buildConfigurations = ( 1348 | 2D02E4991E0B4A5E006451C7 /* Debug */, 1349 | 2D02E49A1E0B4A5E006451C7 /* Release */, 1350 | ); 1351 | defaultConfigurationIsVisible = 0; 1352 | defaultConfigurationName = Release; 1353 | }; 1354 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = { 1355 | isa = XCConfigurationList; 1356 | buildConfigurations = ( 1357 | 83CBBA201A601CBA00E9B192 /* Debug */, 1358 | 83CBBA211A601CBA00E9B192 /* Release */, 1359 | ); 1360 | defaultConfigurationIsVisible = 0; 1361 | defaultConfigurationName = Release; 1362 | }; 1363 | /* End XCConfigurationList section */ 1364 | }; 1365 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 1366 | } 1367 | --------------------------------------------------------------------------------