
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
react-native-pinch-zoom-layout
Advanced tools
$ npm install react-native-pinch-zoom-layout --save
Or
$ yarn add react-native-pinch-zoom-layout
$ react-native link react-native-pinch-zoom-layout
No action required
android/app/src/main/java/[...]/MainActivity.java
import info.moonjava.RNPinchZoomLayoutPackage;
to the imports at the top of the filenew RNPinchZoomLayoutPackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-pinch-zoom-layout'
project(':react-native-pinch-zoom-layout').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pinch-zoom-layout/android')
android/app/build.gradle
:
implementation project(':react-native-pinch-zoom-layout')
react-native-pinch-zoom-layout
uses react-native-gesture-handler! Link it before using
import React,{Component} from 'react';
import PinchZoomLayout from 'react-native-pinch-zoom-layout';
import {
Image
} from 'react-native';
export default class ImageViewer extends Component {
pinZoomLayoutRef=React.createRef();
render() {
return(<PinchZoomLayout
style={{flex:1}}
ref={this.pinZoomLayoutRef}
onZoom={this.onZoom}
onTap={this.onTap}
>
<Image
style={{width:56,height:56}}
source={{
uri:'https://facebook.github.io/react-native/img/header_logo.png'
}}
/>
</PinchZoomLayout>)
}
onZoom=event=>{
const {
containerWidth,
containerHeight,
contentWidth,
contentHeight,
zoomScale
}=event;
}
onTap=()=>{
}
}
Indicates whether the layout allows zoom.
Indicates whether the layout can pan when the zoomed content is bigger than the container.
Animation duration of zoom.
The minimum zoom level.
The maximum zoom level.
Callback function that is called when the view is zoomed. The event params is
const {
containerWidth,
containerHeight,
contentWidth,
contentHeight,
zoomScale
} = event;
Callback function that is called when the view is taped
zoom({zoomScale, animated})
Zoom the content view to specific value.
Example:
this.pinZoomLayoutRef.current.zoom({zoomScale:2.5, animated:true}); // Zoom content view to 2.5 with animation
FAQs
Pinch to zoom and pan content view
The npm package react-native-pinch-zoom-layout receives a total of 4 weekly downloads. As such, react-native-pinch-zoom-layout popularity was classified as not popular.
We found that react-native-pinch-zoom-layout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.