Giter Site home page Giter Site logo

nullllun / react-native-zoom-image Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tinysymphony/react-native-zoom-image

0.0 3.0 0.0 5.89 MB

Image Viewer Component For React Native (like twitter)

License: MIT License

JavaScript 67.40% Python 7.25% Java 5.80% Objective-C 19.55%

react-native-zoom-image's Introduction

react-native-zoom-image

ZoomImage component for React Native Application (ios / android)

Only works with https network images [With the limitation of the current react-native, we can't get original size of required images. This component just zooms them with given size (provided by imgStyle prop)]

If you need to support http network images, modify info.plist please :)

Examples

Usage

install from npm

npm install --save react-native-zoom-image

import in project

import ZoomImage from 'react-native-zoom-image';
import {Easing} from 'react-native'; // import Easing if you want to customize easing function
let styles = {
  img: {} // custom styles of original image component
};
// in render function
<ZoomImage
  source={{uri: 'https://ooo.0o0.ooo/2017/03/31/58de0e9b287f6.jpg'}}
  imgStyle={{width: 250, height: 230}}
  style={styles.img}
  duration={200}
  enableScaling={false}
  easingFunc={Easing.ease}
/>

Properties

Prop Type Default Description
disabled bool false Whether to disable the component or not.
startCapture bool false Whether to capture start touch event or not.
moveCapture bool false Whether to capture move event or not.
responderNegotiate function - Use custom conditions to enable or disable gesture over image modal.
easingFunc function Easing.linear The easing function of animation.
showDuration number 100 The duration of showing the image modal.
closeDuration number 140 The duration of closing the image modal.
rebounceDuration number 800 The total duration of resetting the position of image. The actual duration changes by the displacement of the image in Y-axis. If the displacement equals to the height of screen, the duration shall be 800ms.
enableScaling bool false Whether to scale the image when it is polled.

Instance methods

Method Params Description
openModal - Open image modal
closeModal - Close image modal.

LICENSE MIT

react-native-zoom-image's People

Contributors

tinysymphony avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.