Skip to content
This repository was archived by the owner on Sep 28, 2021. It is now read-only.

Commit 2f0e4e2

Browse files
committed
support doubleClickInterval
1 parent bcc2c51 commit 2f0e4e2

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export default class App extends React.Component {
8484
| onClick | function<br><br>`(onCancel?: function) => void` | no | Onclick | `(onCancel) => {onCancel()}` |
8585
| onDoubleClick | function<br><br>`(onCancel?: function) => void` | no | OnDoubleClick | `(onCancel) => {onCancel()}` |
8686
| onSave | function<br><br>`(url: string) => void` | no | The picture is saved to the local method, if you write this method will not call the system default method for Android does not support saveToCameraRoll remote picture, you can call this callback in Android call native interface | |
87-
| renderHeader | function<br><br>`(currentIndex?: number) => React.ReactElement<any>` | no | Custom header | `() => null` |
88-
| renderFooter | function<br><br>`(currentIndex?: number) => React.ReactElement<any>` | no | Custom footer | `() => null` |
87+
| renderHeader | function<br><br>`(currentIndex?: number) => React.ReactElement<any>` | no | Custom header | `() => null` |
88+
| renderFooter | function<br><br>`(currentIndex?: number) => React.ReactElement<any>` | no | Custom footer | `() => null` |
8989
| renderIndicator | function<br><br>`(currentIndex?: number, allSize?) => React.ReactElement<any>`: number | no | Custom indicator | `(currentIndex, allSize) => currentIndex + "/" + allSize` |
9090
| renderImage | function<br><br>`(props: any) => React.ReactElement<any>` | no | Custom image component | `(props) => <Image {...props} /> |
9191
| renderArrowLeft | function<br><br>`() => React.ReactElement<any>` | no | Custom left arrow | `() => null` |
@@ -94,6 +94,7 @@ export default class App extends React.Component {
9494
| footerContainerStyle | object<br><br>`{someStyle: someValue}` | no | custom style props for container that will be holding your footer that you pass | `bottom: 0, position: "absolute", zIndex: 9999` |
9595
| backgroundColor | string<br><br>`white` | no | Component background color | `black` |
9696
| enableSwipeDown | boolean | no | Enable swipe down to close image viewer. When swipe down, will trigger onCancel. | false |
97+
| doubleClickInterval | number | no | Double click interval. | |
9798

9899
## Development pattern
99100

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-image-zoom-viewer",
3-
"version": "2.2.17",
3+
"version": "2.2.18",
44
"description": "react native image viewer,大图浏览",
55
"main": "built/index.js",
66
"types": "src/index.ts",

src/image-viewer.component.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ export default class ImageViewer extends React.Component<Props, State> {
447447
onSwipeDown={this.handleSwipeDown}
448448
pinchToZoom={this.props.enableImageZoom}
449449
enableDoubleClickZoom={this.props.enableImageZoom}
450+
doubleClickInterval={this.props.doubleClickInterval}
450451
{...others}
451452
>
452453
{children}
@@ -512,6 +513,7 @@ export default class ImageViewer extends React.Component<Props, State> {
512513
onSwipeDown={this.handleSwipeDown}
513514
pinchToZoom={this.props.enableImageZoom}
514515
enableDoubleClickZoom={this.props.enableImageZoom}
516+
doubleClickInterval={this.props.doubleClickInterval}
515517
>
516518
{this!.props!.renderImage!(image.props)}
517519
</ImageZoom>

src/image-viewer.type.ts

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ export class Props {
6666
*/
6767
public enableSwipeDown?: boolean = false;
6868

69+
public doubleClickInterval?: number;
70+
6971
/**
7072
* 长按图片的回调
7173
*/

0 commit comments

Comments
 (0)