@nativescript-community/ui-drawer 0.0.29 → 0.0.33
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/CHANGELOG.md +38 -0
- package/README.md +149 -90
- package/angular/bundles/nativescript-community-ui-drawer-angular.umd.js +54 -31
- package/angular/esm2015/index.js +1 -1
- package/angular/esm2015/module.js +11 -10
- package/angular/esm2015/nativescript-community-ui-drawer-angular.js +1 -1
- package/angular/fesm2015/nativescript-community-ui-drawer-angular.js +34 -32
- package/angular/module.d.ts +15 -14
- package/angular/package.json +3 -3
- package/index.js +15 -10
- package/package.json +11 -3
- package/vue/index.js +1 -1
- package/angular/bundles/nativescript-community-ui-drawer-angular.umd.min.js +0 -2
- package/pnpm-global/5/node_modules/.modules.yaml +0 -24
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/CHANGELOG.md +0 -467
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/LICENSE +0 -201
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/README.md +0 -56
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/gesturehandler.android.d.ts +0 -155
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/gesturehandler.android.js +0 -535
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/gesturehandler.common.d.ts +0 -93
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/gesturehandler.common.js +0 -222
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/gesturehandler.d.ts +0 -149
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/gesturehandler.ios.d.ts +0 -53
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/gesturehandler.ios.js +0 -253
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/gestures_override.d.ts +0 -27
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/gestures_override.js +0 -263
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/package.json +0 -39
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/AndroidManifest.xml +0 -2
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/include.gradle +0 -9
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/nativescript/gesturehandler/GestureHandlerInteractionController.java +0 -79
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/nativescript/gesturehandler/PageLayout.java +0 -169
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/nativescript/gesturehandler/RootViewGestureHandler.java +0 -45
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/BaseGestureHandlerInteractionController.java +0 -19
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/FlingGestureHandler.java +0 -125
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandler.java +0 -541
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandlerInteractionController.java +0 -11
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java +0 -569
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandlerRegistry.java +0 -10
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandlerRegistryImpl.java +0 -97
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureUtils.java +0 -51
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/LongPressGestureHandler.java +0 -77
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/NativeViewGestureHandler.java +0 -141
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/OnTouchEventListener.java +0 -11
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/PanGestureHandler.java +0 -320
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/PinchGestureHandler.java +0 -138
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/PointerEvents.java +0 -25
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/PointerEventsConfig.java +0 -25
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/PointerEventsSpec.java +0 -25
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/RotationGestureDetector.java +0 -171
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/RotationGestureHandler.java +0 -96
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/ScaleGestureDetector.java +0 -597
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/TapGestureHandler.java +0 -176
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/ViewConfigurationHelper.java +0 -12
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/android/res/values/config.xml +0 -13
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/FlingHandler.h +0 -6
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/FlingHandler.m +0 -131
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/ForceTouchHandler.h +0 -4
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/ForceTouchHandler.m +0 -170
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandler.h +0 -98
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandler.m +0 -365
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerDirection.h +0 -8
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerEvents.h +0 -30
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerEvents.m +0 -122
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerHeader.h +0 -23
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerManager.h +0 -25
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerManager.m +0 -169
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerRegistry.h +0 -18
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerRegistry.m +0 -49
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerState.h +0 -10
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/LongPressHandler.h +0 -12
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/LongPressHandler.m +0 -100
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/NativeViewHandler.h +0 -15
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/NativeViewHandler.m +0 -163
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/PanHandler.h +0 -14
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/PanHandler.m +0 -242
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/PinchHandler.h +0 -12
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/PinchHandler.m +0 -36
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/RootViewGestureRecognizer.h +0 -17
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/RootViewGestureRecognizer.m +0 -93
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/RotationHandler.h +0 -12
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/RotationHandler.m +0 -36
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/TapHandler.h +0 -13
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/TapHandler.m +0 -228
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/module.modulemap +0 -5
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/pnpm-lock.yaml +0 -10
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/references.d.ts +0 -3
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/typings/android.d.ts +0 -456
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/typings/extensions.android.d.ts +0 -16
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/gesturehandler/typings/ios.d.ts +0 -266
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/observable/CHANGELOG.md +0 -94
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/observable/LICENSE +0 -201
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/observable/README.md +0 -17
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/observable/observable.d.ts +0 -17
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/observable/observable.js +0 -37
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/observable/observablearray.d.ts +0 -10
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/observable/observablearray.js +0 -224
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+gesturehandler@0.1.41/node_modules/@nativescript-community/observable/package.json +0 -31
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.9/node_modules/@nativescript-community/observable/CHANGELOG.md +0 -94
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.9/node_modules/@nativescript-community/observable/LICENSE +0 -201
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.9/node_modules/@nativescript-community/observable/README.md +0 -17
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.9/node_modules/@nativescript-community/observable/observable.d.ts +0 -17
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.9/node_modules/@nativescript-community/observable/observable.js +0 -37
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.9/node_modules/@nativescript-community/observable/observablearray.d.ts +0 -10
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.9/node_modules/@nativescript-community/observable/observablearray.js +0 -224
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.9/node_modules/@nativescript-community/observable/package.json +0 -31
- package/pnpm-global/5/node_modules/.pnpm/lock.yaml +0 -19
- package/pnpm-global/5/node_modules/.pnpm/node_modules/@nativescript-community/observable/CHANGELOG.md +0 -94
- package/pnpm-global/5/node_modules/.pnpm/node_modules/@nativescript-community/observable/LICENSE +0 -201
- package/pnpm-global/5/node_modules/.pnpm/node_modules/@nativescript-community/observable/README.md +0 -17
- package/pnpm-global/5/node_modules/.pnpm/node_modules/@nativescript-community/observable/observable.d.ts +0 -17
- package/pnpm-global/5/node_modules/.pnpm/node_modules/@nativescript-community/observable/observable.js +0 -37
- package/pnpm-global/5/node_modules/.pnpm/node_modules/@nativescript-community/observable/observablearray.d.ts +0 -10
- package/pnpm-global/5/node_modules/.pnpm/node_modules/@nativescript-community/observable/observablearray.js +0 -224
- package/pnpm-global/5/node_modules/.pnpm/node_modules/@nativescript-community/observable/package.json +0 -31
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/CHANGELOG.md +0 -467
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/LICENSE +0 -201
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/README.md +0 -56
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/gesturehandler.android.d.ts +0 -155
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/gesturehandler.android.js +0 -535
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/gesturehandler.common.d.ts +0 -93
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/gesturehandler.common.js +0 -222
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/gesturehandler.d.ts +0 -149
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/gesturehandler.ios.d.ts +0 -53
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/gesturehandler.ios.js +0 -253
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/gestures_override.d.ts +0 -27
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/gestures_override.js +0 -263
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/package.json +0 -39
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/AndroidManifest.xml +0 -2
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/include.gradle +0 -9
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/nativescript/gesturehandler/GestureHandlerInteractionController.java +0 -79
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/nativescript/gesturehandler/PageLayout.java +0 -169
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/nativescript/gesturehandler/RootViewGestureHandler.java +0 -45
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/BaseGestureHandlerInteractionController.java +0 -19
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/FlingGestureHandler.java +0 -125
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandler.java +0 -541
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandlerInteractionController.java +0 -11
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java +0 -569
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandlerRegistry.java +0 -10
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandlerRegistryImpl.java +0 -97
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureUtils.java +0 -51
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/LongPressGestureHandler.java +0 -77
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/NativeViewGestureHandler.java +0 -141
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/OnTouchEventListener.java +0 -11
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/PanGestureHandler.java +0 -320
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/PinchGestureHandler.java +0 -138
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/PointerEvents.java +0 -25
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/PointerEventsConfig.java +0 -25
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/PointerEventsSpec.java +0 -25
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/RotationGestureDetector.java +0 -171
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/RotationGestureHandler.java +0 -96
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/ScaleGestureDetector.java +0 -597
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/TapGestureHandler.java +0 -176
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/ViewConfigurationHelper.java +0 -12
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/android/res/values/config.xml +0 -13
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/FlingHandler.h +0 -6
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/FlingHandler.m +0 -131
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/ForceTouchHandler.h +0 -4
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/ForceTouchHandler.m +0 -170
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandler.h +0 -98
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandler.m +0 -365
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerDirection.h +0 -8
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerEvents.h +0 -30
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerEvents.m +0 -122
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerHeader.h +0 -23
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerManager.h +0 -25
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerManager.m +0 -169
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerRegistry.h +0 -18
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerRegistry.m +0 -49
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/GestureHandlerState.h +0 -10
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/LongPressHandler.h +0 -12
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/LongPressHandler.m +0 -100
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/NativeViewHandler.h +0 -15
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/NativeViewHandler.m +0 -163
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/PanHandler.h +0 -14
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/PanHandler.m +0 -242
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/PinchHandler.h +0 -12
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/PinchHandler.m +0 -36
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/RootViewGestureRecognizer.h +0 -17
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/RootViewGestureRecognizer.m +0 -93
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/RotationHandler.h +0 -12
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/RotationHandler.m +0 -36
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/TapHandler.h +0 -13
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/TapHandler.m +0 -228
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/platforms/ios/src/module.modulemap +0 -5
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/pnpm-lock.yaml +0 -10
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/references.d.ts +0 -3
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/typings/android.d.ts +0 -456
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/typings/extensions.android.d.ts +0 -16
- package/pnpm-global/5/node_modules/@nativescript-community/gesturehandler/typings/ios.d.ts +0 -266
- package/pnpm-global/5/pnpm-lock.yaml +0 -19
- package/pnpm-lock.yaml +0 -16
- package/react/index.d.ts +0 -20
- package/react/index.js +0 -8
@@ -1,569 +0,0 @@
|
|
1
|
-
package com.swmansion.gesturehandler;
|
2
|
-
|
3
|
-
import android.util.Log;
|
4
|
-
|
5
|
-
import android.graphics.Matrix;
|
6
|
-
import android.graphics.PointF;
|
7
|
-
import android.view.MotionEvent;
|
8
|
-
import android.view.View;
|
9
|
-
import android.view.ViewGroup;
|
10
|
-
import android.view.ViewParent;
|
11
|
-
import android.os.SystemClock;
|
12
|
-
|
13
|
-
import java.util.ArrayList;
|
14
|
-
import java.util.Arrays;
|
15
|
-
import java.util.Comparator;
|
16
|
-
|
17
|
-
import androidx.annotation.Nullable;
|
18
|
-
|
19
|
-
import android.util.Log;
|
20
|
-
|
21
|
-
public class GestureHandlerOrchestrator {
|
22
|
-
private final String TAG = "GestureHandler";
|
23
|
-
|
24
|
-
// The limit doesn't necessarily need to exists, it was just simpler to
|
25
|
-
// implement it that way
|
26
|
-
// it is also more allocation-wise efficient to have a fixed limit
|
27
|
-
private static final int SIMULTANEOUS_GESTURE_HANDLER_LIMIT = 20;
|
28
|
-
// Be default fully transparent views can receive touch
|
29
|
-
private static final float DEFAULT_MIN_ALPHA_FOR_TRAVERSAL = 0f;
|
30
|
-
|
31
|
-
private static final PointF sTempPoint = new PointF();
|
32
|
-
private static final float[] sMatrixTransformCoords = new float[2];
|
33
|
-
private static final Matrix sInverseMatrix = new Matrix();
|
34
|
-
private static final float[] sTempCoords = new float[2];
|
35
|
-
|
36
|
-
private static final Comparator<GestureHandler> sHandlersComparator = new Comparator<GestureHandler>() {
|
37
|
-
@Override
|
38
|
-
public int compare(GestureHandler a, GestureHandler b) {
|
39
|
-
if (a.mIsActive && b.mIsActive || a.mIsAwaiting && b.mIsAwaiting) {
|
40
|
-
// both A and B are either active or awaiting activation, in which case we
|
41
|
-
// prefer one that
|
42
|
-
// has activated (or turned into "awaiting" state) earlier
|
43
|
-
return Integer.signum(b.mActivationIndex - a.mActivationIndex);
|
44
|
-
} else if (a.mIsActive) {
|
45
|
-
return -1; // only A is active
|
46
|
-
} else if (b.mIsActive) {
|
47
|
-
return 1; // only B is active
|
48
|
-
} else if (a.mIsAwaiting) {
|
49
|
-
return -1; // only A is awaiting, B is inactive
|
50
|
-
} else if (b.mIsAwaiting) {
|
51
|
-
return 1; // only B is awaiting, A is inactive
|
52
|
-
}
|
53
|
-
return 0; // both A and B are inactive, stable order matters
|
54
|
-
}
|
55
|
-
};
|
56
|
-
|
57
|
-
private final ViewGroup mWrapperView;
|
58
|
-
private final GestureHandlerRegistry mHandlerRegistry;
|
59
|
-
private final ViewConfigurationHelper mViewConfigHelper;
|
60
|
-
|
61
|
-
private final GestureHandler[] mGestureHandlers = new GestureHandler[SIMULTANEOUS_GESTURE_HANDLER_LIMIT];
|
62
|
-
private final GestureHandler[] mAwaitingHandlers = new GestureHandler[SIMULTANEOUS_GESTURE_HANDLER_LIMIT];
|
63
|
-
private final GestureHandler[] mPreparedHandlers = new GestureHandler[SIMULTANEOUS_GESTURE_HANDLER_LIMIT];
|
64
|
-
private final GestureHandler[] mHandlersToCancel = new GestureHandler[SIMULTANEOUS_GESTURE_HANDLER_LIMIT];
|
65
|
-
private int mGestureHandlersCount = 0;
|
66
|
-
private int mAwaitingHandlersCount = 0;
|
67
|
-
|
68
|
-
private boolean mIsHandlingTouch = false;
|
69
|
-
private int mHandlingChangeSemaphore = 0;
|
70
|
-
private boolean mFinishedHandlersCleanupScheduled = false;
|
71
|
-
private int mActivationIndex = 0;
|
72
|
-
|
73
|
-
private float mMinAlphaForTraversal = DEFAULT_MIN_ALPHA_FOR_TRAVERSAL;
|
74
|
-
|
75
|
-
public GestureHandlerOrchestrator(ViewGroup wrapperView, GestureHandlerRegistry registry,
|
76
|
-
ViewConfigurationHelper viewConfigurationHelper) {
|
77
|
-
mWrapperView = wrapperView;
|
78
|
-
mHandlerRegistry = registry;
|
79
|
-
mViewConfigHelper = viewConfigurationHelper;
|
80
|
-
}
|
81
|
-
|
82
|
-
/**
|
83
|
-
* Minimum alpha (value from 0 to 1) that should be set to a view so that it can
|
84
|
-
* be treated as a gesture target. E.g. if set to 0.1 then views that less than
|
85
|
-
* 10% opaque will be ignored when traversing view hierarchy and looking for
|
86
|
-
* gesture handlers.
|
87
|
-
*/
|
88
|
-
public void setMinimumAlphaForTraversal(float alpha) {
|
89
|
-
mMinAlphaForTraversal = alpha;
|
90
|
-
}
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Should be called from the view wrapper
|
94
|
-
*/
|
95
|
-
public boolean onTouchEvent(MotionEvent event) {
|
96
|
-
mIsHandlingTouch = true;
|
97
|
-
int action = event.getActionMasked();
|
98
|
-
if (action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_POINTER_DOWN) {
|
99
|
-
extractGestureHandlers(event);
|
100
|
-
} else if (action == MotionEvent.ACTION_CANCEL) {
|
101
|
-
cancelAll();
|
102
|
-
}
|
103
|
-
deliverEventToGestureHandlers(event);
|
104
|
-
mIsHandlingTouch = false;
|
105
|
-
if (mFinishedHandlersCleanupScheduled && mHandlingChangeSemaphore == 0) {
|
106
|
-
cleanupFinishedHandlers();
|
107
|
-
}
|
108
|
-
return true;
|
109
|
-
}
|
110
|
-
|
111
|
-
private void scheduleFinishedHandlersCleanup() {
|
112
|
-
if (mIsHandlingTouch || mHandlingChangeSemaphore != 0) {
|
113
|
-
mFinishedHandlersCleanupScheduled = true;
|
114
|
-
} else {
|
115
|
-
cleanupFinishedHandlers();
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
private void cleanupFinishedHandlers() {
|
120
|
-
boolean shouldCleanEmptyCells = false;
|
121
|
-
for (int i = mGestureHandlersCount - 1; i >= 0; i--) {
|
122
|
-
GestureHandler handler = mGestureHandlers[i];
|
123
|
-
if (isFinished(handler.getState()) && !handler.mIsAwaiting) {
|
124
|
-
mGestureHandlers[i] = null;
|
125
|
-
shouldCleanEmptyCells = true;
|
126
|
-
handler.reset();
|
127
|
-
handler.mIsActive = false;
|
128
|
-
handler.mIsAwaiting = false;
|
129
|
-
handler.mActivationIndex = Integer.MAX_VALUE;
|
130
|
-
}
|
131
|
-
}
|
132
|
-
if (shouldCleanEmptyCells) {
|
133
|
-
int out = 0;
|
134
|
-
for (int i = 0; i < mGestureHandlersCount; i++) {
|
135
|
-
if (mGestureHandlers[i] != null) {
|
136
|
-
mGestureHandlers[out++] = mGestureHandlers[i];
|
137
|
-
}
|
138
|
-
}
|
139
|
-
mGestureHandlersCount = out;
|
140
|
-
}
|
141
|
-
mFinishedHandlersCleanupScheduled = false;
|
142
|
-
}
|
143
|
-
|
144
|
-
private boolean hasOtherHandlerToWaitFor(GestureHandler handler) {
|
145
|
-
for (int i = 0; i < mGestureHandlersCount; i++) {
|
146
|
-
GestureHandler otherHandler = mGestureHandlers[i];
|
147
|
-
if (!isFinished(otherHandler.getState()) && shouldHandlerWaitForOther(handler, otherHandler)) {
|
148
|
-
return true;
|
149
|
-
}
|
150
|
-
}
|
151
|
-
return false;
|
152
|
-
}
|
153
|
-
|
154
|
-
private void tryActivate(GestureHandler handler) {
|
155
|
-
// see if there is anyone else who we need to wait for
|
156
|
-
if (hasOtherHandlerToWaitFor(handler)) {
|
157
|
-
addAwaitingHandler(handler);
|
158
|
-
} else {
|
159
|
-
// we can activate handler right away
|
160
|
-
makeActive(handler);
|
161
|
-
handler.mIsAwaiting = false;
|
162
|
-
}
|
163
|
-
}
|
164
|
-
|
165
|
-
private void cleanupAwaitingHandlers() {
|
166
|
-
int out = 0;
|
167
|
-
for (int i = 0; i < mAwaitingHandlersCount; i++) {
|
168
|
-
if (mAwaitingHandlers[i].mIsAwaiting) {
|
169
|
-
mAwaitingHandlers[out++] = mAwaitingHandlers[i];
|
170
|
-
}
|
171
|
-
}
|
172
|
-
mAwaitingHandlersCount = out;
|
173
|
-
}
|
174
|
-
|
175
|
-
void onHandlerStateChange(GestureHandler handler, int newState, int prevState) {
|
176
|
-
mHandlingChangeSemaphore += 1;
|
177
|
-
if (GestureHandler.debug) {
|
178
|
-
Log.d("JS", "GestureHandlerOrchestrator onHandlerStateChange " + handler + " " + prevState + " " + newState);
|
179
|
-
}
|
180
|
-
if (isFinished(newState)) {
|
181
|
-
|
182
|
-
// if there were handlers awaiting completion of this handler, we can trigger
|
183
|
-
// active state
|
184
|
-
for (int i = 0; i < mAwaitingHandlersCount; i++) {
|
185
|
-
GestureHandler otherHandler = mAwaitingHandlers[i];
|
186
|
-
if (shouldHandlerWaitForOther(otherHandler, handler)) {
|
187
|
-
if (newState == GestureHandler.STATE_END) {
|
188
|
-
// gesture has ended, we need to kill the awaiting handler
|
189
|
-
otherHandler.cancel();
|
190
|
-
otherHandler.mIsAwaiting = false;
|
191
|
-
} else {
|
192
|
-
// gesture has failed recognition, we may try activating
|
193
|
-
tryActivate(otherHandler);
|
194
|
-
}
|
195
|
-
}
|
196
|
-
}
|
197
|
-
cleanupAwaitingHandlers();
|
198
|
-
}
|
199
|
-
if (newState == GestureHandler.STATE_ACTIVE) {
|
200
|
-
tryActivate(handler);
|
201
|
-
} else if (prevState == GestureHandler.STATE_ACTIVE || prevState == GestureHandler.STATE_END) {
|
202
|
-
if (handler.mIsActive) {
|
203
|
-
handler.dispatchStateChange(newState, prevState);
|
204
|
-
}
|
205
|
-
} else {
|
206
|
-
handler.dispatchStateChange(newState, prevState);
|
207
|
-
}
|
208
|
-
mHandlingChangeSemaphore -= 1;
|
209
|
-
scheduleFinishedHandlersCleanup();
|
210
|
-
}
|
211
|
-
|
212
|
-
private void makeActive(GestureHandler handler) {
|
213
|
-
int currentState = handler.getState();
|
214
|
-
|
215
|
-
handler.mIsAwaiting = false;
|
216
|
-
handler.mIsActive = true;
|
217
|
-
handler.mActivationIndex = mActivationIndex++;
|
218
|
-
|
219
|
-
int toCancelCount = 0;
|
220
|
-
// Cancel all handlers that are required to be cancel upon current handler's
|
221
|
-
// activation
|
222
|
-
for (int i = 0; i < mGestureHandlersCount; i++) {
|
223
|
-
GestureHandler otherHandler = mGestureHandlers[i];
|
224
|
-
if (shouldHandlerBeCancelledBy(otherHandler, handler)) {
|
225
|
-
mHandlersToCancel[toCancelCount++] = otherHandler;
|
226
|
-
}
|
227
|
-
}
|
228
|
-
|
229
|
-
for (int i = toCancelCount - 1; i >= 0; i--) {
|
230
|
-
mHandlersToCancel[i].cancel();
|
231
|
-
}
|
232
|
-
|
233
|
-
// Clear all awaiting handlers waiting for the current handler to fail
|
234
|
-
for (int i = mAwaitingHandlersCount - 1; i >= 0; i--) {
|
235
|
-
GestureHandler otherHandler = mAwaitingHandlers[i];
|
236
|
-
if (shouldHandlerBeCancelledBy(otherHandler, handler)) {
|
237
|
-
otherHandler.cancel();
|
238
|
-
otherHandler.mIsAwaiting = false;
|
239
|
-
}
|
240
|
-
}
|
241
|
-
cleanupAwaitingHandlers();
|
242
|
-
|
243
|
-
// Dispatch state change event if handler is no longer in the active state we
|
244
|
-
// should also
|
245
|
-
// trigger END state change and UNDETERMINED state change if necessary
|
246
|
-
handler.dispatchStateChange(GestureHandler.STATE_ACTIVE, GestureHandler.STATE_BEGAN);
|
247
|
-
if (currentState != GestureHandler.STATE_ACTIVE) {
|
248
|
-
handler.dispatchStateChange(GestureHandler.STATE_END, GestureHandler.STATE_ACTIVE);
|
249
|
-
if (currentState != GestureHandler.STATE_END) {
|
250
|
-
handler.dispatchStateChange(GestureHandler.STATE_UNDETERMINED, GestureHandler.STATE_END);
|
251
|
-
}
|
252
|
-
}
|
253
|
-
}
|
254
|
-
|
255
|
-
public void deliverEventToGestureHandlers(MotionEvent event) {
|
256
|
-
// Copy handlers to "prepared handlers" array, because the list of active
|
257
|
-
// handlers can change
|
258
|
-
// as a result of state updates
|
259
|
-
int handlersCount = mGestureHandlersCount;
|
260
|
-
System.arraycopy(mGestureHandlers, 0, mPreparedHandlers, 0, handlersCount);
|
261
|
-
// We want to deliver events to active handlers first in order of their
|
262
|
-
// activation (handlers
|
263
|
-
// that activated first will first get event delivered). Otherwise we deliver
|
264
|
-
// events in the
|
265
|
-
// order in which handlers has been added ("most direct" children goes first).
|
266
|
-
// Therefore we rely
|
267
|
-
// on Arrays.sort providing a stable sort (as children are registered in order
|
268
|
-
// in which they
|
269
|
-
// should be tested)
|
270
|
-
Arrays.sort(mPreparedHandlers, 0, handlersCount, sHandlersComparator);
|
271
|
-
for (int i = 0; i < handlersCount; i++) {
|
272
|
-
deliverEventToGestureHandler(mPreparedHandlers[i], event);
|
273
|
-
}
|
274
|
-
}
|
275
|
-
|
276
|
-
private void cancelAll() {
|
277
|
-
for (int i = mAwaitingHandlersCount - 1; i >= 0; i--) {
|
278
|
-
mAwaitingHandlers[i].cancel();
|
279
|
-
}
|
280
|
-
// Copy handlers to "prepared handlers" array, because the list of active
|
281
|
-
// handlers can change
|
282
|
-
// as a result of state updates
|
283
|
-
int handlersCount = mGestureHandlersCount;
|
284
|
-
for (int i = 0; i < handlersCount; i++) {
|
285
|
-
mPreparedHandlers[i] = mGestureHandlers[i];
|
286
|
-
}
|
287
|
-
for (int i = handlersCount - 1; i >= 0; i--) {
|
288
|
-
mPreparedHandlers[i].cancel();
|
289
|
-
}
|
290
|
-
}
|
291
|
-
|
292
|
-
private void deliverEventToGestureHandler(GestureHandler handler, MotionEvent event) {
|
293
|
-
if (!isViewAttachedUnderWrapper(handler.getView())) {
|
294
|
-
handler.cancel();
|
295
|
-
return;
|
296
|
-
}
|
297
|
-
if (!handler.wantEvents(event)) {
|
298
|
-
return;
|
299
|
-
}
|
300
|
-
int action = event.getActionMasked();
|
301
|
-
if (handler.mIsAwaiting && action == MotionEvent.ACTION_MOVE) {
|
302
|
-
return;
|
303
|
-
}
|
304
|
-
float[] coords = sTempCoords;
|
305
|
-
extractCoordsForView(handler.getView(), event, coords);
|
306
|
-
float oldX = event.getX();
|
307
|
-
float oldY = event.getY();
|
308
|
-
// TODO: we may conside scaling events if necessary using MotionEvent.transform
|
309
|
-
// for now the events are only offset to the top left corner of the view but if
|
310
|
-
// view or any ot the parents is scaled the other pointers position will not
|
311
|
-
// reflect
|
312
|
-
// their actual place in the view. On the other hand not scaling seems like a
|
313
|
-
// better
|
314
|
-
// approach when we want to use pointer coordinates to calculate velocity or
|
315
|
-
// distance
|
316
|
-
// for pinch so I don't know yet if we should transform or not...
|
317
|
-
event.setLocation(coords[0], coords[1]);
|
318
|
-
handler.handle(event);
|
319
|
-
if (handler.mIsActive) {
|
320
|
-
handler.dispatchTouchEvent(event);
|
321
|
-
}
|
322
|
-
event.setLocation(oldX, oldY);
|
323
|
-
// if event was of type UP or POINTER_UP we request handler to stop tracking now
|
324
|
-
// that
|
325
|
-
// the event has been dispatched
|
326
|
-
if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_POINTER_UP) {
|
327
|
-
int pointerId = event.getPointerId(event.getActionIndex());
|
328
|
-
handler.stopTrackingPointer(pointerId);
|
329
|
-
}
|
330
|
-
}
|
331
|
-
|
332
|
-
/**
|
333
|
-
* isViewAttachedUnderWrapper checks whether all of parents for view related to
|
334
|
-
* handler view are attached. Since there might be an issue rarely observed when
|
335
|
-
* view has been detached and handler's state hasn't been change to canceled,
|
336
|
-
* failed or ended yet. Probably it's a result of some race condition and
|
337
|
-
* stopping delivering for this handler and changing its state to failed of end
|
338
|
-
* appear to be good enough solution.
|
339
|
-
*/
|
340
|
-
private boolean isViewAttachedUnderWrapper(@Nullable View view) {
|
341
|
-
if (view == null) {
|
342
|
-
return false;
|
343
|
-
}
|
344
|
-
if (view == mWrapperView) {
|
345
|
-
return true;
|
346
|
-
}
|
347
|
-
@Nullable
|
348
|
-
ViewParent parent = view.getParent();
|
349
|
-
while (parent != null && parent != mWrapperView) {
|
350
|
-
parent = parent.getParent();
|
351
|
-
}
|
352
|
-
return parent == mWrapperView;
|
353
|
-
}
|
354
|
-
|
355
|
-
private void extractCoordsForView(View view, MotionEvent event, float[] outputCoords) {
|
356
|
-
if (view == mWrapperView) {
|
357
|
-
outputCoords[0] = event.getX();
|
358
|
-
outputCoords[1] = event.getY();
|
359
|
-
return;
|
360
|
-
}
|
361
|
-
if (view == null || !(view.getParent() instanceof ViewGroup)) {
|
362
|
-
throw new IllegalArgumentException("Parent is null? View is no longer in the tree");
|
363
|
-
}
|
364
|
-
ViewGroup parent = (ViewGroup) view.getParent();
|
365
|
-
extractCoordsForView(parent, event, outputCoords);
|
366
|
-
PointF childPoint = sTempPoint;
|
367
|
-
transformTouchPointToViewCoords(outputCoords[0], outputCoords[1], parent, view, childPoint);
|
368
|
-
outputCoords[0] = childPoint.x;
|
369
|
-
outputCoords[1] = childPoint.y;
|
370
|
-
}
|
371
|
-
|
372
|
-
private void addAwaitingHandler(GestureHandler handler) {
|
373
|
-
for (int i = 0; i < mAwaitingHandlersCount; i++) {
|
374
|
-
if (mAwaitingHandlers[i] == handler) {
|
375
|
-
return;
|
376
|
-
}
|
377
|
-
}
|
378
|
-
if (mAwaitingHandlersCount >= mAwaitingHandlers.length) {
|
379
|
-
throw new IllegalStateException("Too many recognizers");
|
380
|
-
}
|
381
|
-
mAwaitingHandlers[mAwaitingHandlersCount++] = handler;
|
382
|
-
handler.mIsAwaiting = true;
|
383
|
-
handler.mActivationIndex = mActivationIndex++;
|
384
|
-
}
|
385
|
-
|
386
|
-
private void recordHandlerIfNotPresent(GestureHandler handler, View view) {
|
387
|
-
for (int i = 0; i < mGestureHandlersCount; i++) {
|
388
|
-
if (mGestureHandlers[i] == handler) {
|
389
|
-
return;
|
390
|
-
}
|
391
|
-
}
|
392
|
-
if (mGestureHandlersCount >= mGestureHandlers.length) {
|
393
|
-
throw new IllegalStateException("Too many recognizers");
|
394
|
-
}
|
395
|
-
mGestureHandlers[mGestureHandlersCount++] = handler;
|
396
|
-
handler.mIsActive = false;
|
397
|
-
handler.mIsAwaiting = false;
|
398
|
-
handler.mActivationIndex = Integer.MAX_VALUE;
|
399
|
-
handler.prepare(view, this);
|
400
|
-
}
|
401
|
-
|
402
|
-
private boolean recordViewHandlersForPointer(View view, float[] coords, int pointerId) {
|
403
|
-
ArrayList<GestureHandler> handlers = mHandlerRegistry.getHandlersForView(view);
|
404
|
-
boolean found = false;
|
405
|
-
if (handlers != null) {
|
406
|
-
for (int i = 0, size = handlers.size(); i < size; i++) {
|
407
|
-
GestureHandler handler = handlers.get(i);
|
408
|
-
if (handler.isEnabled() && handler.isWithinBounds(view, coords[0], coords[1])) {
|
409
|
-
recordHandlerIfNotPresent(handler, view);
|
410
|
-
handler.startTrackingPointer(pointerId);
|
411
|
-
found = true;
|
412
|
-
}
|
413
|
-
}
|
414
|
-
}
|
415
|
-
return found;
|
416
|
-
}
|
417
|
-
|
418
|
-
private void extractGestureHandlers(MotionEvent event) {
|
419
|
-
int actionIndex = event.getActionIndex();
|
420
|
-
int pointerId = event.getPointerId(actionIndex);
|
421
|
-
sTempCoords[0] = event.getX(actionIndex);
|
422
|
-
sTempCoords[1] = event.getY(actionIndex);
|
423
|
-
traverseWithPointerEvents(mWrapperView, sTempCoords, pointerId);
|
424
|
-
extractGestureHandlers(mWrapperView, sTempCoords, pointerId);
|
425
|
-
}
|
426
|
-
|
427
|
-
private boolean extractGestureHandlers(ViewGroup viewGroup, float[] coords, int pointerId) {
|
428
|
-
int childrenCount = viewGroup.getChildCount();
|
429
|
-
for (int i = childrenCount - 1; i >= 0; i--) {
|
430
|
-
View child = mViewConfigHelper.getChildInDrawingOrderAtIndex(viewGroup, i);
|
431
|
-
if (canReceiveEvents(child)) {
|
432
|
-
PointF childPoint = sTempPoint;
|
433
|
-
transformTouchPointToViewCoords(coords[0], coords[1], viewGroup, child, childPoint);
|
434
|
-
float restoreX = coords[0];
|
435
|
-
float restoreY = coords[1];
|
436
|
-
coords[0] = childPoint.x;
|
437
|
-
coords[1] = childPoint.y;
|
438
|
-
boolean found = false;
|
439
|
-
if (!isClipping(child) || isTransformedTouchPointInView(coords[0], coords[1], child)) {
|
440
|
-
// we only consider the view if touch is inside the view bounds or if the view's
|
441
|
-
// children
|
442
|
-
// can render outside of the view bounds (overflow visible)
|
443
|
-
found = traverseWithPointerEvents(child, coords, pointerId);
|
444
|
-
}
|
445
|
-
coords[0] = restoreX;
|
446
|
-
coords[1] = restoreY;
|
447
|
-
if (found) {
|
448
|
-
return true;
|
449
|
-
}
|
450
|
-
}
|
451
|
-
}
|
452
|
-
return false;
|
453
|
-
}
|
454
|
-
|
455
|
-
private static boolean shouldHandlerlessViewBecomeTouchTarget(View view, float coords[]) {
|
456
|
-
// The following code is to match the iOS behavior where transparent parts of
|
457
|
-
// the views can
|
458
|
-
// pass touch events through them allowing sibling nodes to handle them.
|
459
|
-
|
460
|
-
// TODO: this is not an ideal solution as we only consider ViewGroups that has
|
461
|
-
// no background set
|
462
|
-
// TODO: ideally we should determine the pixel color under the given coordinates
|
463
|
-
// and return
|
464
|
-
// false if the color is transparent
|
465
|
-
boolean isLeafOrTransparent = !(view instanceof ViewGroup) || view.getBackground() != null;
|
466
|
-
return isLeafOrTransparent && isTransformedTouchPointInView(coords[0], coords[1], view);
|
467
|
-
}
|
468
|
-
|
469
|
-
private boolean traverseWithPointerEvents(View view, float coords[], int pointerId) {
|
470
|
-
PointerEventsConfig pointerEvents = mViewConfigHelper.getPointerEventsConfigForView(view);
|
471
|
-
if (pointerEvents == PointerEventsConfig.NONE) {
|
472
|
-
// This view and its children can't be the target
|
473
|
-
return false;
|
474
|
-
} else if (pointerEvents == PointerEventsConfig.BOX_ONLY) {
|
475
|
-
// This view is the target, its children don't matter
|
476
|
-
return recordViewHandlersForPointer(view, coords, pointerId)
|
477
|
-
|| shouldHandlerlessViewBecomeTouchTarget(view, coords);
|
478
|
-
} else if (pointerEvents == PointerEventsConfig.BOX_NONE) {
|
479
|
-
// This view can't be the target, but its children might
|
480
|
-
if (view instanceof ViewGroup) {
|
481
|
-
return extractGestureHandlers((ViewGroup) view, coords, pointerId);
|
482
|
-
}
|
483
|
-
return false;
|
484
|
-
} else if (pointerEvents == PointerEventsConfig.AUTO) {
|
485
|
-
// Either this view or one of its children is the target
|
486
|
-
boolean found = false;
|
487
|
-
if (view instanceof ViewGroup) {
|
488
|
-
found = extractGestureHandlers((ViewGroup) view, coords, pointerId);
|
489
|
-
}
|
490
|
-
return recordViewHandlersForPointer(view, coords, pointerId) || found
|
491
|
-
|| shouldHandlerlessViewBecomeTouchTarget(view, coords);
|
492
|
-
} else {
|
493
|
-
throw new IllegalArgumentException("Unknown pointer event type: " + pointerEvents.toString());
|
494
|
-
}
|
495
|
-
}
|
496
|
-
|
497
|
-
private boolean canReceiveEvents(View view) {
|
498
|
-
return view.getVisibility() == View.VISIBLE && view.getAlpha() >= mMinAlphaForTraversal;
|
499
|
-
}
|
500
|
-
|
501
|
-
private static void transformTouchPointToViewCoords(float x, float y, ViewGroup parent, View child,
|
502
|
-
PointF outLocalPoint) {
|
503
|
-
float localX = x + parent.getScrollX() - child.getLeft();
|
504
|
-
float localY = y + parent.getScrollY() - child.getTop();
|
505
|
-
Matrix matrix = child.getMatrix();
|
506
|
-
if (!matrix.isIdentity()) {
|
507
|
-
float[] localXY = sMatrixTransformCoords;
|
508
|
-
localXY[0] = localX;
|
509
|
-
localXY[1] = localY;
|
510
|
-
Matrix inverseMatrix = sInverseMatrix;
|
511
|
-
matrix.invert(inverseMatrix);
|
512
|
-
inverseMatrix.mapPoints(localXY);
|
513
|
-
localX = localXY[0];
|
514
|
-
localY = localXY[1];
|
515
|
-
}
|
516
|
-
outLocalPoint.set(localX, localY);
|
517
|
-
}
|
518
|
-
|
519
|
-
private boolean isClipping(View view) {
|
520
|
-
// if view is not a view group it is clipping, otherwise we check for
|
521
|
-
// `getClipChildren` flag to
|
522
|
-
// be turned on and also confirm with the ViewConfigHelper implementation
|
523
|
-
return !(view instanceof ViewGroup) || mViewConfigHelper.isViewClippingChildren((ViewGroup) view);
|
524
|
-
}
|
525
|
-
|
526
|
-
private static boolean isTransformedTouchPointInView(float x, float y, View child) {
|
527
|
-
return x >= 0 && x <= child.getWidth() && y >= 0 && y < child.getHeight();
|
528
|
-
}
|
529
|
-
|
530
|
-
private static boolean shouldHandlerWaitForOther(GestureHandler handler, GestureHandler other) {
|
531
|
-
return handler != other
|
532
|
-
&& (handler.shouldWaitForHandlerFailure(other) || other.shouldRequireToWaitForFailure(handler));
|
533
|
-
}
|
534
|
-
|
535
|
-
private static boolean canRunSimultaneously(GestureHandler a, GestureHandler b) {
|
536
|
-
return a == b || a.shouldRecognizeSimultaneously(b) || b.shouldRecognizeSimultaneously(a);
|
537
|
-
}
|
538
|
-
|
539
|
-
private static boolean shouldHandlerBeCancelledBy(GestureHandler handler, GestureHandler other) {
|
540
|
-
|
541
|
-
if (GestureHandler.debug) {
|
542
|
-
Log.d("JS", "GestureHandlerOrchestrator shouldHandlerBeCancelledBy " + handler + " " + other + " " + handler.hasCommonPointers(other) + " " + canRunSimultaneously(handler, other) + " " + handler.shouldBeCancelledBy(other));
|
543
|
-
}
|
544
|
-
if (!handler.hasCommonPointers(other)) {
|
545
|
-
// if two handlers share no common pointer one can never trigger cancel for the
|
546
|
-
// other
|
547
|
-
return false;
|
548
|
-
}
|
549
|
-
if (canRunSimultaneously(handler, other)) {
|
550
|
-
// if handlers are allowed to run simultaneously, when first activates second
|
551
|
-
// can still remain
|
552
|
-
// in began state
|
553
|
-
return false;
|
554
|
-
}
|
555
|
-
if (handler != other && (handler.mIsAwaiting || handler.getState() == GestureHandler.STATE_ACTIVE)) {
|
556
|
-
// in every other case as long as the handler is about to be activated or
|
557
|
-
// already in active
|
558
|
-
// state, we delegate the decision to the implementation of
|
559
|
-
// GestureHandler#shouldBeCancelledBy
|
560
|
-
return handler.shouldBeCancelledBy(other);
|
561
|
-
}
|
562
|
-
return true;
|
563
|
-
}
|
564
|
-
|
565
|
-
private static boolean isFinished(int state) {
|
566
|
-
return state == GestureHandler.STATE_CANCELLED || state == GestureHandler.STATE_FAILED
|
567
|
-
|| state == GestureHandler.STATE_END;
|
568
|
-
}
|
569
|
-
}
|
@@ -1,97 +0,0 @@
|
|
1
|
-
package com.swmansion.gesturehandler;
|
2
|
-
|
3
|
-
import android.util.SparseArray;
|
4
|
-
import android.view.View;
|
5
|
-
|
6
|
-
import com.swmansion.gesturehandler.GestureHandler;
|
7
|
-
import com.swmansion.gesturehandler.GestureHandlerRegistry;
|
8
|
-
|
9
|
-
import java.util.ArrayList;
|
10
|
-
import java.util.WeakHashMap;
|
11
|
-
|
12
|
-
import androidx.annotation.Nullable;
|
13
|
-
|
14
|
-
public class GestureHandlerRegistryImpl implements GestureHandlerRegistry {
|
15
|
-
|
16
|
-
private final SparseArray<GestureHandler> mHandlers = new SparseArray<>();
|
17
|
-
private final SparseArray<View> mAttachedTo = new SparseArray<>();
|
18
|
-
// private final SparseArray<ArrayList<GestureHandler>> mHandlersForView = new
|
19
|
-
// SparseArray<>();
|
20
|
-
private WeakHashMap<View, ArrayList<GestureHandler>> mHandlersForView = new WeakHashMap<>();
|
21
|
-
|
22
|
-
public synchronized void registerHandler(GestureHandler handler) {
|
23
|
-
mHandlers.put(handler.getTag(), handler);
|
24
|
-
}
|
25
|
-
|
26
|
-
public synchronized @Nullable GestureHandler getHandler(int handlerTag) {
|
27
|
-
return mHandlers.get(handlerTag);
|
28
|
-
}
|
29
|
-
|
30
|
-
public synchronized boolean attachHandlerToView(int handlerTag, android.view.View view) {
|
31
|
-
GestureHandler handler = mHandlers.get(handlerTag);
|
32
|
-
if (handler != null) {
|
33
|
-
detachHandler(handler);
|
34
|
-
registerHandlerForView(view, handler);
|
35
|
-
return true;
|
36
|
-
} else {
|
37
|
-
return false;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
|
41
|
-
public synchronized void registerHandlerForView(android.view.View view, GestureHandler handler) {
|
42
|
-
if (mAttachedTo.get(handler.getTag()) != null) {
|
43
|
-
throw new IllegalStateException("Handler " + handler + " already attached");
|
44
|
-
}
|
45
|
-
mAttachedTo.put(handler.getTag(), view);
|
46
|
-
ArrayList<GestureHandler> listToAdd = mHandlersForView.get(view);
|
47
|
-
if (listToAdd == null) {
|
48
|
-
listToAdd = new ArrayList<>(1);
|
49
|
-
listToAdd.add(handler);
|
50
|
-
mHandlersForView.put(view, listToAdd);
|
51
|
-
} else {
|
52
|
-
listToAdd.add(handler);
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
public synchronized void detachHandler(GestureHandler handler) {
|
57
|
-
View attachedToView = mAttachedTo.get(handler.getTag());
|
58
|
-
if (attachedToView != null) {
|
59
|
-
mAttachedTo.remove(handler.getTag());
|
60
|
-
ArrayList<GestureHandler> attachedHandlers = mHandlersForView.get(attachedToView);
|
61
|
-
if (attachedHandlers != null) {
|
62
|
-
attachedHandlers.remove(handler);
|
63
|
-
if (attachedHandlers.size() == 0) {
|
64
|
-
mHandlersForView.remove(attachedToView);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
}
|
68
|
-
if (handler.getView() != null) {
|
69
|
-
// Handler is in "prepared" state which means it is registered in the
|
70
|
-
// orchestrator and can
|
71
|
-
// receive touch events. This means that before we remove it from the registry
|
72
|
-
// we need to
|
73
|
-
// "cancel" it so that orchestrator does no longer keep a reference to it.
|
74
|
-
handler.cancel();
|
75
|
-
}
|
76
|
-
}
|
77
|
-
|
78
|
-
public synchronized void dropHandler(int handlerTag) {
|
79
|
-
GestureHandler handler = mHandlers.get(handlerTag);
|
80
|
-
if (handler != null) {
|
81
|
-
detachHandler(handler);
|
82
|
-
mHandlers.remove(handlerTag);
|
83
|
-
}
|
84
|
-
}
|
85
|
-
|
86
|
-
public synchronized void dropAllHandlers() {
|
87
|
-
mHandlers.clear();
|
88
|
-
mAttachedTo.clear();
|
89
|
-
mHandlersForView.clear();
|
90
|
-
}
|
91
|
-
|
92
|
-
@Override
|
93
|
-
public synchronized ArrayList<GestureHandler> getHandlersForView(android.view.View view) {
|
94
|
-
return mHandlersForView.get(view);
|
95
|
-
}
|
96
|
-
|
97
|
-
}
|