This is still very basic since I am quite new to React. There is plenty of room for improvment by adding additional react bindings for props and callbacks.
Install the npm package react-native-image-zoom
. Inside your React Native project, run (example):
npm install --save react-native-image-zoom
In android/settings.gradle
, remove the line include ':app'
and add the following lines
include :react-native-image-zoom'
project(':react-native-image-zoom').projectDir = file('../node_modules/react-native-image-zoom/android')
NOTE : If you have included other libraries in your project, the include
line will contain the other dependencies too.
In android/app/build.gradle
, add a dependency to ':react-native-image-zoom'
dependencies {
compile project(':react-native-image-zoom')
}
Next, you need to change the MainActivity
of your app to register ReactNativeDialogsPackage
:
import com.image.zoom.ReactImageZoom; // add this import
public class MainActivity extends ReactActivity {
//...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ReactImageZoom() // add this manager
);
}