{"_id":"@2hats/react-native-photo-view","_rev":"2-9306d34d408cbba79f9994ceb66a30c1","name":"@2hats/react-native-photo-view","description":"Displaying photos with pinch-to-zoom","dist-tags":{"latest":"1.4.0"},"versions":{"1.3.0":{"name":"@2hats/react-native-photo-view","version":"1.3.0","description":"Displaying photos with pinch-to-zoom","main":"index.js","author":{"name":"Alexander Pantyukhov","email":"alwxndr@gmail.com"},"license":"MIT","keywords":["react-native","react-component","ios","android","gallery","lightbox","pinch","pinch-to-zoom","mobile"],"homepage":"https://github.com/alwx/react-native-photo-view","bugs":{"url":"https://github.com/alwx/react-native-photo-view/issues"},"repository":{"type":"git","url":"git://github.com/alwx/react-native-photo-view.git"},"gitHead":"da93ef42697147321bc0d491b27b55ce5a2fa418","_id":"@2hats/react-native-photo-view@1.3.0","_npmVersion":"5.3.0","_nodeVersion":"7.5.0","_npmUser":{"name":"2hats","email":"piaojingtai@gmail.com"},"dist":{"integrity":"sha512-moYikbiMaikjA8DGxr25A5QL21eok9eTkS0I4jSM28beqSW5F9Ar9GD+AWbRoYt2XpVvYA9dQpxctOZqmOxZpQ==","shasum":"4fbb4f06f60ef2287cf9782c350229d6432a79ad","tarball":"https://registry.npmjs.org/@2hats/react-native-photo-view/-/react-native-photo-view-1.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDi0wwtTOTTW8VMbIVAZLjiijiiiUSqdlPCckhfawcsRgIganNWtdP95dHCWTjXfQ365FYObSbMT9lme6D7uwiHUGQ="}]},"maintainers":[{"name":"2hats","email":"piaojingtai@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-photo-view-1.3.0.tgz_1500691827568_0.4429401750676334"}},"1.4.0":{"name":"@2hats/react-native-photo-view","version":"1.4.0","description":"Displaying photos with pinch-to-zoom","main":"index.js","author":{"name":"Alexander Pantyukhov","email":"alwxndr@gmail.com"},"license":"MIT","keywords":["react-native","react-component","ios","android","gallery","lightbox","pinch","pinch-to-zoom","mobile"],"homepage":"https://github.com/alwx/react-native-photo-view","bugs":{"url":"https://github.com/alwx/react-native-photo-view/issues"},"repository":{"type":"git","url":"git://github.com/alwx/react-native-photo-view.git"},"gitHead":"2e8503a6c78c10c1e230138b10d24e66a49d7720","_id":"@2hats/react-native-photo-view@1.4.0","_npmVersion":"5.3.0","_nodeVersion":"7.5.0","_npmUser":{"name":"2hats","email":"piaojingtai@gmail.com"},"dist":{"integrity":"sha512-zk3sFLRW4kn9i4vQc4iVWug84NtAcRbzOdvEQuT3NFVZIKzTlV0NXwG3oSZBmL7WRtG6Qvxdd2ZFY8OPE65sDg==","shasum":"0a4f4c720782befced533b15fbb80294dc816a01","tarball":"https://registry.npmjs.org/@2hats/react-native-photo-view/-/react-native-photo-view-1.4.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHiTmvHaMfoQQzjUMS80C8b//IXkUwleuBTh8TdI5CQrAiA+2lH041nDvQVs4w0Y+Z6blHv0buWbMo3I/KeBhV9O/g=="}]},"maintainers":[{"name":"2hats","email":"piaojingtai@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-photo-view-1.4.0.tgz_1502929626953_0.7338698171079159"}}},"readme":"# react-native-photo-view\n\nProvides custom Image view for React Native that allows to perform\npinch-to-zoom on images. Works on both iOS and Android.\n\nThis component uses [PhotoDraweeView](https://github.com/ongakuer/PhotoDraweeView) for Android and [MWPhotobrowser](https://github.com/mwaterfall/MWPhotoBrowser) on iOS.\n\n## Usage\n\n```javascript\nimport PhotoView from 'react-native-photo-view';\n```\n\nBasics:\n```javascript\n<PhotoView\n  source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}\n  minimumZoomScale={0.5}\n  maximumZoomScale={3}\n  androidScaleType=\"center\"\n  onLoad={() => console.log(\"Image loaded!\")}\n  style={{width: 300, height: 300}} />\n```\n\n## Properties\n\n| Property | Type | Description |\n|-----------------|----------|--------------------------------------------------------------|\n| source | Object | same as source for other React images |\n| loadingIndicatorSource | Object | source for loading indicator |\n| fadeDuration | int | duration of image fade (in ms) |\n| minimumZoomScale | float | The minimum allowed zoom scale. The default value is 1.0 |\n| maximumZoomScale | float | The maximum allowed zoom scale. The default value is 3.0 |\n| showsHorizontalScrollIndicator | bool | **iOS only**: When true, shows a horizontal scroll indicator. The default value is true. |\n| showsVerticalScrollIndicator | bool | **iOS only**: When true, shows a vertical scroll indicator. The default value is true. |\n| scale | float | Set zoom scale programmatically |\nandroidZoomTransitionDuration | int | **Android only**: Double-tap zoom transition duration |\n| androidScaleType | String | **Android only**: One of the default *Android* scale types: \"center\", \"centerCrop\", \"centerInside\", \"fitCenter\", \"fitStart\", \"fitEnd\", \"fitXY\" |\n| onLoadStart | func | Callback function |\n| onLoad | func | Callback function |\n| onLoadEnd | func | Callback function |\n| onTap | func | Callback function (called on image tap) |\n| onViewTap | func | Callback function (called on tap outside of image) |\n| onScale | func | Callback function |\n\n## Compared to [react-native-image-zoom](https://github.com/Anthonyzou/react-native-image-zoom)\n\nreact-native-image-zoom functionality is similar, but there are several major differencies:\n\n* PhotoView is based on PhotoDraweeView which is the \"PhotoView For Fresco\". It works better, it supports several\nimportant callbacks out-of-box and it is, actually, recommended by Chris Banes, because his\n[PhotoView](https://github.com/chrisbanes/PhotoView) (base for react-native-image-zoom) doesn't completely\nsupport Facebook Fresco;\n* PhotoView has more options like fadeDuration and minimumZoomScale/maximumZoomScale and more important callbacks;\n* PhotoView is written in the same manner as default React Image, and it supports most of the\nfeatures Image has (the goal is to be fully compaitable with Image and support absolutely everything);\n* It is possible to use PhotoView as a container (currently iOS only)!\n\n## Automatic installation\n\nJust two simple steps:\n```\nnpm install --save react-native-photo-view\n```\n```\nrnpm link react-native-photo-view\n```\n\n## Manual installation\n\n1. Add these lines to `android/settings.gradle`\n```\ninclude ':react-native-photo-view'\nproject(':react-native-photo-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-photo-view/android')\n```\n\n2. Add one more dependency to `android/app/build.gradle`\n```\ndependencies {\n    compile project(':react-native-photo-view')\n}\n```\n\n3. Add it to your `MainActivity.java` for RN < 0.29 and to your `MainApplication.java` for RN >=0.29\n\nTo register `PhotoViewPackage`, you need to change the `MainActivity` or `MainApplication` depending on React Native version of your app:\n```java\nimport com.reactnative.photoview.PhotoViewPackage;\n\n// ...\n\npublic class MainActivity extends ReactActivity {\n    // ...\n\n    @Override\n    protected List<ReactPackage> getPackages() {\n      return Arrays.<ReactPackage>asList(\n          new MainReactPackage(),\n          new PhotoViewPackage() // add this manager\n      );\n    }\n\n    // ...\n}\n```\n","maintainers":[{"name":"2hats","email":"piaojingtai@gmail.com"}],"time":{"modified":"2022-04-04T10:42:18.569Z","created":"2017-07-22T02:50:27.730Z","1.3.0":"2017-07-22T02:50:27.730Z","1.4.0":"2017-08-17T00:27:07.415Z"},"homepage":"https://github.com/alwx/react-native-photo-view","keywords":["react-native","react-component","ios","android","gallery","lightbox","pinch","pinch-to-zoom","mobile"],"repository":{"type":"git","url":"git://github.com/alwx/react-native-photo-view.git"},"author":{"name":"Alexander Pantyukhov","email":"alwxndr@gmail.com"},"bugs":{"url":"https://github.com/alwx/react-native-photo-view/issues"},"license":"MIT","readmeFilename":"README.md"}