Skip to content

Commit

Permalink
Expose gestureStarted (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasttvo authored Sep 18, 2024
1 parent 2939cac commit 31881fd
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 6 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ The following methods allow you to control the ZoomableView zoom level & positio
| moveTo | Shifts the zoomed part to a specific point (in px relative to x: 0, y: 0) | newOffsetX: number, newOffsetY: number, bindToBorders = true | Promise<void> |
| moveBy | Shifts the zoomed part by a specific pixel number | newOffsetX: number, newOffsetY: number, bindToBorders = true | Promise<void> |

#### Properties

| name | description |
| -------------- | ----------------------------------------------- |
| gestureStarted | Indicates if a gesture is currently in progress |

**Example:**

```TSX
Expand Down
11 changes: 10 additions & 1 deletion lib/commonjs/ReactNativeZoomableView.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/commonjs/ReactNativeZoomableView.js.map

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion lib/module/ReactNativeZoomableView.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/module/ReactNativeZoomableView.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion lib/typescript/ReactNativeZoomableView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ declare class ReactNativeZoomableView extends Component<ReactNativeZoomableViewP
private lastGestureCenterPosition;
private lastGestureTouchDistance;
private gestureType;
private gestureStarted;
private _gestureStarted;
private set gestureStarted(value);
get gestureStarted(): boolean;
/**
* Last press time (used to evaluate whether user double tapped)
* @type {number}
Expand Down
9 changes: 8 additions & 1 deletion src/ReactNativeZoomableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ class ReactNativeZoomableView extends Component<
private lastGestureCenterPosition: { x: number; y: number } = null;
private lastGestureTouchDistance: number;
private gestureType: 'pinch' | 'shift' | 'null';
private gestureStarted = false;

private _gestureStarted = false;
private set gestureStarted(v: boolean) {
this._gestureStarted = v;
}
public get gestureStarted() {
return this._gestureStarted;
}

/**
* Last press time (used to evaluate whether user double tapped)
Expand Down

0 comments on commit 31881fd

Please sign in to comment.