@nativescript-community/gesturehandler 0.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.classpath +12 -0
- package/.eslintrc.js +3 -0
- package/.gitattributes +17 -0
- package/.github/FUNDING.yml +1 -0
- package/.github/issue_template.md +28 -0
- package/.gitmodules +6 -0
- package/.gradle/7.3/checksums/checksums.lock +0 -0
- package/.gradle/7.3/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/.gradle/7.3/dependencies-accessors/gc.properties +0 -0
- package/.gradle/7.3/fileChanges/last-build.bin +0 -0
- package/.gradle/7.3/fileHashes/fileHashes.lock +0 -0
- package/.gradle/7.3/gc.properties +0 -0
- package/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/.gradle/checksums/checksums.lock +0 -0
- package/.gradle/checksums/md5-checksums.bin +0 -0
- package/.gradle/checksums/sha1-checksums.bin +0 -0
- package/.gradle/vcs-1/gc.properties +0 -0
- package/.history/build_20201106173734.gradle +22 -0
- package/.history/build_20220218093019.gradle +22 -0
- package/.history/build_20220218093024.gradle +22 -0
- package/.history/build_20220218093151.gradle +22 -0
- package/.history/build_20220218093200.gradle +22 -0
- package/.history/build_20220218093224.gradle +22 -0
- package/.history/build_20220218093249.gradle +22 -0
- package/.history/build_20220218093334.gradle +22 -0
- package/.history/build_20220218093339.gradle +22 -0
- package/.history/build_20220218093341.gradle +22 -0
- package/.history/build_20220218093411.gradle +22 -0
- package/.history/build_20220218093413.gradle +22 -0
- package/.history/build_20220218093416.gradle +22 -0
- package/.history/build_20220218093421.gradle +23 -0
- package/.history/build_20220218093423.gradle +22 -0
- package/.history/build_20220218100008.gradle +22 -0
- package/.history/demo-snippets/package_20211119094134.json +7 -0
- package/.history/demo-snippets/package_20220328153105.json +7 -0
- package/.history/demo-snippets/package_20220328153251.json +7 -0
- package/.history/demo-snippets/package_20220328153410.json +7 -0
- package/.history/demo-snippets/vue/Basic_20210917174642.vue +46 -0
- package/.history/demo-snippets/vue/Basic_20220328154031.vue +44 -0
- package/.history/demo-snippets/vue/Basic_20220328154730.vue +46 -0
- package/.history/demo-snippets/vue/Basic_20220328154741.vue +46 -0
- package/.history/demo-snippets/vue/Basic_20220328154807.vue +47 -0
- package/.history/demo-snippets/vue/Basic_20220328154838.vue +51 -0
- package/.history/demo-snippets/vue/Basic_20220328154839.vue +51 -0
- package/.history/demo-snippets/vue/Basic_20220328154901.vue +52 -0
- package/.history/demo-snippets/vue/Basic_20220328154925.vue +52 -0
- package/.history/demo-snippets/vue/Basic_20220328162644.vue +52 -0
- package/.history/demo-snippets/vue/Basic_20220328162656.vue +48 -0
- package/.history/demo-snippets/vue/Basic_20220328162658.vue +48 -0
- package/.history/demo-snippets/vue/Basic_20220328162731.vue +48 -0
- package/.history/demo-snippets/vue/ModalView_20220328154527.vue +0 -0
- package/.history/demo-snippets/vue/ModalView_20220328154555.vue +15 -0
- package/.history/demo-snippets/vue/ModalView_20220328162755.vue +15 -0
- package/.history/demo-snippets/vue/ModalView_20220328162915.vue +17 -0
- package/.history/demo-snippets/vue/install_20211117134051.ts +14 -0
- package/.history/demo-snippets/vue/install_20220328153411.ts +10 -0
- package/.history/demo-snippets/vue/install_20220328154031.ts +9 -0
- package/.history/demo-snippets/vue/install_20220328162915.ts +10 -0
- package/.history/demo-vue/.npmrc_20220328151942 +1 -0
- package/.history/demo-vue/.npmrc_20220329084955 +2 -0
- package/.history/demo-vue/package_20220328151942.json +60 -0
- package/.history/demo-vue/package_20220328153206.json +60 -0
- package/.history/demo-vue/package_20220328153218.json +59 -0
- package/.history/demo-vue/package_20220328153326.json +60 -0
- package/.history/demo-vue/package_20220328153411.json +60 -0
- package/.history/demo_vue/app/App_20201115162303.vue +118 -0
- package/.history/demo_vue/app/App_20220328150238.vue +118 -0
- package/.history/demo_vue/app/App_20220328150240.vue +116 -0
- package/.history/demo_vue/app/App_20220328150241.vue +115 -0
- package/.history/demo_vue/package_20210511163846.json +30 -0
- package/.history/demo_vue/package_20220328145031.json +30 -0
- package/.history/demo_vue/package_20220328150155.json +30 -0
- package/.history/demo_vue/package_20220328151156.json +29 -0
- package/.history/demo_vue/tsconfig_20200909142713.json +30 -0
- package/.history/demo_vue/tsconfig_20220328151126.json +28 -0
- package/.history/demo_vue/tsconfig_20220328151129.json +27 -0
- package/.history/demo_vue/webpack.config_20200909141619.js +370 -0
- package/.history/demo_vue/webpack.config_20220328145113.js +6 -0
- package/.history/demo_vue/webpack.config_20220328145115.js +5 -0
- package/.history/lerna_20220104212014.json +21 -0
- package/.history/lerna_20220328152313.json +21 -0
- package/.history/package_20220311095923.json +74 -0
- package/.history/package_20220328152312.json +74 -0
- package/.history/packages/gesturehandler/blueprint_20220306151807.md +221 -0
- package/{blueprint.md → .history/packages/gesturehandler/blueprint_20220328164413.md} +0 -0
- package/.history/packages/gesturehandler/package_20220325110528.json +39 -0
- package/.history/packages/gesturehandler/package_20220328152653.json +52 -0
- package/.history/packages/gesturehandler/package_20220328152719.json +52 -0
- package/.history/packages/gesturehandler/package_20220328153446.json +52 -0
- package/.history/packages/gesturehandler/package_20220328164418.json +52 -0
- package/.history/packages/gesturehandler/package_20220328164722.json +52 -0
- package/{platforms/android/java/com/swmansion/gesturehandler/GestureHandler.java → .history/packages/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandler_20210517182228.java} +0 -0
- package/.history/packages/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandler_20220331104607.java +540 -0
- package/{platforms/android/java/com/swmansion/gesturehandler/LongPressGestureHandler.java → .history/packages/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/LongPressGestureHandler_20210512101356.java} +0 -0
- package/.history/packages/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/LongPressGestureHandler_20220331111050.java +81 -0
- package/.history/packages/gesturehandler/tsconfig_20220328152950.json +13 -0
- package/.history/packages/gesturehandler/tsconfig_20220328153011.json +13 -0
- package/.history/plugin/platforms/android/include_20220125161223.gradle +10 -0
- package/.history/plugin/platforms/android/include_20220217110818.gradle +19 -0
- package/.history/plugin/platforms/android/include_20220217112410.gradle +18 -0
- package/{platforms/android/include.gradle → .history/plugin/platforms/android/include_20220217153211.gradle} +0 -0
- package/.history/plugin/platforms/android/include_20220218092908.gradle +19 -0
- package/{platforms/android/java/com/nativescript/gesturehandler/PageLayout.java → .history/plugin/platforms/android/java/com/nativescript/gesturehandler/GestureLayout_20220217101202.java} +0 -0
- package/.history/plugin/platforms/android/java/com/nativescript/gesturehandler/GestureLayout_20220217101931.java +185 -0
- package/.history/plugin/platforms/ios/src/GestureHandler_20201106183454.h +98 -0
- package/.history/plugin/platforms/ios/src/GestureHandler_20201111112216.m +365 -0
- package/.history/plugin/platforms/ios/src/GestureHandler_20220104160100.m +369 -0
- package/{platforms/ios/src/GestureHandler.h → .history/plugin/platforms/ios/src/GestureHandler_20220104172158.h} +0 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328144612.ts +610 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328154126.ts +609 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328154143.ts +609 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328154730.ts +610 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328160735.ts +610 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328161307.ts +612 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328161410.ts +613 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328161742.ts +612 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328162317.ts +613 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328162541.ts +613 -0
- package/.history/src/gesturehandler/gesturehandler.android_20220328162915.ts +611 -0
- package/{gesturehandler.android.js → .history/src/gesturehandler/gesturehandler.android_20220328163618.ts} +228 -208
- package/.history/src/gesturehandler/gesturehandler.android_20220328163707.ts +610 -0
- package/.history/src/gesturehandler/gesturehandler.common_20220328144620.ts +325 -0
- package/.history/src/gesturehandler/gesturehandler.common_20220328153656.ts +325 -0
- package/.history/src/gesturehandler/gestures_override_20210512114352.ts +523 -0
- package/.history/src/gesturehandler/gestures_override_20220328155041.ts +523 -0
- package/.history/src/gesturehandler/gestures_override_20220328155424.ts +525 -0
- package/.history/src/gesturehandler/gestures_override_20220328160121.ts +527 -0
- package/.history/src/gesturehandler/gestures_override_20220328160132.ts +527 -0
- package/.history/src/gesturehandler/gestures_override_20220328160220.ts +528 -0
- package/.history/src/gesturehandler/gestures_override_20220328160416.ts +529 -0
- package/.history/src/gesturehandler/gestures_override_20220328160731.ts +535 -0
- package/.history/src/gesturehandler/gestures_override_20220328160808.ts +536 -0
- package/.history/src/gesturehandler/gestures_override_20220328160834.ts +536 -0
- package/.history/src/gesturehandler/gestures_override_20220328160909.ts +536 -0
- package/.history/src/gesturehandler/gestures_override_20220328160931.ts +536 -0
- package/.history/src/gesturehandler/gestures_override_20220328161052.ts +536 -0
- package/.history/src/gesturehandler/gestures_override_20220328161319.ts +536 -0
- package/.history/src/gesturehandler/gestures_override_20220328161759.ts +534 -0
- package/.history/src/gesturehandler/gestures_override_20220328162317.ts +535 -0
- package/.history/src/gesturehandler/gestures_override_20220328162503.ts +535 -0
- package/{gestures_override.js → .history/src/gesturehandler/gestures_override_20220328170816.ts} +171 -64
- package/.history/src/gesturehandler/gestures_override_20220328170818.ts +532 -0
- package/.history/src/gesturehandler/vue/index_20201021164506.ts +12 -0
- package/{vue/index.js → .history/src/gesturehandler/vue/index_20220328163021.ts} +1 -1
- package/.history/src/gesturehandler.android_20220325103749.ts +574 -0
- package/.history/src/gesturehandler.android_20220325110406.ts +574 -0
- package/.history/src/gesturehandler.android_20220328144613.ts +610 -0
- package/{gesturehandler.common.js → .history/src/gesturehandler.common_20210512114125.ts} +161 -74
- package/.history/src/gesturehandler.common_20220328144621.ts +325 -0
- package/.history/src/gesturehandler.d_20210422150412.ts +154 -0
- package/{gesturehandler.d.ts → .history/src/gesturehandler.d_20220328144718.ts} +0 -0
- package/{gesturehandler.ios.js → .history/src/gesturehandler.ios_20210422150701.ts} +100 -71
- package/.history/src/gesturehandler.ios_20220328144653.ts +296 -0
- package/.history/src/references.d_20200412093513.ts +3 -0
- package/.history/src/references.d_20220328144701.ts +3 -0
- package/.history/tsconfig_20220306153539.json +9 -0
- package/.history/tsconfig_20220328152313.json +9 -0
- package/.prettierignore +4 -0
- package/.prettierrc +6 -0
- package/.prettierrc.js +7 -0
- package/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/.vscode/settings.json +19 -0
- package/CHANGELOG.md +157 -54
- package/CONTRIBUTING.md +19 -0
- package/README.md +12 -132
- package/build.gradle +22 -0
- package/config.json +7 -0
- package/demo-snippets/node_modules/.package-lock.json +20 -0
- package/demo-snippets/package.json +7 -0
- package/demo-snippets/vue/Basic.vue +48 -0
- package/demo-snippets/vue/ModalView.vue +17 -0
- package/demo-snippets/vue/install.ts +10 -0
- package/demo-vue/App_Resources/Android/app.gradle +20 -0
- package/demo-vue/App_Resources/Android/src/main/AndroidManifest.xml +42 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable/ic_launcher_foreground.xml +15 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-hdpi/background.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-hdpi/logo.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-ldpi/background.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-ldpi/logo.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-mdpi/background.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-mdpi/logo.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml +8 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-xhdpi/background.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/demo-vue/App_Resources/Android/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/demo-vue/App_Resources/Android/src/main/res/values/colors.xml +7 -0
- package/demo-vue/App_Resources/Android/src/main/res/values/ic_launcher_background.xml +4 -0
- package/demo-vue/App_Resources/Android/src/main/res/values/styles.xml +42 -0
- package/demo-vue/App_Resources/Android/src/main/res/values-v21/colors.xml +4 -0
- package/demo-vue/App_Resources/Android/src/main/res/values-v21/styles.xml +28 -0
- package/demo-vue/App_Resources/Android/src/main/res/values-v29/styles.xml +12 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/Contents.json +6 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json +23 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json +23 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png +0 -0
- package/demo-vue/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png +0 -0
- package/demo-vue/App_Resources/iOS/Info.plist +47 -0
- package/demo-vue/App_Resources/iOS/LaunchScreen.storyboard +53 -0
- package/demo-vue/App_Resources/iOS/build.xcconfig +6 -0
- package/demo-vue/app/app.scss +11 -0
- package/demo-vue/app/app.ts +9 -0
- package/demo-vue/app/components/Menu.vue +54 -0
- package/demo-vue/nativescript.config.ts +11 -0
- package/demo-vue/package.json +60 -0
- package/demo-vue/tsconfig.json +25 -0
- package/demo-vue/types/references.d.ts +1 -0
- package/demo-vue/types/shims.vue.d.ts +4 -0
- package/demo-vue/webpack.config.js +42 -0
- package/images/demo.gif +0 -0
- package/lerna.json +21 -0
- package/package.json +60 -51
- package/packages/gesturehandler/CHANGELOG.md +609 -0
- package/packages/gesturehandler/README.md +176 -0
- package/packages/gesturehandler/blueprint.md +74 -0
- package/packages/gesturehandler/package.json +52 -0
- package/{platforms → packages/gesturehandler/platforms}/android/AndroidManifest.xml +0 -0
- package/packages/gesturehandler/platforms/android/include.gradle +19 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/nativescript/gesturehandler/GestureHandlerInteractionController.java +0 -0
- package/packages/gesturehandler/platforms/android/java/com/nativescript/gesturehandler/PageLayout.java +189 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/nativescript/gesturehandler/RootViewGestureHandler.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/BaseGestureHandlerInteractionController.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/FlingGestureHandler.java +0 -0
- package/packages/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandler.java +540 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/GestureHandlerInteractionController.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/GestureHandlerRegistry.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/GestureHandlerRegistryImpl.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/GestureUtils.java +0 -0
- package/packages/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/LongPressGestureHandler.java +81 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/NativeViewGestureHandler.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/OnTouchEventListener.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/PanGestureHandler.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/PinchGestureHandler.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/PointerEvents.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/PointerEventsConfig.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/PointerEventsSpec.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/RotationGestureDetector.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/RotationGestureHandler.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/ScaleGestureDetector.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/TapGestureHandler.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/java/com/swmansion/gesturehandler/ViewConfigurationHelper.java +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/native-api-usage.json +0 -0
- package/{platforms → packages/gesturehandler/platforms}/android/res/values/config.xml +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/FlingHandler.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/FlingHandler.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/ForceTouchHandler.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/ForceTouchHandler.m +0 -0
- package/packages/gesturehandler/platforms/ios/src/GestureHandler.h +101 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/GestureHandler.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/GestureHandlerDirection.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/GestureHandlerEvents.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/GestureHandlerEvents.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/GestureHandlerHeader.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/GestureHandlerManager.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/GestureHandlerManager.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/GestureHandlerRegistry.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/GestureHandlerRegistry.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/GestureHandlerState.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/LongPressHandler.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/LongPressHandler.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/NativeViewHandler.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/NativeViewHandler.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/PanHandler.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/PanHandler.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/PinchHandler.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/PinchHandler.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/RootViewGestureRecognizer.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/RootViewGestureRecognizer.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/RotationHandler.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/RotationHandler.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/TapHandler.h +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/TapHandler.m +0 -0
- package/{platforms → packages/gesturehandler/platforms}/ios/src/module.modulemap +0 -0
- package/packages/gesturehandler/tsconfig.json +13 -0
- package/references.d.ts +3 -3
- package/src/gesturehandler/gesturehandler.android.ts +610 -0
- package/src/gesturehandler/gesturehandler.common.ts +325 -0
- package/src/gesturehandler/gesturehandler.d.ts +156 -0
- package/src/gesturehandler/gesturehandler.ios.ts +296 -0
- package/src/gesturehandler/gestures_override.ts +532 -0
- package/src/gesturehandler/references.d.ts +3 -0
- package/{typings → src/gesturehandler/typings}/android.d.ts +0 -0
- package/{typings → src/gesturehandler/typings}/extensions.android.d.ts +0 -0
- package/{typings → src/gesturehandler/typings}/ios.d.ts +0 -0
- package/src/gesturehandler/vue/index.ts +7 -0
- package/src-native/.vscode/settings.json +3 -0
- package/src-native/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/src-native/android/.vscode/settings.json +3 -0
- package/src-native/android/README.md +14 -0
- package/src-native/android/build.gradle +25 -0
- package/src-native/android/build.sh +36 -0
- package/src-native/android/gesturehandler/.classpath +6 -0
- package/src-native/android/gesturehandler/.settings/org.eclipse.buildship.core.prefs +2 -0
- package/src-native/android/gesturehandler/build.gradle +84 -0
- package/src-native/android/gesturehandler/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src-native/android/gesturehandler/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/src-native/android/gesturehandler/gradlew +160 -0
- package/src-native/android/gesturehandler/gradlew.bat +90 -0
- package/src-native/android/gesturehandler/local.properties +9 -0
- package/src-native/android/gesturehandler/proguard-rules.pro +17 -0
- package/src-native/android/gesturehandler/src/main/AndroidManifest.xml +9 -0
- package/src-native/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src-native/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/src-native/android/gradle.properties +23 -0
- package/src-native/android/gradlew +160 -0
- package/src-native/android/gradlew.bat +90 -0
- package/src-native/android/settings.gradle +1 -0
- package/src-native/ios/GestureHandler.xcodeproj/project.pbxproj +662 -0
- package/src-native/ios/GestureHandler.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/src-native/ios/GestureHandler.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/src-native/ios/GestureHandler.xcodeproj/xcshareddata/xcschemes/GestureHandler.xcscheme +76 -0
- package/src-native/ios/GestureHandler.xcodeproj/xcshareddata/xcschemes/GestureHandlerApp.xcscheme +87 -0
- package/src-native/ios/GestureHandler.xcodeproj/xcshareddata/xcschemes/GestureHandlerLib.xcscheme +76 -0
- package/src-native/ios/GestureHandler.xcodeproj/xcshareddata/xcschemes/test.xcscheme +76 -0
- package/src-native/ios/GestureHandler.xcodeproj/xcshareddata/xcschemes/universal.xcscheme +76 -0
- package/src-native/ios/build.sh +10 -0
- package/tools/.eslintrc.js +252 -0
- package/tools/builddoc.mjs +54 -0
- package/tools/common/.eslintrc.js +3 -0
- package/tools/common/.prettierignore +4 -0
- package/tools/common/.prettierrc.js +7 -0
- package/tools/common/references.d.ts +3 -0
- package/tools/package.json +116 -0
- package/tools/readme/blueprint.json +10 -0
- package/tools/readme/demos-and-development.md +35 -0
- package/tools/readme/edit-warning.md +20 -0
- package/tools/readme/questions.md +3 -0
- package/tools/readme.js +54 -0
- package/tools/sync.js +102 -0
- package/tools/tsconfig.doc.json +10 -0
- package/tools/tsconfig.eslint.json +4 -0
- package/tools/tsconfig.json +38 -0
- package/tools/typedoc.js +17 -0
- package/tools/update.js +32 -0
- package/tsconfig.json +4 -8
- package/.pnpm-debug.log +0 -1
- package/gesturehandler.android.d.ts +0 -180
- package/gesturehandler.android.js.map +0 -1
- package/gesturehandler.common.d.ts +0 -96
- package/gesturehandler.common.js.map +0 -1
- package/gesturehandler.ios.d.ts +0 -56
- package/gesturehandler.ios.js.map +0 -1
- package/gestures_override.d.ts +0 -29
- package/gestures_override.js.map +0 -1
- package/react/index.d.ts +0 -20
- package/react/index.js +0 -9
- package/react/index.js.map +0 -1
- package/svelte/index.d.ts +0 -11
- package/svelte/index.js +0 -26
- package/svelte/index.js.map +0 -1
- package/vue/index.d.ts +0 -4
- package/vue/index.js.map +0 -1
@@ -0,0 +1,176 @@
|
|
1
|
+
<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
|
2
|
+
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
3
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
4
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
5
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
6
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
7
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
8
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
9
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
10
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
11
|
+
DO NOT EDIT THIS READEME DIRECTLY! Edit "bluesprint.md" instead.
|
12
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
13
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
14
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
15
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
16
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
17
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
18
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
19
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
20
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
21
|
+
<h1 align="center">@nativescript-community/gesturehandler</h1>
|
22
|
+
<p align="center">
|
23
|
+
<a href="https://npmcharts.com/compare/@nativescript-community/gesturehandler?minimal=true"><img alt="Downloads per month" src="https://img.shields.io/npm/dm/@nativescript-community/gesturehandler.svg" height="20"/></a>
|
24
|
+
<a href="https://www.npmjs.com/package/@nativescript-community/gesturehandler"><img alt="NPM Version" src="https://img.shields.io/npm/v/@nativescript-community/gesturehandler.svg" height="20"/></a>
|
25
|
+
</p>
|
26
|
+
|
27
|
+
<p align="center">
|
28
|
+
<b>Declarative API exposing platform native touch and gesture system to NativeScript.</b></br>
|
29
|
+
<sub><sub>
|
30
|
+
</p>
|
31
|
+
|
32
|
+
<br />
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
[](#table-of-contents)
|
37
|
+
|
38
|
+
## Table of Contents
|
39
|
+
|
40
|
+
* [Installation](#installation)
|
41
|
+
* [API](#api)
|
42
|
+
* [TypeScript](#typescript)
|
43
|
+
* [GestureRootView](#gesturerootview)
|
44
|
+
* [Overriding Nativescript gestures](#overriding-nativescript-gestures)
|
45
|
+
* [Credits](#credits)
|
46
|
+
* [Examples:](#examples)
|
47
|
+
* [Demos and Development](#demos-and-development)
|
48
|
+
* [Setup](#setup)
|
49
|
+
* [Build](#build)
|
50
|
+
* [Demos](#demos)
|
51
|
+
* [Questions](#questions)
|
52
|
+
|
53
|
+
|
54
|
+
[](#installation)
|
55
|
+
|
56
|
+
## Installation
|
57
|
+
Run the following command from the root of your project:
|
58
|
+
|
59
|
+
`ns plugin add @nativescript-community/gesturehandler`
|
60
|
+
|
61
|
+
|
62
|
+
[](#api)
|
63
|
+
|
64
|
+
## API
|
65
|
+
|
66
|
+
We need to do some wiring when your app starts, so open `app.ts` and add this before creating any View/App/Frame:
|
67
|
+
##### TypeScript
|
68
|
+
```ts
|
69
|
+
import { install } from "@nativescript-community/gesturehandler";
|
70
|
+
install();
|
71
|
+
```
|
72
|
+
|
73
|
+
You create a gesture handler using something like this:
|
74
|
+
```typescript
|
75
|
+
import { GestureHandlerTouchEvent, GestureHandlerStateEvent, GestureStateEventData, GestureTouchEventData, HandlerType } from '@nativescript-community/gesturehandler';
|
76
|
+
|
77
|
+
|
78
|
+
function onGestureTouch(args: GestureTouchEventData) {
|
79
|
+
const { state, extraData, view } = args.data;
|
80
|
+
view.translateX = extraData.translationX;
|
81
|
+
view.translateY = extraData.translationY;
|
82
|
+
}
|
83
|
+
function onGestureState(args: GestureStateEventData) {
|
84
|
+
const { state, prevState, extraData, view } = args.data;
|
85
|
+
console.log('onGestureState', state, prevState, view, extraData);
|
86
|
+
}
|
87
|
+
const manager = Manager.getInstance();
|
88
|
+
const gestureHandler = = manager.createGestureHandler(HandlerType.PAN, 10, {
|
89
|
+
shouldCancelWhenOutside: false
|
90
|
+
});
|
91
|
+
gestureHandler.on(GestureHandlerTouchEvent, onGestureTouch, this);
|
92
|
+
gestureHandler.on(GestureHandlerStateEvent, onGestureState, this);
|
93
|
+
gestureHandler.attachToView(view);
|
94
|
+
```
|
95
|
+
|
96
|
+
Right now you must not forget to store the ```gestureHandler``` somewhere or the gesture won't work on iOS (native object being released). This will be fixed in future versions.
|
97
|
+
|
98
|
+
Now about the API. All the gestures for the react counterpart exist with the same options and the same event ```extraData```.
|
99
|
+
|
100
|
+
|
101
|
+
[](#gesturerootview)
|
102
|
+
|
103
|
+
## GestureRootView
|
104
|
+
|
105
|
+
For the gestures to work correctly we need a `root` view which knows how to handle the gestures.
|
106
|
+
If using `Page` (thus `Frame`) you don't need to do anything.
|
107
|
+
In case you don't (drawer root view, modals, ...) then you can wrap your views in a `GestureRootView` which inherits `GridLayout`
|
108
|
+
|
109
|
+
|
110
|
+
[](#overriding-nativescript-gestures)
|
111
|
+
|
112
|
+
## Overriding Nativescript gestures
|
113
|
+
|
114
|
+
This plugin can also override N gestures completely. This would give much more control over gestures and especially would allow to correctly handle simultaneous gestures likes `tap` and `longpress`
|
115
|
+
|
116
|
+
To do that
|
117
|
+
|
118
|
+
|
119
|
+
[](#credits)
|
120
|
+
|
121
|
+
## Credits
|
122
|
+
|
123
|
+
This is a port of [react-native-gesturehandler](https://kmagiera.github.io/react-native-gesture-handler/).
|
124
|
+
The source is based on the source code by [Krzysztof Magiera](https://github.com/kmagiera). Dont hesitate to go and thank him for his work!
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
### Examples:
|
129
|
+
|
130
|
+
- [Basic](demo-snippets/vue/Basic.vue)
|
131
|
+
- A basic example showing that overriding N gestures works, even in modals
|
132
|
+
|
133
|
+
|
134
|
+
[](#demos-and-development)
|
135
|
+
|
136
|
+
## Demos and Development
|
137
|
+
|
138
|
+
|
139
|
+
### Setup
|
140
|
+
|
141
|
+
To run the demos, you must clone this repo **recursively**.
|
142
|
+
|
143
|
+
```
|
144
|
+
git clone https://github.com/@nativescript-community/gesturehandler.git --recursive
|
145
|
+
```
|
146
|
+
|
147
|
+
**Install Dependencies:**
|
148
|
+
```bash
|
149
|
+
npm i # or 'yarn install' or 'pnpm install'
|
150
|
+
```
|
151
|
+
|
152
|
+
**Interactive Menu:**
|
153
|
+
|
154
|
+
To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.
|
155
|
+
|
156
|
+
### Build
|
157
|
+
|
158
|
+
```bash
|
159
|
+
npm run build
|
160
|
+
|
161
|
+
npm run build.angular # or for Angular
|
162
|
+
```
|
163
|
+
|
164
|
+
### Demos
|
165
|
+
|
166
|
+
```bash
|
167
|
+
npm run demo.[ng|react|svelte|vue].[ios|android]
|
168
|
+
|
169
|
+
npm run demo.svelte.ios # Example
|
170
|
+
```
|
171
|
+
|
172
|
+
[](#questions)
|
173
|
+
|
174
|
+
## Questions
|
175
|
+
|
176
|
+
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).
|
@@ -0,0 +1,74 @@
|
|
1
|
+
{{ load:../../tools/readme/edit-warning.md }}
|
2
|
+
{{ template:title }}
|
3
|
+
{{ template:badges }}
|
4
|
+
{{ template:description }}
|
5
|
+
|
6
|
+
{{ template:toc }}
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
Run the following command from the root of your project:
|
10
|
+
|
11
|
+
`ns plugin add {{ pkg.name }}`
|
12
|
+
|
13
|
+
## API
|
14
|
+
|
15
|
+
We need to do some wiring when your app starts, so open `app.ts` and add this before creating any View/App/Frame:
|
16
|
+
##### TypeScript
|
17
|
+
```ts
|
18
|
+
import { install } from "@nativescript-community/gesturehandler";
|
19
|
+
install();
|
20
|
+
```
|
21
|
+
|
22
|
+
You create a gesture handler using something like this:
|
23
|
+
```typescript
|
24
|
+
import { GestureHandlerTouchEvent, GestureHandlerStateEvent, GestureStateEventData, GestureTouchEventData, HandlerType } from '@nativescript-community/gesturehandler';
|
25
|
+
|
26
|
+
|
27
|
+
function onGestureTouch(args: GestureTouchEventData) {
|
28
|
+
const { state, extraData, view } = args.data;
|
29
|
+
view.translateX = extraData.translationX;
|
30
|
+
view.translateY = extraData.translationY;
|
31
|
+
}
|
32
|
+
function onGestureState(args: GestureStateEventData) {
|
33
|
+
const { state, prevState, extraData, view } = args.data;
|
34
|
+
console.log('onGestureState', state, prevState, view, extraData);
|
35
|
+
}
|
36
|
+
const manager = Manager.getInstance();
|
37
|
+
const gestureHandler = = manager.createGestureHandler(HandlerType.PAN, 10, {
|
38
|
+
shouldCancelWhenOutside: false
|
39
|
+
});
|
40
|
+
gestureHandler.on(GestureHandlerTouchEvent, onGestureTouch, this);
|
41
|
+
gestureHandler.on(GestureHandlerStateEvent, onGestureState, this);
|
42
|
+
gestureHandler.attachToView(view);
|
43
|
+
```
|
44
|
+
|
45
|
+
Right now you must not forget to store the ```gestureHandler``` somewhere or the gesture won't work on iOS (native object being released). This will be fixed in future versions.
|
46
|
+
|
47
|
+
Now about the API. All the gestures for the react counterpart exist with the same options and the same event ```extraData```.
|
48
|
+
|
49
|
+
## GestureRootView
|
50
|
+
|
51
|
+
For the gestures to work correctly we need a `root` view which knows how to handle the gestures.
|
52
|
+
If using `Page` (thus `Frame`) you don't need to do anything.
|
53
|
+
In case you don't (drawer root view, modals, ...) then you can wrap your views in a `GestureRootView` which inherits `GridLayout`
|
54
|
+
|
55
|
+
## Overriding Nativescript gestures
|
56
|
+
|
57
|
+
This plugin can also override N gestures completely. This would give much more control over gestures and especially would allow to correctly handle simultaneous gestures likes `tap` and `longpress`
|
58
|
+
|
59
|
+
To do that
|
60
|
+
|
61
|
+
## Credits
|
62
|
+
|
63
|
+
This is a port of [react-native-gesturehandler](https://kmagiera.github.io/react-native-gesture-handler/).
|
64
|
+
The source is based on the source code by [Krzysztof Magiera](https://github.com/kmagiera). Dont hesitate to go and thank him for his work!
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
### Examples:
|
69
|
+
|
70
|
+
- [Basic](demo-snippets/vue/Basic.vue)
|
71
|
+
- A basic example showing that overriding N gestures works, even in modals
|
72
|
+
|
73
|
+
{{ load:../../tools/readme/demos-and-development.md }}
|
74
|
+
{{ load:../../tools/readme/questions.md }}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
{
|
2
|
+
"name": "@nativescript-community/gesturehandler",
|
3
|
+
"version": "0.2.1",
|
4
|
+
"description": "Declarative API exposing platform native touch and gesture system to NativeScript.",
|
5
|
+
"main": "gesturehandler",
|
6
|
+
"sideEffects": false,
|
7
|
+
"typings": "gesturehandler.d.ts",
|
8
|
+
"scripts": {
|
9
|
+
"build": "npm run tsc && npm run readme",
|
10
|
+
"build.win": "npm run tsc.win && npm run readme",
|
11
|
+
"build.all": "npm run build",
|
12
|
+
"build.all.win": "npm run build .win",
|
13
|
+
"build.angular": "../../node_modules/.bin/ng-packagr -p ../../src/gesturehandler/angular/package.json -c ../../src/gesturehandler/angular/tsconfig.json",
|
14
|
+
"build.angular.win": "..\\..\\node_modules\\.bin\\ng-packagr -p ..\\..\\src\\gesturehandler\\angular\\package.json -c ..\\..\\src\\gesturehandler\\angular\\tsconfig.json",
|
15
|
+
"readme": "../../node_modules/.bin/readme generate -c ../../tools/readme/blueprint.json",
|
16
|
+
"tsc": "../../node_modules/.bin/cpy '**/*.d.ts' '../../packages/gesturehandler' --parents --cwd=../../src/gesturehandler && ../../node_modules/.bin/tsc -skipLibCheck -d",
|
17
|
+
"tsc.win": "..\\..\\node_modules\\.bin\\cpy '**\\*.d.ts' '..\\..\\packages\\gesturehandler' --parents --cwd=..\\..\\src\\gesturehandler && ..\\..\\node_modules\\.bin\\tsc -skipLibCheck -d",
|
18
|
+
"clean": "../../node_modules/.bin/rimraf ./*.d.ts ./*.js ./*.js.map",
|
19
|
+
"clean.win": "..\\..\\node_modules\\.bin\\rimraf .\\*.d.ts .\\*.js .\\*.js.map"
|
20
|
+
},
|
21
|
+
"nativescript": {
|
22
|
+
"platforms": {
|
23
|
+
"android": "6.2.1",
|
24
|
+
"ios": "6.2.1"
|
25
|
+
}
|
26
|
+
},
|
27
|
+
"keywords": [
|
28
|
+
"NativeScript",
|
29
|
+
"JavaScript",
|
30
|
+
"iOS",
|
31
|
+
"Android",
|
32
|
+
"Vue",
|
33
|
+
"preview|https://raw.githubusercontent.com/nativescript-community/gesturehandler/master/images/demo.gif"
|
34
|
+
],
|
35
|
+
"author": {
|
36
|
+
"name": "Martin Guillon",
|
37
|
+
"email": "martin.guillon@akylas.fr"
|
38
|
+
},
|
39
|
+
"bugs": {
|
40
|
+
"url": "https://github.com/nativescript-community/gesturehandler/issues"
|
41
|
+
},
|
42
|
+
"license": "Apache-2.0",
|
43
|
+
"repository": {
|
44
|
+
"type": "git",
|
45
|
+
"url": "https://github.com/nativescript-community/gesturehandler"
|
46
|
+
},
|
47
|
+
"bootstrapper": "nativescript-plugin-seed",
|
48
|
+
"dependencies": {
|
49
|
+
"@nativescript-community/observable": "^2.0.10"
|
50
|
+
},
|
51
|
+
"gitHead": "531e9068c445832a6faf6bb8e227b738baa6ef18"
|
52
|
+
}
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import groovy.json.JsonSlurper
|
2
|
+
dependencies {
|
3
|
+
implementation(name:'widgets-release', ext:'aar')
|
4
|
+
implementation "androidx.annotation:annotation:1.1.0"
|
5
|
+
}
|
6
|
+
repositories {
|
7
|
+
def appDir = "$rootDir/../../.."
|
8
|
+
def widgetsDir = "$appDir/node_modules/@nativescript/core/platforms/android"
|
9
|
+
def appPackageJsonFile = file("$appDir/package.json")
|
10
|
+
if (appPackageJsonFile.exists()) {
|
11
|
+
def appPackageJson = new JsonSlurper().parseText(appPackageJsonFile.text)
|
12
|
+
if (appPackageJson.dependencies['@akylas/nativescript'] != null) {
|
13
|
+
widgetsDir = "$appDir/node_modules/@akylas/nativescript/platforms/android"
|
14
|
+
}
|
15
|
+
}
|
16
|
+
flatDir {
|
17
|
+
dirs "$widgetsDir"
|
18
|
+
}
|
19
|
+
}
|
File without changes
|
@@ -0,0 +1,189 @@
|
|
1
|
+
package com.nativescript.gesturehandler;
|
2
|
+
|
3
|
+
import android.content.Context;
|
4
|
+
import android.view.MotionEvent;
|
5
|
+
import android.view.View;
|
6
|
+
import android.view.ViewGroup;
|
7
|
+
import android.util.Log;
|
8
|
+
|
9
|
+
import org.nativescript.widgets.ItemSpec;
|
10
|
+
import org.nativescript.widgets.GridUnitType;
|
11
|
+
|
12
|
+
import com.swmansion.gesturehandler.GestureHandlerOrchestrator;
|
13
|
+
import com.swmansion.gesturehandler.GestureHandlerRegistryImpl;
|
14
|
+
import com.swmansion.gesturehandler.PointerEventsConfig;
|
15
|
+
import com.swmansion.gesturehandler.GestureHandler;
|
16
|
+
import com.swmansion.gesturehandler.ViewConfigurationHelper;
|
17
|
+
|
18
|
+
import java.util.ArrayList;
|
19
|
+
|
20
|
+
public class PageLayout extends org.nativescript.widgets.GridLayout {
|
21
|
+
public PageLayout(Context context, int rootGestureTag) {
|
22
|
+
super(context);
|
23
|
+
mRootGestureTag = rootGestureTag;
|
24
|
+
addRow(new ItemSpec(1, GridUnitType.auto));
|
25
|
+
addRow(new ItemSpec(1, GridUnitType.star));
|
26
|
+
}
|
27
|
+
|
28
|
+
private int mRootGestureTag;
|
29
|
+
private GestureHandlerOrchestrator mOrchestrator;
|
30
|
+
private GestureHandlerRegistryImpl mRegistry;
|
31
|
+
private ViewConfigurationHelper configurationHelper;
|
32
|
+
RootViewGestureHandler rootGestureHandler;
|
33
|
+
|
34
|
+
private boolean mShouldIntercept = false;
|
35
|
+
private boolean mPassingTouch = false;
|
36
|
+
private boolean mDispatchToOrchestra = true;
|
37
|
+
private boolean mShouldAddRootGesture = true;
|
38
|
+
|
39
|
+
public void setShouldIntercept(boolean value) {
|
40
|
+
if (GestureHandler.debug) {
|
41
|
+
Log.d("JS", "PageLayout setShouldIntercept " + value);
|
42
|
+
}
|
43
|
+
this.mShouldIntercept = value;
|
44
|
+
}
|
45
|
+
|
46
|
+
public void setPassingTouch(boolean value) {
|
47
|
+
this.mPassingTouch = value;
|
48
|
+
}
|
49
|
+
public void setShouldAddRootGesture(boolean value) {
|
50
|
+
this.mShouldAddRootGesture = value;
|
51
|
+
}
|
52
|
+
|
53
|
+
public int getRootGestureTag() {
|
54
|
+
return mRootGestureTag;
|
55
|
+
}
|
56
|
+
|
57
|
+
public void setDispatchToOrchestra(boolean value) {
|
58
|
+
if (GestureHandler.debug) {
|
59
|
+
Log.d("JS", "PageLayout setDispatchToOrchestra " + value);
|
60
|
+
}
|
61
|
+
this.mDispatchToOrchestra = value;
|
62
|
+
}
|
63
|
+
|
64
|
+
public GestureHandlerRegistryImpl registry() {
|
65
|
+
return this.mRegistry;
|
66
|
+
}
|
67
|
+
// requestDisallowInterceptTouchEvent(disallowIntercept) {
|
68
|
+
// console.log('requestDisallowInterceptTouchEvent');
|
69
|
+
// if (this.mGestureRootHelper != null) {
|
70
|
+
// this.mGestureRootHelper.requestDisallowInterceptTouchEvent(disallowIntercept);
|
71
|
+
// }
|
72
|
+
// super.requestDisallowInterceptTouchEvent(disallowIntercept);
|
73
|
+
// }
|
74
|
+
|
75
|
+
// dispatchTouchEvent(ev) {
|
76
|
+
// if (this.mGestureRootHelper != null && this.mGestureRootHelper.dispatchTouchEvent(ev)) {
|
77
|
+
// return true;
|
78
|
+
// }
|
79
|
+
// return super.dispatchTouchEvent(ev);
|
80
|
+
// }
|
81
|
+
public void tryCancelAllHandlers() {
|
82
|
+
if (GestureHandler.debug) {
|
83
|
+
Log.d("JS", "PageLayout tryCancelAllHandlers ");
|
84
|
+
}
|
85
|
+
ArrayList<GestureHandler> handlers = this.mRegistry.getAllHandlers();
|
86
|
+
if (handlers != null) {
|
87
|
+
for(int i = 0; i < handlers.size(); i++) {
|
88
|
+
GestureHandler handler = handlers.get(i);
|
89
|
+
if (handler != this.rootGestureHandler) {
|
90
|
+
handler.cancel();
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
// In order to cancel handlers we activate handler that is hooked to the root view
|
95
|
+
// if (this.rootGestureHandler != null && this.rootGestureHandler.getState() == com.swmansion.gesturehandler.GestureHandler.STATE_BEGAN) {
|
96
|
+
// // Try activate main JS handler
|
97
|
+
// this.rootGestureHandler.activate();
|
98
|
+
// this.rootGestureHandler.end();
|
99
|
+
// }
|
100
|
+
}
|
101
|
+
|
102
|
+
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
|
103
|
+
if (GestureHandler.debug) {
|
104
|
+
Log.d("JS", "PageLayout requestDisallowInterceptTouchEvent " + disallowIntercept + " " + this.mPassingTouch);
|
105
|
+
}
|
106
|
+
// If this method gets called it means that some native view is attempting to grab lock for
|
107
|
+
// touch event delivery. In that case we cancel all gesture recognizers
|
108
|
+
if (this.mOrchestrator != null && !this.mPassingTouch) {
|
109
|
+
// if we are in the process of delivering touch events via GH orchestrator, we don't want to
|
110
|
+
// treat it as a native gesture capturing the lock
|
111
|
+
this.tryCancelAllHandlers();
|
112
|
+
}
|
113
|
+
super.requestDisallowInterceptTouchEvent(disallowIntercept);
|
114
|
+
}
|
115
|
+
|
116
|
+
public boolean dispatchTouchEventToOrchestrator(MotionEvent ev) {
|
117
|
+
if (this.mOrchestrator != null) {
|
118
|
+
this.mPassingTouch = true;
|
119
|
+
this.mOrchestrator.onTouchEvent(ev);
|
120
|
+
this.mPassingTouch = false;
|
121
|
+
}
|
122
|
+
if (GestureHandler.debug) {
|
123
|
+
Log.d("JS", "PageLayout dispatchTouchEventToOrchestrator " + this.mShouldIntercept);
|
124
|
+
}
|
125
|
+
return this.mShouldIntercept;
|
126
|
+
}
|
127
|
+
|
128
|
+
public boolean dispatchTouchEvent(MotionEvent ev) {
|
129
|
+
if (GestureHandler.debug) {
|
130
|
+
Log.d("JS", "PageLayout dispatchTouchEvent " + this.mDispatchToOrchestra);
|
131
|
+
}
|
132
|
+
if (this.mDispatchToOrchestra && this.dispatchTouchEventToOrchestrator(ev)) {
|
133
|
+
return true;
|
134
|
+
}
|
135
|
+
final boolean handled = super.dispatchTouchEvent(ev);
|
136
|
+
if (GestureHandler.debug) {
|
137
|
+
Log.d("JS", "PageLayout dispatchTouchEvent to children " + handled);
|
138
|
+
}
|
139
|
+
// we need to always return true or gestures wont work on layouts because they don't handle touch so dispatchTouchEvent returns false
|
140
|
+
return true;
|
141
|
+
}
|
142
|
+
|
143
|
+
// onInterceptTouchEvent(ev: android.view.MotionEvent) {
|
144
|
+
// return this.mShouldIntercept;
|
145
|
+
// }
|
146
|
+
|
147
|
+
// onTouchEvent(ev: android.view.MotionEvent) {
|
148
|
+
// console.log('onTouchEvent', ev);
|
149
|
+
// this.mOrchestrator.onTouchEvent(ev);
|
150
|
+
// return super.onTouchEvent(ev);
|
151
|
+
// }
|
152
|
+
|
153
|
+
/**
|
154
|
+
* This method is used to enable root view to start processing touch events through the gesture
|
155
|
+
* handler library logic. Unless this method is called (which happens as a result of instantiating
|
156
|
+
* new gesture handler from JS) the root view component will just proxy all touch related methods
|
157
|
+
* to its superclass. Thus in the "disabled" state all touch related events will fallback to
|
158
|
+
* default behavior.
|
159
|
+
*/
|
160
|
+
public void initialize() {
|
161
|
+
this.mRegistry = new com.swmansion.gesturehandler.GestureHandlerRegistryImpl();
|
162
|
+
this.configurationHelper = new com.swmansion.gesturehandler.ViewConfigurationHelper() {
|
163
|
+
public PointerEventsConfig getPointerEventsConfigForView(View view) {
|
164
|
+
return view.isEnabled() ? com.swmansion.gesturehandler.PointerEventsConfig.AUTO : com.swmansion.gesturehandler.PointerEventsConfig.NONE;
|
165
|
+
}
|
166
|
+
|
167
|
+
public boolean isViewClippingChildren(ViewGroup parent) {
|
168
|
+
return false;
|
169
|
+
}
|
170
|
+
|
171
|
+
public View getChildInDrawingOrderAtIndex(ViewGroup parent, int index) {
|
172
|
+
return parent.getChildAt(index);
|
173
|
+
}
|
174
|
+
};
|
175
|
+
this.mOrchestrator = new com.swmansion.gesturehandler.GestureHandlerOrchestrator(this, this.mRegistry, this.configurationHelper);
|
176
|
+
this.mOrchestrator.setMinimumAlphaForTraversal(0.01f);
|
177
|
+
|
178
|
+
this.rootGestureHandler = new RootViewGestureHandler();
|
179
|
+
this.rootGestureHandler.setTag(mRootGestureTag);
|
180
|
+
this.mRegistry.registerHandler(this.rootGestureHandler);
|
181
|
+
this.mRegistry.attachHandlerToView(mRootGestureTag, this);
|
182
|
+
}
|
183
|
+
|
184
|
+
public void tearDown() {
|
185
|
+
this.configurationHelper = null;
|
186
|
+
this.mOrchestrator = null;
|
187
|
+
this.mRegistry = null;
|
188
|
+
}
|
189
|
+
}
|
File without changes
|
File without changes
|