diff --git a/Example/android/app/src/main/java/com/photobrowserexample/MainActivity.java b/Example/android/app/src/main/java/com/photobrowserexample/MainActivity.java index b8923f9..f83bf3b 100644 --- a/Example/android/app/src/main/java/com/photobrowserexample/MainActivity.java +++ b/Example/android/app/src/main/java/com/photobrowserexample/MainActivity.java @@ -22,7 +22,7 @@ protected String getMainComponentName() { * Returns whether dev mode should be enabled. * This enables e.g. the dev menu. */ - @Override + protected boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @@ -31,7 +31,7 @@ protected boolean getUseDeveloperSupport() { * A list of packages used by the app. If the app uses additional views * or modules besides the default ones, add more packages here. */ - @Override + protected List getPackages() { return Arrays.asList( new MainReactPackage() diff --git a/README.md b/README.md index 01fabbe..fb86746 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,78 @@ A full screen image gallery with captions, selections and grid view support for The component has both iOS and Android support. +### Neogrowth Contribution +Neogrowth bring the support for zoom in and zoom out of the image and some minor bug fixes are taken care. For which the following is the dependency. + +[react-native-photo-view](https://github.com/alwx/react-native-photo-view/) + + + ![](screenshots/photo-browser.gif) ![](screenshots/screenshot-1.png) ![](screenshots/screenshot-2.png) -### Installation -```npm install react-native-photo-browser --save``` +### Installation +```npm install https://github.com/NeoGrowth-Credit-Pvt-Limited/react-native-photo-browser.git --save``` + +#### android/settings.gradle +Add the following line + + include ':react-native-photo-view' + project(':react-native-photo-view').projectDir = file('../node_modules/react-native-photo-view/android') + +#### android/build.gradle +add `compile project` in dependencies + + dependencies { + . + . + compile project(':react-native-photo-view') + } + +#### android/app/build.gradle + allprojects { + repositories { + mavenLocal() + jcenter() + maven { url "https://jitpack.io" } // <-- Add this + maven { + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + url "$rootDir/../node_modules/react-native/android" + } + } + } + +#### MainApplication.java + + import com.reactnative.photoview.PhotoViewPackage; // add this import + public class MainApplication extends Application implements ReactApplication { + + private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { + @Override + protected boolean getUseDeveloperSupport() { + return BuildConfig.DEBUG; + } + + @Override + protected List getPackages() { + return Arrays.asList( + new MainReactPackage(), + new RNSimpleAlertDialogPackage(), + . + . + . + new PhotoViewPackage() // add this manager + ); + } + }; + + @Override + public ReactNativeHost getReactNativeHost() { + return mReactNativeHost; + } + } ### Properties @@ -46,7 +111,7 @@ const media = { #### Android -Built-in [ProgressBarAndroid](https://facebook.github.io/react-native/docs/progressbarandroid.html) component is used for Android. Any additional configuration is not needed. +Built-in [ActivityIndicator](https://facebook.github.io/react-native/docs/activityindicator.html) component is used for Android. Any additional configuration is not needed. [ProgressBarAndroid](https://facebook.github.io/react-native/docs/progressbarandroid.html) is deprecated now. #### iOS @@ -62,7 +127,7 @@ See [PhotoBrowserExample.js](Example/PhotoBrowserExample.js) file. Follow those steps to run the example: -1. Clone the repo `git clone https://github.com/halilb/react-native-photo-browser && cd react-native-photo-browser/Example` +1. Clone the repo `git clone https://github.com/NeoGrowth-Credit-Pvt-Limited/react-native-photo-browser/Example` 2. Install dependencies `npm install` 3. Follow [official instructions](https://facebook.github.io/react-native/docs/getting-started.html) to run the example project in a simulator or device. diff --git a/lib/media/Photo.js b/lib/media/Photo.js index 5831e10..7f1a0e7 100644 --- a/lib/media/Photo.js +++ b/lib/media/Photo.js @@ -1,15 +1,16 @@ import React, { PropTypes, Component } from 'react'; import { Dimensions, - Image, StyleSheet, View, TouchableWithoutFeedback, - ProgressBarAndroid, + ActivityIndicator, Platform, + Image } from 'react-native'; import * as Progress from 'react-native-progress'; +import PhotoView from 'react-native-photo-view'; export default class Photo extends Component { @@ -150,7 +151,7 @@ export default class Photo extends Component { } if (Platform.OS === 'android') { - return ; + return ; } const ProgressElement = useCircleProgress ? Progress.Circle : Progress.Bar; @@ -239,15 +240,17 @@ export default class Photo extends Component { return ( {error ? this._renderErrorIcon() : this._renderProgressIndicator()} - + {this._renderSelectionButton()} ); diff --git a/package.json b/package.json index f145205..9f4c79f 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "author": "Halil Bilir ", "homepage": "https://github.com/halilb/react-native-photo-browser#readme", "dependencies": { - "react-native-progress": "^3.0.0" + "react-native-progress": "^3.0.0", + "react-native-photo-view": "^1.2.0" } }