@react-native-oh-tpl/react-native-gesture-handler 2.14.15 → 2.14.17-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DrawerLayout/index.ts +2 -2
- package/Swipeable/index.ts +2 -2
- package/harmony/gesture_handler.har +0 -0
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/typescript/RNGestureHandlerModule.d.ts +2 -2
- package/lib/typescript/components/GestureHandlerRootView.d.ts +6 -6
- package/lib/typescript/handlers/createHandler.d.ts +11 -11
- package/lib/typescript/index.d.ts +47 -47
- package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +14 -14
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +14 -14
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +6 -6
- package/package.json +83 -78
- package/src/RNGestureHandlerModule.ts +4 -4
- package/src/components/GestureHandlerRootView.tsx +23 -23
- package/src/handlers/createHandler.tsx +534 -534
- package/src/index.ts +172 -172
- package/src/specs/NativeRNGestureHandlerModule.ts +26 -26
- package/src/specs/RNGestureHandlerButtonNativeComponent.ts +18 -18
- package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +6 -6
- package/harmony/gesture_handler/BuildProfile.ets +0 -17
- package/harmony/gesture_handler/build-profile.json5 +0 -12
- package/harmony/gesture_handler/hvigorfile.ts +0 -2
- package/harmony/gesture_handler/index.ets +0 -2
- package/harmony/gesture_handler/oh-package-lock.json5 +0 -18
- package/harmony/gesture_handler/oh-package.json5 +0 -12
- package/harmony/gesture_handler/src/main/cpp/CMakeLists.txt +0 -8
- package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.h +0 -12
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentDescriptor.h +0 -36
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonJSIBinder.h +0 -32
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.cpp +0 -22
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.h +0 -15
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentDescriptor.h +0 -36
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewJSIBinder.h +0 -25
- package/harmony/gesture_handler/src/main/cpp/RnohReactNativeHarmonyGestureHandlerPackage.cpp +0 -157
- package/harmony/gesture_handler/src/main/cpp/RnohReactNativeHarmonyGestureHandlerPackage.h +0 -21
- package/harmony/gesture_handler/src/main/cpp/componentInstances/RNGestureHandlerButtonComponentInstance.h +0 -27
- package/harmony/gesture_handler/src/main/cpp/componentInstances/RNGestureHandlerRootViewComponentInstance.h +0 -245
- package/harmony/gesture_handler/src/main/ets/RNOHPackage.ets +0 -17
- package/harmony/gesture_handler/src/main/ets/core/CircularBuffer.ts +0 -42
- package/harmony/gesture_handler/src/main/ets/core/GestureHandler.ts +0 -739
- package/harmony/gesture_handler/src/main/ets/core/GestureHandlerOrchestrator.ts +0 -344
- package/harmony/gesture_handler/src/main/ets/core/GestureHandlerRegistry.ts +0 -63
- package/harmony/gesture_handler/src/main/ets/core/IncomingEvent.ts +0 -78
- package/harmony/gesture_handler/src/main/ets/core/InteractionManager.ts +0 -144
- package/harmony/gesture_handler/src/main/ets/core/LeastSquareSolver.ts +0 -182
- package/harmony/gesture_handler/src/main/ets/core/Multiset.ts +0 -26
- package/harmony/gesture_handler/src/main/ets/core/OutgoingEvent.ts +0 -34
- package/harmony/gesture_handler/src/main/ets/core/OutgoingEventDispatcher.ts +0 -12
- package/harmony/gesture_handler/src/main/ets/core/PointerTracker.ts +0 -239
- package/harmony/gesture_handler/src/main/ets/core/RNGHError.ts +0 -5
- package/harmony/gesture_handler/src/main/ets/core/RNGHLogger.ts +0 -16
- package/harmony/gesture_handler/src/main/ets/core/State.ts +0 -47
- package/harmony/gesture_handler/src/main/ets/core/Vector2D.ts +0 -80
- package/harmony/gesture_handler/src/main/ets/core/VelocityTracker.ts +0 -106
- package/harmony/gesture_handler/src/main/ets/core/View.ts +0 -21
- package/harmony/gesture_handler/src/main/ets/core/ViewRegistry.ts +0 -7
- package/harmony/gesture_handler/src/main/ets/core/index.ts +0 -15
- package/harmony/gesture_handler/src/main/ets/detectors/ScaleGestureDetector.ts +0 -169
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/FlingGestureHandler.ts +0 -219
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/GestureHandlerFactory.ts +0 -67
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/LongPressGestureHandler.ts +0 -139
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/ManualGestureHandler.ts +0 -50
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/NativeViewGestureHandler.ts +0 -124
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/PanGestureHandler.ts +0 -375
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/PinchGestureHandler.ts +0 -174
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/RotationGestureHandler.ts +0 -172
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/TapGestureHandler.ts +0 -216
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/detectors/RotationGestureDetector.ts +0 -167
- package/harmony/gesture_handler/src/main/ets/gesture-handlers/index.ts +0 -1
- package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerModule.ts +0 -24
- package/harmony/gesture_handler/src/main/ets/namespace/components/RNGestureHandlerButton.ts +0 -139
- package/harmony/gesture_handler/src/main/ets/namespace/components/RNGestureHandlerRootView.ts +0 -101
- package/harmony/gesture_handler/src/main/ets/namespace/components/ts.ts +0 -2
- package/harmony/gesture_handler/src/main/ets/namespace/ts.ts +0 -2
- package/harmony/gesture_handler/src/main/ets/rnoh/GestureHandlerPackage.ts +0 -25
- package/harmony/gesture_handler/src/main/ets/rnoh/Logger.ts +0 -107
- package/harmony/gesture_handler/src/main/ets/rnoh/OutgoingEventDispatchers.ts +0 -94
- package/harmony/gesture_handler/src/main/ets/rnoh/RNGHRootViewController.ts +0 -196
- package/harmony/gesture_handler/src/main/ets/rnoh/RNGHView.ts +0 -85
- package/harmony/gesture_handler/src/main/ets/rnoh/RNGHViewController.ts +0 -255
- package/harmony/gesture_handler/src/main/ets/rnoh/RNGHViewRegistry.ts +0 -19
- package/harmony/gesture_handler/src/main/ets/rnoh/RNGestureHandlerModule.ts +0 -267
- package/harmony/gesture_handler/src/main/ets/rnoh/RNOHGestureResponder.ts +0 -15
- package/harmony/gesture_handler/src/main/ets/rnoh/RNOHScrollLocker.ts +0 -25
- package/harmony/gesture_handler/src/main/ets/rnoh/types.ts +0 -25
- package/harmony/gesture_handler/src/main/module.json5 +0 -9
- package/harmony/gesture_handler/src/main/resources/base/element/color.json +0 -8
- package/harmony/gesture_handler/src/main/resources/base/element/string.json +0 -16
- package/harmony/gesture_handler/src/main/resources/base/media/icon.png +0 -0
- package/harmony/gesture_handler/src/main/resources/base/profile/main_pages.json +0 -5
- package/harmony/gesture_handler/src/main/resources/en_US/element/string.json +0 -16
- package/harmony/gesture_handler/src/main/resources/zh_CN/element/string.json +0 -16
- package/harmony/gesture_handler/ts.ts +0 -2
@@ -1,267 +0,0 @@
|
|
1
|
-
import { TurboModule, TurboModuleContext, Tag } from "@rnoh/react-native-openharmony/ts";
|
2
|
-
import { TM } from "../namespace/ts"
|
3
|
-
import {
|
4
|
-
GestureHandlerRegistry,
|
5
|
-
State,
|
6
|
-
OutgoingEventDispatcher,
|
7
|
-
RNGHLogger,
|
8
|
-
InteractionManager,
|
9
|
-
ViewRegistry
|
10
|
-
} from '../core';
|
11
|
-
import { GestureHandlerFactory } from "../gesture-handlers"
|
12
|
-
import { RNGHViewRegistry } from './RNGHViewRegistry';
|
13
|
-
import { DevelopmentRNGHLogger, ProductionRNGHLogger } from './Logger';
|
14
|
-
import { JSEventDispatcher, AnimatedEventDispatcher, ReanimatedEventDispatcher } from './OutgoingEventDispatchers'
|
15
|
-
import { RNOHScrollLockerCAPI } from "./RNOHScrollLocker"
|
16
|
-
import { RNGHRootViewController, RawTouchEvent } from "./RNGHRootViewController"
|
17
|
-
import { RNGHView } from "./RNGHView"
|
18
|
-
import { RNOHGestureResponder } from "./RNOHGestureResponder"
|
19
|
-
|
20
|
-
export enum ActionType {
|
21
|
-
REANIMATED_WORKLET = 1,
|
22
|
-
NATIVE_ANIMATED_EVENT = 2,
|
23
|
-
JS_FUNCTION_OLD_API = 3,
|
24
|
-
JS_FUNCTION_NEW_API = 4,
|
25
|
-
}
|
26
|
-
|
27
|
-
|
28
|
-
export class RNGestureHandlerModule extends TurboModule implements TM.RNGestureHandlerModule.Spec {
|
29
|
-
static readonly NAME = "RNGestureHandlerModule"
|
30
|
-
|
31
|
-
private gestureHandlerRegistry: GestureHandlerRegistry
|
32
|
-
private gestureHandlerFactory: GestureHandlerFactory | undefined = undefined
|
33
|
-
private viewRegistry: ViewRegistry | undefined = undefined
|
34
|
-
private logger: RNGHLogger
|
35
|
-
private cleanLogger: RNGHLogger
|
36
|
-
private rootViewControllerByRootTag = new Map<Tag, RNGHRootViewController>()
|
37
|
-
private interactionManager: InteractionManager
|
38
|
-
|
39
|
-
constructor(ctx: TurboModuleContext, isDevModeEnabled: boolean = false) {
|
40
|
-
super(ctx)
|
41
|
-
this.cleanLogger =
|
42
|
-
isDevModeEnabled && ctx.isDebugModeEnabled ? new DevelopmentRNGHLogger(ctx.logger, "RNGH") :
|
43
|
-
new ProductionRNGHLogger(ctx.logger, "RNGH")
|
44
|
-
this.logger = this.cleanLogger.cloneAndJoinPrefix("RNGestureHandlerModule")
|
45
|
-
const logger = this.logger.cloneAndJoinPrefix("constructor")
|
46
|
-
const stopTracing = logger.startTracing()
|
47
|
-
this.interactionManager = new InteractionManager(this.cleanLogger)
|
48
|
-
this.gestureHandlerRegistry = new GestureHandlerRegistry(this.viewRegistry, this.cleanLogger)
|
49
|
-
if (this.ctx.rnInstance.getArchitecture() === "C_API") {
|
50
|
-
this.ctx.rnInstance.cppEventEmitter.subscribe("RNGH::TOUCH_EVENT", (e: any) => {
|
51
|
-
this.onTouch(e)
|
52
|
-
})
|
53
|
-
this.ctx.rnInstance.cppEventEmitter.subscribe("RNGH::ROOT_CREATED", (rootTag: any) => {
|
54
|
-
this.onGHRootCreated(rootTag)
|
55
|
-
})
|
56
|
-
this.ctx.rnInstance.cppEventEmitter.subscribe("RNGH::CANCEL_TOUCHES", (rootTag: any) => {
|
57
|
-
const touchHandler = this.rootViewControllerByRootTag.get(rootTag)
|
58
|
-
touchHandler?.cancelTouches()
|
59
|
-
})
|
60
|
-
}
|
61
|
-
stopTracing()
|
62
|
-
}
|
63
|
-
|
64
|
-
/**
|
65
|
-
* Called from C++.
|
66
|
-
*/
|
67
|
-
private onGHRootCreated(rootTag: Tag) {
|
68
|
-
const stopTracing = this.logger.cloneAndJoinPrefix("onGHRootCreated").startTracing()
|
69
|
-
this.rootViewControllerByRootTag.set(rootTag, new RNGHRootViewController(this.logger, this.gestureHandlerRegistry));
|
70
|
-
stopTracing()
|
71
|
-
}
|
72
|
-
|
73
|
-
/**
|
74
|
-
* Called from C++.
|
75
|
-
*/
|
76
|
-
private onTouch(e: RawTouchEvent & { rootTag: Tag }) {
|
77
|
-
const logger = this.logger.cloneAndJoinPrefix("onTouch")
|
78
|
-
const stopTracing = logger.startTracing();
|
79
|
-
(() => {
|
80
|
-
if (!(this.viewRegistry instanceof RNGHViewRegistry)) {
|
81
|
-
logger.error("Expected ViewRegistryCAPI")
|
82
|
-
return;
|
83
|
-
}
|
84
|
-
const rootViewController = this.rootViewControllerByRootTag.get(e.rootTag)
|
85
|
-
if (!rootViewController) {
|
86
|
-
logger.error(`Couldn't find a rootViewController for a gesture root tag: ${e.rootTag}`)
|
87
|
-
return;
|
88
|
-
}
|
89
|
-
// update view registry
|
90
|
-
e.touchableViews.forEach(touchableView => {
|
91
|
-
const view = this.viewRegistry.getViewByTag(touchableView.tag)
|
92
|
-
if (view) {
|
93
|
-
if (!(view instanceof RNGHView)) {
|
94
|
-
logger.error(`Expected ViewCAPI`)
|
95
|
-
return
|
96
|
-
}
|
97
|
-
view.updateBoundingBox(touchableView)
|
98
|
-
view.setButtonRole(touchableView.buttonRole)
|
99
|
-
} else {
|
100
|
-
this.viewRegistry.save(new RNGHView(touchableView))
|
101
|
-
}
|
102
|
-
})
|
103
|
-
rootViewController.handleTouch(e, e.touchableViews.map(({ tag }) => this.viewRegistry.getViewByTag(tag)));
|
104
|
-
})()
|
105
|
-
stopTracing()
|
106
|
-
}
|
107
|
-
|
108
|
-
// -------------------------------------------------------------------------------------------------------------------
|
109
|
-
|
110
|
-
public install() {
|
111
|
-
const stopTracing = this.ctx.logger.clone("install").startTracing()
|
112
|
-
this.viewRegistry = new RNGHViewRegistry()
|
113
|
-
const scrollLocker = new RNOHScrollLockerCAPI(this.ctx.rnInstance, this.cleanLogger);
|
114
|
-
const rnGestureResponder = new RNOHGestureResponder(this.ctx.rnInstance)
|
115
|
-
this.gestureHandlerFactory =
|
116
|
-
new GestureHandlerFactory(this.cleanLogger, scrollLocker, this.interactionManager, rnGestureResponder)
|
117
|
-
stopTracing()
|
118
|
-
return true
|
119
|
-
}
|
120
|
-
|
121
|
-
public createGestureHandler(
|
122
|
-
handlerName: string,
|
123
|
-
handlerTag: number,
|
124
|
-
config: Readonly<Record<string, unknown>>
|
125
|
-
) {
|
126
|
-
const logger = this.logger.cloneAndJoinPrefix("createGestureHandler")
|
127
|
-
const stopTracing = logger.startTracing();
|
128
|
-
(() => {
|
129
|
-
if (!this.gestureHandlerFactory) {
|
130
|
-
logger.error("Trying to create a gesture handler before creating gesture handler factory")
|
131
|
-
return
|
132
|
-
}
|
133
|
-
logger.debug({ handlerName, handlerTag, config })
|
134
|
-
const gestureHandler = this.gestureHandlerFactory.create(handlerName, handlerTag)
|
135
|
-
this.gestureHandlerRegistry.addGestureHandler(gestureHandler)
|
136
|
-
this.interactionManager.configureInteractions(gestureHandler, config);
|
137
|
-
gestureHandler.updateGestureConfig(config)
|
138
|
-
})()
|
139
|
-
stopTracing()
|
140
|
-
}
|
141
|
-
|
142
|
-
public attachGestureHandler(
|
143
|
-
handlerTag: number,
|
144
|
-
viewTag: number,
|
145
|
-
actionType: ActionType
|
146
|
-
) {
|
147
|
-
const logger = this.logger.cloneAndJoinPrefix("attachGestureHandler")
|
148
|
-
const stopTracing = logger.startTracing();
|
149
|
-
(() => {
|
150
|
-
const eventDispatcher = this.createEventDispatcher(actionType, viewTag)
|
151
|
-
if (!eventDispatcher) {
|
152
|
-
logger.error("RNGH: Couldn't create EventDispatcher")
|
153
|
-
return
|
154
|
-
}
|
155
|
-
const viewRegistry = this.viewRegistry
|
156
|
-
let view = this.viewRegistry.getViewByTag(viewTag)
|
157
|
-
if (!view && viewRegistry instanceof RNGHViewRegistry) {
|
158
|
-
view = new RNGHView({
|
159
|
-
tag: viewTag,
|
160
|
-
x: 0,
|
161
|
-
y: 0,
|
162
|
-
width: 0,
|
163
|
-
height: 0,
|
164
|
-
buttonRole: false
|
165
|
-
})
|
166
|
-
viewRegistry.save(view)
|
167
|
-
}
|
168
|
-
if (!view) {
|
169
|
-
logger.error("Expected view")
|
170
|
-
return;
|
171
|
-
}
|
172
|
-
this.gestureHandlerRegistry.bindGestureHandlerWithView(handlerTag, view)
|
173
|
-
this.gestureHandlerRegistry.getGestureHandlersByViewTag(view.getTag()).forEach((handler) => {
|
174
|
-
if (handler.isGestureContinuous() && eventDispatcher instanceof JSEventDispatcher) {
|
175
|
-
logger.warn(`Using JSEventDispatcher for a continuous gesture (${handler.getName()}). Gesture-driven animations may not be smooth. Consider using Animated.event.`)
|
176
|
-
}
|
177
|
-
})
|
178
|
-
this.gestureHandlerRegistry
|
179
|
-
.getGestureHandlerByHandlerTag(handlerTag)
|
180
|
-
.setEventDispatcher(eventDispatcher)
|
181
|
-
})()
|
182
|
-
stopTracing()
|
183
|
-
}
|
184
|
-
|
185
|
-
private createEventDispatcher(actionType: ActionType, viewTag: number): OutgoingEventDispatcher | null {
|
186
|
-
switch (actionType) {
|
187
|
-
case ActionType.REANIMATED_WORKLET:
|
188
|
-
return new ReanimatedEventDispatcher(this.ctx.rnInstance,
|
189
|
-
this.cleanLogger, viewTag)
|
190
|
-
case ActionType.NATIVE_ANIMATED_EVENT:
|
191
|
-
return new AnimatedEventDispatcher(this.ctx.rnInstance,
|
192
|
-
this.cleanLogger, viewTag)
|
193
|
-
case ActionType.JS_FUNCTION_OLD_API:
|
194
|
-
case ActionType.JS_FUNCTION_NEW_API:
|
195
|
-
return new JSEventDispatcher(this.ctx.rnInstance, this.cleanLogger);
|
196
|
-
}
|
197
|
-
}
|
198
|
-
|
199
|
-
public updateGestureHandler(
|
200
|
-
handlerTag: number,
|
201
|
-
newConfig: Readonly<Record<string, unknown>>
|
202
|
-
) {
|
203
|
-
const stopTracing = this.logger.cloneAndJoinPrefix("updateGestureHandler").startTracing()
|
204
|
-
const gestureHandler = this.gestureHandlerRegistry.getGestureHandlerByHandlerTag(handlerTag)
|
205
|
-
this.interactionManager.configureInteractions(gestureHandler, newConfig);
|
206
|
-
gestureHandler.updateGestureConfig(newConfig)
|
207
|
-
stopTracing()
|
208
|
-
}
|
209
|
-
|
210
|
-
public dropGestureHandler(handlerTag: number) {
|
211
|
-
const stopTracing = this.logger.cloneAndJoinPrefix("dropGestureHandler").startTracing()
|
212
|
-
this.interactionManager.dropRelationsForHandlerWithTag(handlerTag)
|
213
|
-
this.gestureHandlerRegistry.removeGestureHandlerByHandlerTag(handlerTag)
|
214
|
-
stopTracing()
|
215
|
-
}
|
216
|
-
|
217
|
-
public handleSetJSResponder(tag: number, blockNativeResponder: boolean) {
|
218
|
-
this.logger.cloneAndJoinPrefix("handleSetJSResponder").warn("not implemented")
|
219
|
-
}
|
220
|
-
|
221
|
-
public handleClearJSResponder() {
|
222
|
-
this.logger.cloneAndJoinPrefix("handleClearJSResponder").warn("not implemented")
|
223
|
-
}
|
224
|
-
|
225
|
-
public flushOperations() {
|
226
|
-
// no-op
|
227
|
-
}
|
228
|
-
|
229
|
-
// -------------------------------------------------------------------------------------------------------------------
|
230
|
-
|
231
|
-
public getGestureHandlerRegistry() {
|
232
|
-
return this.gestureHandlerRegistry
|
233
|
-
}
|
234
|
-
|
235
|
-
public getLogger() {
|
236
|
-
return this.logger
|
237
|
-
}
|
238
|
-
|
239
|
-
public getViewRegistry() {
|
240
|
-
if (!this.viewRegistry) {
|
241
|
-
this.logger.error("Tried to get viewRegistry before it was initialized")
|
242
|
-
throw new Error("Tried to get viewRegistry before it was initialized")
|
243
|
-
}
|
244
|
-
return this.viewRegistry
|
245
|
-
}
|
246
|
-
|
247
|
-
public setGestureHandlerState(handlerTag: number, newState: State) {
|
248
|
-
const handler = this.getGestureHandlerRegistry().getGestureHandlerByHandlerTag(handlerTag);
|
249
|
-
switch (newState) {
|
250
|
-
case State.ACTIVE:
|
251
|
-
handler.activate();
|
252
|
-
break;
|
253
|
-
case State.BEGAN:
|
254
|
-
handler.begin();
|
255
|
-
break;
|
256
|
-
case State.END:
|
257
|
-
handler.end();
|
258
|
-
break;
|
259
|
-
case State.FAILED:
|
260
|
-
handler.fail();
|
261
|
-
break;
|
262
|
-
case State.CANCELLED:
|
263
|
-
handler.cancel();
|
264
|
-
break;
|
265
|
-
}
|
266
|
-
}
|
267
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { RNInstance } from "@rnoh/react-native-openharmony/ts"
|
2
|
-
import { RNGestureResponder } from "../core"
|
3
|
-
|
4
|
-
|
5
|
-
export class RNOHGestureResponder implements RNGestureResponder {
|
6
|
-
constructor(private rnInstance: RNInstance) {
|
7
|
-
}
|
8
|
-
|
9
|
-
lock(viewTag: number): () => void {
|
10
|
-
this.rnInstance.postMessageToCpp("RNGH::ROOT_VIEW_IS_HANDLING_TOUCHES", { descendantViewTag: viewTag, isHandlingTouches: true })
|
11
|
-
return () => {
|
12
|
-
this.rnInstance.postMessageToCpp("RNGH::ROOT_VIEW_IS_HANDLING_TOUCHES", { descendantViewTag: viewTag, isHandlingTouches: false })
|
13
|
-
}
|
14
|
-
}
|
15
|
-
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { RNInstance } from '@rnoh/react-native-openharmony/ts';
|
2
|
-
import { ScrollLocker, RNGHLogger } from '../core';
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
export class RNOHScrollLockerCAPI implements ScrollLocker {
|
7
|
-
private logger: RNGHLogger
|
8
|
-
|
9
|
-
constructor(private rnInstance: RNInstance, logger: RNGHLogger) {
|
10
|
-
this.logger = logger.cloneAndJoinPrefix("RNOHScrollLockerCAPI")
|
11
|
-
}
|
12
|
-
|
13
|
-
lockScrollContainingViewTag(viewTag: number) {
|
14
|
-
this.rnInstance.postMessageToCpp('RNGH::SET_NATIVE_RESPONDERS_BLOCK', {
|
15
|
-
targetTag: viewTag,
|
16
|
-
shouldBlock: true,
|
17
|
-
});
|
18
|
-
return () => {
|
19
|
-
this.rnInstance.postMessageToCpp('RNGH::SET_NATIVE_RESPONDERS_BLOCK', {
|
20
|
-
targetTag: viewTag,
|
21
|
-
shouldBlock: false,
|
22
|
-
});
|
23
|
-
};
|
24
|
-
}
|
25
|
-
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
export enum TouchType {
|
2
|
-
Down,
|
3
|
-
Up,
|
4
|
-
Move,
|
5
|
-
Cancel
|
6
|
-
}
|
7
|
-
|
8
|
-
interface BaseEvent {
|
9
|
-
timestamp: number;
|
10
|
-
}
|
11
|
-
|
12
|
-
export interface TouchObject {
|
13
|
-
type: TouchType;
|
14
|
-
id: number;
|
15
|
-
windowX: number;
|
16
|
-
windowY: number;
|
17
|
-
x: number;
|
18
|
-
y: number;
|
19
|
-
}
|
20
|
-
|
21
|
-
export interface TouchEvent extends BaseEvent {
|
22
|
-
type: TouchType;
|
23
|
-
touches: TouchObject[];
|
24
|
-
changedTouches: TouchObject[];
|
25
|
-
}
|
Binary file
|