@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,51 +0,0 @@
|
|
1
|
-
package com.swmansion.gesturehandler;
|
2
|
-
|
3
|
-
import android.view.MotionEvent;
|
4
|
-
|
5
|
-
public class GestureUtils {
|
6
|
-
public static float getLastPointerX(MotionEvent event, boolean averageTouches) {
|
7
|
-
float offset = event.getRawX() - event.getX();
|
8
|
-
int excludeIndex = event.getActionMasked() == MotionEvent.ACTION_POINTER_UP ? event.getActionIndex() : -1;
|
9
|
-
|
10
|
-
if (averageTouches) {
|
11
|
-
float sum = 0f;
|
12
|
-
int count = 0;
|
13
|
-
for (int i = 0, size = event.getPointerCount(); i < size; i++) {
|
14
|
-
if (i != excludeIndex) {
|
15
|
-
sum += event.getX(i) + offset;
|
16
|
-
count++;
|
17
|
-
}
|
18
|
-
}
|
19
|
-
return sum / count;
|
20
|
-
} else {
|
21
|
-
int lastPointerIdx = event.getPointerCount() - 1;
|
22
|
-
if (lastPointerIdx == excludeIndex) {
|
23
|
-
lastPointerIdx--;
|
24
|
-
}
|
25
|
-
return event.getX(lastPointerIdx) + offset;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
public static float getLastPointerY(MotionEvent event, boolean averageTouches) {
|
30
|
-
float offset = event.getRawY() - event.getY();
|
31
|
-
int excludeIndex = event.getActionMasked() == MotionEvent.ACTION_POINTER_UP ? event.getActionIndex() : -1;
|
32
|
-
|
33
|
-
if (averageTouches) {
|
34
|
-
float sum = 0f;
|
35
|
-
int count = 0;
|
36
|
-
for (int i = 0, size = event.getPointerCount(); i < size; i++) {
|
37
|
-
if (i != excludeIndex) {
|
38
|
-
sum += event.getY(i) + offset;
|
39
|
-
count++;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
return sum / count;
|
43
|
-
} else {
|
44
|
-
int lastPointerIdx = event.getPointerCount() - 1;
|
45
|
-
if (lastPointerIdx == excludeIndex) {
|
46
|
-
lastPointerIdx -= 1;
|
47
|
-
}
|
48
|
-
return event.getY(lastPointerIdx) + offset;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
}
|
@@ -1,77 +0,0 @@
|
|
1
|
-
package com.swmansion.gesturehandler;
|
2
|
-
|
3
|
-
import android.content.Context;
|
4
|
-
import android.os.Handler;
|
5
|
-
import android.view.MotionEvent;
|
6
|
-
|
7
|
-
public class LongPressGestureHandler extends GestureHandler<LongPressGestureHandler> {
|
8
|
-
|
9
|
-
private static final long DEFAULT_MIN_DURATION_MS = 500; // 1 sec
|
10
|
-
private static float DEFAULT_MAX_DIST_DP = 10; // 20dp
|
11
|
-
|
12
|
-
private long mMinDurationMs = DEFAULT_MIN_DURATION_MS;
|
13
|
-
private float mMaxDistSq;
|
14
|
-
private float mStartX, mStartY;
|
15
|
-
private Handler mHandler;
|
16
|
-
|
17
|
-
public LongPressGestureHandler(Context context) {
|
18
|
-
setShouldCancelWhenOutside(true);
|
19
|
-
mMaxDistSq = DEFAULT_MAX_DIST_DP * context.getResources().getDisplayMetrics().density;
|
20
|
-
}
|
21
|
-
|
22
|
-
public void setMinDurationMs(long minDurationMs) {
|
23
|
-
mMinDurationMs = minDurationMs;
|
24
|
-
}
|
25
|
-
|
26
|
-
public LongPressGestureHandler setMaxDist(float maxDist) {
|
27
|
-
mMaxDistSq = maxDist * maxDist;
|
28
|
-
return this;
|
29
|
-
}
|
30
|
-
|
31
|
-
@Override
|
32
|
-
protected void onHandle(MotionEvent event) {
|
33
|
-
if (getState() == STATE_UNDETERMINED) {
|
34
|
-
begin();
|
35
|
-
mStartX = event.getRawX();
|
36
|
-
mStartY = event.getRawY();
|
37
|
-
mHandler = new Handler();
|
38
|
-
mHandler.postDelayed(new Runnable() {
|
39
|
-
@Override
|
40
|
-
public void run() {
|
41
|
-
activate();
|
42
|
-
}
|
43
|
-
}, mMinDurationMs);
|
44
|
-
}
|
45
|
-
if (event.getActionMasked() == MotionEvent.ACTION_UP) {
|
46
|
-
if (mHandler != null) {
|
47
|
-
mHandler.removeCallbacksAndMessages(null);
|
48
|
-
mHandler = null;
|
49
|
-
}
|
50
|
-
if (getState() == STATE_ACTIVE) {
|
51
|
-
end();
|
52
|
-
} else {
|
53
|
-
fail();
|
54
|
-
}
|
55
|
-
} else {
|
56
|
-
// calculate distance from start
|
57
|
-
float deltaX = event.getRawX() - mStartX;
|
58
|
-
float deltaY = event.getRawY() - mStartY;
|
59
|
-
float distSq = deltaX * deltaX + deltaY * deltaY;
|
60
|
-
if (distSq > mMaxDistSq) {
|
61
|
-
if (getState() == STATE_ACTIVE) {
|
62
|
-
cancel();
|
63
|
-
} else {
|
64
|
-
fail();
|
65
|
-
}
|
66
|
-
}
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
@Override
|
71
|
-
protected void onStateChange(int newState, int previousState) {
|
72
|
-
if (mHandler != null) {
|
73
|
-
mHandler.removeCallbacksAndMessages(null);
|
74
|
-
mHandler = null;
|
75
|
-
}
|
76
|
-
}
|
77
|
-
}
|
@@ -1,141 +0,0 @@
|
|
1
|
-
package com.swmansion.gesturehandler;
|
2
|
-
|
3
|
-
import android.os.SystemClock;
|
4
|
-
import android.view.MotionEvent;
|
5
|
-
import android.view.View;
|
6
|
-
import android.view.ViewGroup;
|
7
|
-
|
8
|
-
import android.util.Log;
|
9
|
-
|
10
|
-
public class NativeViewGestureHandler extends GestureHandler<NativeViewGestureHandler> {
|
11
|
-
|
12
|
-
private boolean mShouldActivateOnStart = false;
|
13
|
-
private boolean mDisallowInterruption = false;
|
14
|
-
|
15
|
-
public NativeViewGestureHandler() {
|
16
|
-
setShouldCancelWhenOutside(true);
|
17
|
-
}
|
18
|
-
|
19
|
-
public NativeViewGestureHandler setShouldActivateOnStart(boolean shouldActivateOnStart) {
|
20
|
-
mShouldActivateOnStart = shouldActivateOnStart;
|
21
|
-
return this;
|
22
|
-
}
|
23
|
-
|
24
|
-
/**
|
25
|
-
* Set this to {@code true} when wrapping native components that are supposed to
|
26
|
-
* be an exclusive target for a touch stream. Like for example switch or slider
|
27
|
-
* component which when activated aren't supposed to be cancelled by scrollview
|
28
|
-
* or other container that may also handle touches.
|
29
|
-
*/
|
30
|
-
public NativeViewGestureHandler setDisallowInterruption(boolean disallowInterruption) {
|
31
|
-
mDisallowInterruption = disallowInterruption;
|
32
|
-
return this;
|
33
|
-
}
|
34
|
-
|
35
|
-
@Override
|
36
|
-
public boolean shouldRequireToWaitForFailure(GestureHandler handler) {
|
37
|
-
return super.shouldRequireToWaitForFailure(handler);
|
38
|
-
}
|
39
|
-
|
40
|
-
@Override
|
41
|
-
public boolean shouldRecognizeSimultaneously(GestureHandler handler) {
|
42
|
-
if (handler instanceof NativeViewGestureHandler) {
|
43
|
-
// Special case when the peer handler is also an instance of
|
44
|
-
// NativeViewGestureHandler:
|
45
|
-
// For the `disallowInterruption` to work correctly we need to check the
|
46
|
-
// property when
|
47
|
-
// accessed as a peer, because simultaneous recognizers can be set on either
|
48
|
-
// side of the
|
49
|
-
// connection.
|
50
|
-
NativeViewGestureHandler nativeWrapper = (NativeViewGestureHandler) handler;
|
51
|
-
if (nativeWrapper.getState() == STATE_ACTIVE && nativeWrapper.mDisallowInterruption) {
|
52
|
-
// other handler is active and it disallows interruption, we don't want to get
|
53
|
-
// into its way
|
54
|
-
return false;
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
boolean canBeInterrupted = !mDisallowInterruption;
|
59
|
-
|
60
|
-
if (GestureHandler.debug) {
|
61
|
-
Log.d("JS", "NativeViewGestureHandler shouldRecognizeSimultaneously " + canBeInterrupted);
|
62
|
-
}
|
63
|
-
int state = getState();
|
64
|
-
int otherState = handler.getState();
|
65
|
-
|
66
|
-
if (state == STATE_ACTIVE && otherState == STATE_ACTIVE && canBeInterrupted) {
|
67
|
-
// if both handlers are active and the current handler can be interruped it we
|
68
|
-
// return `false`
|
69
|
-
// as it means the other handler has turned active and returning `true` would
|
70
|
-
// prevent it from
|
71
|
-
// interrupting the current handler
|
72
|
-
return false;
|
73
|
-
}
|
74
|
-
// otherwise we can only return `true` if already in an active state
|
75
|
-
return state == STATE_ACTIVE && canBeInterrupted;
|
76
|
-
}
|
77
|
-
|
78
|
-
@Override
|
79
|
-
public boolean shouldBeCancelledBy(GestureHandler handler) {
|
80
|
-
|
81
|
-
// if (GestureHandler.debug) {
|
82
|
-
// Log.d("JS", "NativeViewGestureHandler shouldBeCancelledBy " + mDisallowInterruption);
|
83
|
-
// }
|
84
|
-
return !mDisallowInterruption;
|
85
|
-
}
|
86
|
-
|
87
|
-
@Override
|
88
|
-
protected void onHandle(MotionEvent event) {
|
89
|
-
View view = getView();
|
90
|
-
int state = getState();
|
91
|
-
if (GestureHandler.debug) {
|
92
|
-
Log.d("JS", "NativeViewGestureHandler onHandle " + state + " " + view +" " + event.getActionMasked() + " " + " " + mShouldActivateOnStart);
|
93
|
-
}
|
94
|
-
if (event.getActionMasked() == MotionEvent.ACTION_UP) {
|
95
|
-
view.dispatchTouchEvent(event);
|
96
|
-
if ((state == STATE_UNDETERMINED || state == STATE_BEGAN) && view.isPressed()) {
|
97
|
-
activate();
|
98
|
-
}
|
99
|
-
end();
|
100
|
-
} else if (state == STATE_UNDETERMINED || state == STATE_BEGAN) {
|
101
|
-
|
102
|
-
if (mShouldActivateOnStart) {
|
103
|
-
tryIntercept(view, event);
|
104
|
-
view.dispatchTouchEvent(event);
|
105
|
-
activate();
|
106
|
-
} else if (tryIntercept(view, event)) {
|
107
|
-
view.dispatchTouchEvent(event);
|
108
|
-
activate();
|
109
|
-
} else if (state != STATE_BEGAN) {
|
110
|
-
begin();
|
111
|
-
}
|
112
|
-
} else if (state == STATE_ACTIVE) {
|
113
|
-
view.dispatchTouchEvent(event);
|
114
|
-
}
|
115
|
-
}
|
116
|
-
|
117
|
-
private static boolean tryIntercept(View view, MotionEvent event) {
|
118
|
-
if (view instanceof ViewGroup && ((ViewGroup) view).onInterceptTouchEvent(event)) {
|
119
|
-
// if (GestureHandler.debug) {
|
120
|
-
// Log.d("JS", "NativeViewGestureHandler tryIntercept true");
|
121
|
-
// }
|
122
|
-
return true;
|
123
|
-
}
|
124
|
-
// if (GestureHandler.debug) {
|
125
|
-
// Log.d("JS", "NativeViewGestureHandler tryIntercept false");
|
126
|
-
// }
|
127
|
-
return false;
|
128
|
-
}
|
129
|
-
|
130
|
-
@Override
|
131
|
-
protected void onCancel() {
|
132
|
-
|
133
|
-
if (GestureHandler.debug) {
|
134
|
-
Log.d("JS", "NativeViewGestureHandler onCancel " + getView());
|
135
|
-
}
|
136
|
-
long time = SystemClock.uptimeMillis();
|
137
|
-
MotionEvent event = MotionEvent.obtain(time, time, MotionEvent.ACTION_CANCEL, 0, 0, 0);
|
138
|
-
event.setAction(MotionEvent.ACTION_CANCEL);
|
139
|
-
getView().onTouchEvent(event);
|
140
|
-
}
|
141
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
package com.swmansion.gesturehandler;
|
2
|
-
|
3
|
-
import android.view.MotionEvent;
|
4
|
-
|
5
|
-
public interface OnTouchEventListener<T extends GestureHandler> {
|
6
|
-
boolean shouldStartGesture(T handler, MotionEvent event);
|
7
|
-
|
8
|
-
void onTouchEvent(T handler, MotionEvent event);
|
9
|
-
|
10
|
-
void onStateChange(T handler, int newState, int oldState);
|
11
|
-
}
|
@@ -1,320 +0,0 @@
|
|
1
|
-
package com.swmansion.gesturehandler;
|
2
|
-
|
3
|
-
import android.util.Log;
|
4
|
-
|
5
|
-
import android.content.Context;
|
6
|
-
import android.view.MotionEvent;
|
7
|
-
import android.view.VelocityTracker;
|
8
|
-
import android.view.ViewConfiguration;
|
9
|
-
|
10
|
-
public class PanGestureHandler extends GestureHandler<PanGestureHandler> {
|
11
|
-
private final String TAG = "PanGestureHandler";
|
12
|
-
|
13
|
-
private static float MIN_VALUE_IGNORE = Float.MAX_VALUE;
|
14
|
-
private static float MAX_VALUE_IGNORE = Float.MIN_VALUE;
|
15
|
-
|
16
|
-
private static int DEFAULT_MIN_POINTERS = 1;
|
17
|
-
private static int DEFAULT_MAX_POINTERS = 10;
|
18
|
-
|
19
|
-
private float mMinDistSq = MAX_VALUE_IGNORE;
|
20
|
-
|
21
|
-
private float mActiveOffsetXStart = MIN_VALUE_IGNORE;
|
22
|
-
private float mActiveOffsetXEnd = MAX_VALUE_IGNORE;
|
23
|
-
|
24
|
-
private float mFailOffsetXStart = MAX_VALUE_IGNORE;
|
25
|
-
private float mFailOffsetXEnd = MIN_VALUE_IGNORE;
|
26
|
-
|
27
|
-
private float mActiveOffsetYStart = MIN_VALUE_IGNORE;
|
28
|
-
private float mActiveOffsetYEnd = MAX_VALUE_IGNORE;
|
29
|
-
|
30
|
-
private float mFailOffsetYStart = MAX_VALUE_IGNORE;
|
31
|
-
private float mFailOffsetYEnd = MIN_VALUE_IGNORE;
|
32
|
-
|
33
|
-
private float mMinVelocityX = MIN_VALUE_IGNORE;
|
34
|
-
private float mMinVelocityY = MIN_VALUE_IGNORE;
|
35
|
-
private float mMinVelocitySq = MIN_VALUE_IGNORE;
|
36
|
-
private int mMinPointers = DEFAULT_MIN_POINTERS;
|
37
|
-
private int mMaxPointers = DEFAULT_MAX_POINTERS;
|
38
|
-
|
39
|
-
private float mStartX, mStartY;
|
40
|
-
private float mOffsetX, mOffsetY;
|
41
|
-
private float mLastX, mLastY;
|
42
|
-
private float mLastVelocityX, mLastVelocityY;
|
43
|
-
private VelocityTracker mVelocityTracker;
|
44
|
-
|
45
|
-
private boolean mAverageTouches;
|
46
|
-
|
47
|
-
/**
|
48
|
-
* On Android when there are multiple pointers on the screen pan gestures most
|
49
|
-
* often just consider the last placed pointer. The behaviour on iOS is quite
|
50
|
-
* different where the x and y component of the pan pointer is calculated as an
|
51
|
-
* average out of all the pointers placed on the screen.
|
52
|
-
*
|
53
|
-
* This behaviour can be customized on android by setting averageTouches
|
54
|
-
* property of the handler object. This could be useful in particular for the
|
55
|
-
* usecases when we attach other handlers that recognizes multi-finger gestures
|
56
|
-
* such as rotation. In that case when we only rely on the last placed finger it
|
57
|
-
* is easier for the gesture handler to trigger when we do a rotation gesture
|
58
|
-
* because each finger when treated separately will travel some distance,
|
59
|
-
* whereas the average position of all the fingers will remain still while doing
|
60
|
-
* a rotation gesture.
|
61
|
-
*/
|
62
|
-
public PanGestureHandler(Context context) {
|
63
|
-
ViewConfiguration vc = ViewConfiguration.get(context);
|
64
|
-
int touchSlop = vc.getScaledTouchSlop();
|
65
|
-
mMinDistSq = touchSlop * touchSlop;
|
66
|
-
}
|
67
|
-
|
68
|
-
public PanGestureHandler setActiveOffsetXStart(float activeOffsetXStart) {
|
69
|
-
mActiveOffsetXStart = activeOffsetXStart;
|
70
|
-
return this;
|
71
|
-
}
|
72
|
-
|
73
|
-
public PanGestureHandler setActiveOffsetXEnd(float activeOffsetXEnd) {
|
74
|
-
mActiveOffsetXEnd = activeOffsetXEnd;
|
75
|
-
return this;
|
76
|
-
}
|
77
|
-
|
78
|
-
public PanGestureHandler setFailOffsetXStart(float failOffsetXStart) {
|
79
|
-
mFailOffsetXStart = failOffsetXStart;
|
80
|
-
return this;
|
81
|
-
}
|
82
|
-
|
83
|
-
public PanGestureHandler setFailOffsetXEnd(float failOffsetXEnd) {
|
84
|
-
mFailOffsetXEnd = failOffsetXEnd;
|
85
|
-
return this;
|
86
|
-
}
|
87
|
-
|
88
|
-
public PanGestureHandler setActiveOffsetYStart(float activeOffsetYStart) {
|
89
|
-
mActiveOffsetYStart = activeOffsetYStart;
|
90
|
-
return this;
|
91
|
-
}
|
92
|
-
|
93
|
-
public PanGestureHandler setActiveOffsetYEnd(float activeOffsetYEnd) {
|
94
|
-
mActiveOffsetYEnd = activeOffsetYEnd;
|
95
|
-
return this;
|
96
|
-
}
|
97
|
-
|
98
|
-
public PanGestureHandler setFailOffsetYStart(float failOffsetYStart) {
|
99
|
-
mFailOffsetYStart = failOffsetYStart;
|
100
|
-
return this;
|
101
|
-
}
|
102
|
-
|
103
|
-
public PanGestureHandler setFailOffsetYEnd(float failOffsetYEnd) {
|
104
|
-
mFailOffsetYEnd = failOffsetYEnd;
|
105
|
-
return this;
|
106
|
-
}
|
107
|
-
|
108
|
-
public PanGestureHandler setMinDist(float minDist) {
|
109
|
-
mMinDistSq = minDist * minDist;
|
110
|
-
return this;
|
111
|
-
}
|
112
|
-
|
113
|
-
public PanGestureHandler setMinPointers(int minPointers) {
|
114
|
-
mMinPointers = minPointers;
|
115
|
-
return this;
|
116
|
-
}
|
117
|
-
|
118
|
-
public PanGestureHandler setMaxPointers(int maxPointers) {
|
119
|
-
mMaxPointers = maxPointers;
|
120
|
-
return this;
|
121
|
-
}
|
122
|
-
|
123
|
-
public PanGestureHandler setAverageTouches(boolean averageTouches) {
|
124
|
-
mAverageTouches = averageTouches;
|
125
|
-
return this;
|
126
|
-
}
|
127
|
-
|
128
|
-
/**
|
129
|
-
* @param minVelocity in pixels per second
|
130
|
-
*/
|
131
|
-
public PanGestureHandler setMinVelocity(float minVelocity) {
|
132
|
-
mMinVelocitySq = minVelocity * minVelocity;
|
133
|
-
return this;
|
134
|
-
}
|
135
|
-
|
136
|
-
public PanGestureHandler setMinVelocityX(float minVelocityX) {
|
137
|
-
mMinVelocityX = minVelocityX;
|
138
|
-
return this;
|
139
|
-
}
|
140
|
-
|
141
|
-
public PanGestureHandler setMinVelocityY(float minVelocityY) {
|
142
|
-
mMinVelocityY = minVelocityY;
|
143
|
-
return this;
|
144
|
-
}
|
145
|
-
|
146
|
-
private boolean shouldActivate() {
|
147
|
-
float dx = mLastX - mStartX + mOffsetX;
|
148
|
-
if (mActiveOffsetXStart != MIN_VALUE_IGNORE && dx < mActiveOffsetXStart) {
|
149
|
-
return true;
|
150
|
-
}
|
151
|
-
|
152
|
-
if (mActiveOffsetXEnd != MAX_VALUE_IGNORE && dx > mActiveOffsetXEnd) {
|
153
|
-
return true;
|
154
|
-
}
|
155
|
-
|
156
|
-
float dy = mLastY - mStartY + mOffsetY;
|
157
|
-
if (mActiveOffsetYStart != MIN_VALUE_IGNORE && dy < mActiveOffsetYStart) {
|
158
|
-
return true;
|
159
|
-
}
|
160
|
-
|
161
|
-
if (mActiveOffsetYEnd != MAX_VALUE_IGNORE && dy > mActiveOffsetYEnd) {
|
162
|
-
return true;
|
163
|
-
}
|
164
|
-
|
165
|
-
float distSq = dx * dx + dy * dy;
|
166
|
-
if (mMinDistSq != MIN_VALUE_IGNORE && distSq >= mMinDistSq) {
|
167
|
-
return true;
|
168
|
-
}
|
169
|
-
|
170
|
-
float vx = mLastVelocityX;
|
171
|
-
if (mMinVelocityX != MIN_VALUE_IGNORE
|
172
|
-
&& ((mMinVelocityX < 0 && vx <= mMinVelocityX) || (mMinVelocityX >= 0 && vx >= mMinVelocityX))) {
|
173
|
-
return true;
|
174
|
-
}
|
175
|
-
|
176
|
-
float vy = mLastVelocityY;
|
177
|
-
if (mMinVelocityY != MIN_VALUE_IGNORE
|
178
|
-
&& ((mMinVelocityY < 0 && vx <= mMinVelocityY) || (mMinVelocityY >= 0 && vx >= mMinVelocityY))) {
|
179
|
-
return true;
|
180
|
-
}
|
181
|
-
|
182
|
-
float velocitySq = vx * vx + vy * vy;
|
183
|
-
if (mMinVelocitySq != MIN_VALUE_IGNORE && velocitySq >= mMinVelocitySq) {
|
184
|
-
return true;
|
185
|
-
}
|
186
|
-
|
187
|
-
return false;
|
188
|
-
}
|
189
|
-
|
190
|
-
private boolean shouldFail() {
|
191
|
-
float dx = mLastX - mStartX + mOffsetX;
|
192
|
-
|
193
|
-
if (mFailOffsetXStart != MAX_VALUE_IGNORE && dx < mFailOffsetXStart) {
|
194
|
-
return true;
|
195
|
-
}
|
196
|
-
|
197
|
-
if (mFailOffsetXEnd != MIN_VALUE_IGNORE && dx > mFailOffsetXEnd) {
|
198
|
-
return true;
|
199
|
-
}
|
200
|
-
|
201
|
-
float dy = mLastY - mStartY + mOffsetY;
|
202
|
-
if (mFailOffsetYStart != MAX_VALUE_IGNORE && dy < mFailOffsetYStart) {
|
203
|
-
return true;
|
204
|
-
}
|
205
|
-
|
206
|
-
if (mFailOffsetYEnd != MIN_VALUE_IGNORE && dy > mFailOffsetYEnd) {
|
207
|
-
return true;
|
208
|
-
}
|
209
|
-
|
210
|
-
return false;
|
211
|
-
}
|
212
|
-
|
213
|
-
@Override
|
214
|
-
protected void onHandle(MotionEvent event) {
|
215
|
-
int state = getState();
|
216
|
-
int action = event.getActionMasked();
|
217
|
-
|
218
|
-
if (action == MotionEvent.ACTION_POINTER_UP || action == MotionEvent.ACTION_POINTER_DOWN) {
|
219
|
-
// update offset if new pointer gets added or removed
|
220
|
-
mOffsetX += mLastX - mStartX;
|
221
|
-
mOffsetY += mLastY - mStartY;
|
222
|
-
|
223
|
-
// reset starting point
|
224
|
-
mLastX = GestureUtils.getLastPointerX(event, mAverageTouches);
|
225
|
-
mLastY = GestureUtils.getLastPointerY(event, mAverageTouches);
|
226
|
-
mStartX = mLastX;
|
227
|
-
mStartY = mLastY;
|
228
|
-
} else {
|
229
|
-
mLastX = GestureUtils.getLastPointerX(event, mAverageTouches);
|
230
|
-
mLastY = GestureUtils.getLastPointerY(event, mAverageTouches);
|
231
|
-
}
|
232
|
-
|
233
|
-
if (state == STATE_UNDETERMINED && event.getPointerCount() >= mMinPointers) {
|
234
|
-
mStartX = mLastX;
|
235
|
-
mStartY = mLastY;
|
236
|
-
mOffsetX = 0;
|
237
|
-
mOffsetY = 0;
|
238
|
-
mVelocityTracker = VelocityTracker.obtain();
|
239
|
-
addVelocityMovement(mVelocityTracker, event);
|
240
|
-
begin();
|
241
|
-
} else if (mVelocityTracker != null) {
|
242
|
-
addVelocityMovement(mVelocityTracker, event);
|
243
|
-
mVelocityTracker.computeCurrentVelocity(1000);
|
244
|
-
mLastVelocityX = mVelocityTracker.getXVelocity();
|
245
|
-
mLastVelocityY = mVelocityTracker.getYVelocity();
|
246
|
-
}
|
247
|
-
|
248
|
-
if (action == MotionEvent.ACTION_UP) {
|
249
|
-
if (state == STATE_ACTIVE || state == STATE_BEGAN) {
|
250
|
-
end();
|
251
|
-
} else {
|
252
|
-
fail();
|
253
|
-
}
|
254
|
-
} else if (action == MotionEvent.ACTION_POINTER_DOWN && event.getPointerCount() > mMaxPointers) {
|
255
|
-
// When new finger is placed down (POINTER_DOWN) we check if MAX_POINTERS is not
|
256
|
-
// exceeded
|
257
|
-
if (state == STATE_ACTIVE) {
|
258
|
-
cancel();
|
259
|
-
} else {
|
260
|
-
fail();
|
261
|
-
}
|
262
|
-
} else if (action == MotionEvent.ACTION_POINTER_UP && state == STATE_ACTIVE
|
263
|
-
&& event.getPointerCount() < mMinPointers) {
|
264
|
-
// When finger is lifted up (POINTER_UP) and the number of pointers falls below
|
265
|
-
// MIN_POINTERS
|
266
|
-
// threshold, we only want to take an action when the handler has already
|
267
|
-
// activated. Otherwise
|
268
|
-
// we can still expect more fingers to be placed on screen and fulfill
|
269
|
-
// MIN_POINTERS criteria.
|
270
|
-
fail();
|
271
|
-
} else if (state == STATE_BEGAN) {
|
272
|
-
if (shouldFail()) {
|
273
|
-
fail();
|
274
|
-
} else if (shouldActivate()) {
|
275
|
-
// reset starting point
|
276
|
-
mStartX = mLastX;
|
277
|
-
mStartY = mLastY;
|
278
|
-
activate();
|
279
|
-
}
|
280
|
-
}
|
281
|
-
}
|
282
|
-
|
283
|
-
@Override
|
284
|
-
protected void onReset() {
|
285
|
-
if (mVelocityTracker != null) {
|
286
|
-
mVelocityTracker.recycle();
|
287
|
-
mVelocityTracker = null;
|
288
|
-
}
|
289
|
-
}
|
290
|
-
|
291
|
-
public float getTranslationX() {
|
292
|
-
return mLastX - mStartX + mOffsetX;
|
293
|
-
}
|
294
|
-
|
295
|
-
public float getTranslationY() {
|
296
|
-
return mLastY - mStartY + mOffsetY;
|
297
|
-
}
|
298
|
-
|
299
|
-
public float getVelocityX() {
|
300
|
-
return mLastVelocityX;
|
301
|
-
}
|
302
|
-
|
303
|
-
public float getVelocityY() {
|
304
|
-
return mLastVelocityY;
|
305
|
-
}
|
306
|
-
|
307
|
-
/**
|
308
|
-
* This method adds movement to {@class VelocityTracker} first resetting offset
|
309
|
-
* of the event so that the velocity is calculated based on the absolute
|
310
|
-
* position of touch pointers. This is because if the underlying view moves
|
311
|
-
* along with the finger using relative x/y coords yields incorrect results.
|
312
|
-
*/
|
313
|
-
private static void addVelocityMovement(VelocityTracker tracker, MotionEvent event) {
|
314
|
-
float offsetX = event.getRawX() - event.getX();
|
315
|
-
float offsetY = event.getRawY() - event.getY();
|
316
|
-
event.offsetLocation(offsetX, offsetY);
|
317
|
-
tracker.addMovement(event);
|
318
|
-
event.offsetLocation(-offsetX, -offsetY);
|
319
|
-
}
|
320
|
-
}
|