Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration from hammer #2157

Merged
merged 43 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
fe6584c
Initial commit
m-bert Jul 21, 2022
68f5abc
test commit
m-bert Jul 21, 2022
f37b37a
access test
m-bert Jul 22, 2022
8b6eef6
test commit
m-bert Jul 22, 2022
6d04613
access test 2
m-bert Jul 22, 2022
9321d6d
Interface manager
m-bert Jul 22, 2022
aa66f83
Orchestrator logic
m-bert Jul 25, 2022
1117f68
Wotking DoubleTap
m-bert Jul 26, 2022
cc63c83
Long-double-single
m-bert Jul 27, 2022
870e8f5
Simultaneous bugfix
m-bert Jul 27, 2022
c03fab0
Pinch fix and rotation
m-bert Jul 29, 2022
a42ebf2
Rotation fix
m-bert Aug 1, 2022
570b1e9
Bouncing box fix
m-bert Aug 1, 2022
51c39fe
Pan velocity fix
m-bert Aug 2, 2022
012ad1b
Added native view
m-bert Aug 2, 2022
8be0e99
Bringing back hammer
m-bert Aug 3, 2022
d694091
organizing project structure
m-bert Aug 3, 2022
0845d3a
added switching to hammer
m-bert Aug 3, 2022
1a3b54e
First refactor
m-bert Aug 3, 2022
8950599
Second refactor
m-bert Aug 3, 2022
7388889
Double draggable fix
m-bert Aug 5, 2022
220cb88
Tap fix
m-bert Aug 5, 2022
6a3ae99
Removing pointer history
m-bert Aug 8, 2022
932a8fc
Added HitSlops
m-bert Aug 8, 2022
87133da
Types fix
m-bert Aug 8, 2022
6235998
Bringing back old examples
m-bert Aug 9, 2022
afe3c15
SVG fix in pinch and rotate
m-bert Aug 9, 2022
47d66c2
Velocity fix for pan
m-bert Aug 9, 2022
1a86d6e
Added missing import in GestureDetector
m-bert Aug 10, 2022
edb1692
Merge branch 'main' into migration-from-hammer
m-bert Aug 10, 2022
e22c207
Pan custom criteria fix
m-bert Aug 10, 2022
d1a3061
Type fixes in handlers
m-bert Aug 10, 2022
5e7a429
Camera example reset
m-bert Aug 10, 2022
1a425de
Changing Alert to window.alert
m-bert Aug 10, 2022
98a9b2b
Removing unnecessary methods and fields
m-bert Aug 11, 2022
15e1df7
Cosmetic changes (renaming methods, changing typos and removing unnec…
m-bert Aug 11, 2022
b62661d
Ignore Safari callbacks error
m-bert Aug 11, 2022
f0dda33
Fixed misssing event data
m-bert Aug 11, 2022
cbf433d
Adding braces to ifs and other minor cosmetic changes
m-bert Aug 12, 2022
12b5229
Changes in checking new implementation logic
m-bert Aug 16, 2022
48e8382
Import fixes
m-bert Aug 16, 2022
67e6576
Merge branch 'main' into migration-from-hammer
m-bert Aug 19, 2022
b48ae82
Type fix in interfaces
m-bert Aug 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
access test
  • Loading branch information
m-bert committed Jul 22, 2022
commit f37b37af5bb47893f6ef385f687ec30a5e1f857d
5 changes: 2 additions & 3 deletions example/src/basic/draggable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
PanGestureHandlerGestureEvent,
ScrollView,
GestureHandlerRootView,
TapGestureHandler,
} from 'react-native-gesture-handler';

import { USE_NATIVE_DRIVER } from '../../config';
Expand Down Expand Up @@ -57,9 +58,7 @@ export class DraggableBox extends Component<DraggableBoxProps> {
onGestureEvent={this.onGestureEvent}
onHandlerStateChange={this.onHandlerStateChange}
minDist={this.props.minDist}
avgTouches={true}
// minPointers={2}>
>
avgTouches={true}>
<Animated.View
style={[
styles.box,
Expand Down
2 changes: 0 additions & 2 deletions src/web/EventManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class EventManager {
event.preventDefault();
const ghEvent: GHEvent = this.mapEvent(event, EventTypes.DOWN);

// console.log(event);

this.view.setPointerCapture(ghEvent.pointerId);
this.addActivePointer(ghEvent.pointerId);
this.onDownAction(ghEvent);
Expand Down
19 changes: 7 additions & 12 deletions src/web/GestureHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,11 @@ abstract class GestureHandler {
}

//Handling states changes
abstract resetProgress(): void;
abstract onCancel(): void;
abstract onReset(): void;
protected resetProgress(): void {
//
}
protected onStateChange(_newState: State, _oldState: State): void {
//
}
Expand All @@ -262,7 +264,7 @@ abstract class GestureHandler {
this.onReset();
}

public resetConfig(): void {
protected resetConfig(): void {
//Reset logic
}

Expand Down Expand Up @@ -362,8 +364,7 @@ abstract class GestureHandler {
this.activationIndex = value;
}
protected onDownAction(_event: GHEvent): void {
// console.log(_event.eventType);
// console.log(this.getState());
//
}
//Adding another pointer to existing ones
protected onPointerAdd(_event: GHEvent): void {
Expand All @@ -375,8 +376,6 @@ abstract class GestureHandler {
protected onPointerRemove(_event: GHEvent): void {
//
}
// Remove one of the fingers

protected onMoveAction(event: GHEvent): void {
if (this.getState() === State.ACTIVE) {
GestureHandlerOrchestrator.getInstance().onHandlerStateChange(
Expand All @@ -397,8 +396,6 @@ abstract class GestureHandler {
//
}
protected onOutOfBoundsAction(event: GHEvent): void {
// console.log(event);
// console.log(this.getState());
if (!this.shouldCancellWhenOutside && this.getState() === State.ACTIVE) {
GestureHandlerOrchestrator.getInstance().onHandlerStateChange(
this,
Expand All @@ -425,8 +422,6 @@ abstract class GestureHandler {
oldState
);

// console.log(event, newState, oldState);

invokeNullableMethod(onGestureHandlerEvent, _event);
if (this.lastSentState !== newState) {
this.lastSentState = newState;
Expand All @@ -448,8 +443,8 @@ abstract class GestureHandler {
y: event.y,
}),
...this.transformNativeEvent(event),
handlerTag: this.handlerTag,
target: this.ref,
handlerTag: this.handlerTag as number,
target: this.ref as number,
oldState:
newState !== oldState || newState === State.ACTIVE
? oldState
Expand Down
Loading