@react-native-ohos/react-native-pager-view 6.7.2-rc.2 → 6.7.3-rc.1

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/README.OpenSource CHANGED
@@ -1,11 +1,11 @@
1
- [
2
- {
3
- "Name": "react-native-pager-view",
4
- "License": "MIT License",
5
- "License File": " LICENSE ",
6
- "Version Number": "6.7.1",
7
- "Owner" : "xiafeng@huawei.com",
8
- "Upstream URL": "https://github.com/callstack/react-native-pager-view",
9
- "Description": "React Native wrapper for the Android ViewPager and iOS UIPageViewController."
10
- }
1
+ [
2
+ {
3
+ "Name": "react-native-pager-view",
4
+ "License": "MIT License",
5
+ "License File": " LICENSE ",
6
+ "Version Number": "6.7.1",
7
+ "Owner" : "xiafeng@huawei.com",
8
+ "Upstream URL": "https://github.com/callstack/react-native-pager-view",
9
+ "Description": "React Native wrapper for the Android ViewPager and iOS UIPageViewController."
10
+ }
11
11
  ]
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @react-native-ohos/react-native-pager-view
2
2
 
3
- This project is based on [react-native-pager-view](https://github.com/callstack/react-native-pager-view)
3
+ This project is based on [react-native-pager-view@v6.7.1](https://github.com/callstack/react-native-pager-view/tree/v6.7.1)
4
4
 
5
5
  ## Documentation
6
6
 
@@ -5,9 +5,9 @@
5
5
  "name": "@react-native-ohos/react-native-pager-view",
6
6
  "description": "React Native wrapper for HarmonyOS ViewPager",
7
7
  "main": "index.ets",
8
- "version": "6.7.2-rc.2",
8
+ "version": "6.7.3-rc.1",
9
9
  "dependencies": {
10
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony.har"
10
+ "@rnoh/react-native-openharmony": "file:../../node_modules/@react-native-oh/react-native-harmony/harmony/react_native_openharmony.har"
11
11
  },
12
12
  "metadata": {
13
13
  "sourceRoots": [
@@ -23,7 +23,6 @@
23
23
  */
24
24
 
25
25
  #include "ViewPagerComponentInstance.h"
26
- #include <arkui/native_gesture.h>
27
26
  #include <arkui/native_interface.h>
28
27
 
29
28
  namespace rnoh {
@@ -34,6 +33,14 @@ ViewPagerComponentInstance::ViewPagerComponentInstance(Context context)
34
33
  this->regsiterGestureEvent();
35
34
  }
36
35
 
36
+ ViewPagerComponentInstance::~ViewPagerComponentInstance() {
37
+ if (swiperGestureApi && swiperGestureRecognizer) {
38
+ DLOG(INFO) << "~ViewPagerComponentInstance removeGestureFromNode";
39
+ swiperGestureApi->removeGestureFromNode(
40
+ getLocalRootArkUINode().getArkUINodeHandle(), swiperGestureRecognizer);
41
+ }
42
+ }
43
+
37
44
  void ViewPagerComponentInstance::onChildInserted(ComponentInstance::Shared const &childComponentInstance,
38
45
  std::size_t index) {
39
46
  super::onChildInserted(childComponentInstance, index);
@@ -172,8 +179,8 @@ bool ViewPagerComponentInstance::isHandlingTouches() const {
172
179
  void ViewPagerComponentInstance::regsiterGestureEvent() {
173
180
  DLOG(INFO) << "ViewPagerComponentInstance::regsiterGestureEvent";
174
181
  auto gestureApi = OH_ArkUI_QueryModuleInterfaceByName(ARKUI_NATIVE_GESTURE, "ArkUI_NativeGestureAPI_1");
175
- auto swiperGestureApi = reinterpret_cast<ArkUI_NativeGestureAPI_1 *>(gestureApi);
176
- auto swiperGestureRecognizer = swiperGestureApi->createPanGesture(1, GESTURE_DIRECTION_ALL, 50);
182
+ swiperGestureApi = reinterpret_cast<ArkUI_NativeGestureAPI_1 *>(gestureApi);
183
+ swiperGestureRecognizer = swiperGestureApi->createPanGesture(1, GESTURE_DIRECTION_ALL, 50);
177
184
  auto onPanActionCallBack = [](ArkUI_GestureEvent *event, void *extraParam) {
178
185
  PanActionCallBack *panActionCallBack = (PanActionCallBack *)extraParam;
179
186
  ArkUI_GestureEventActionType actionType = OH_ArkUI_GestureEvent_GetActionType(event);
@@ -24,6 +24,7 @@
24
24
 
25
25
  #pragma once
26
26
  #include "SwiperNode.h"
27
+ #include <arkui/native_gesture.h>
27
28
  #include <folly/dynamic.h>
28
29
  #include "RNOHCorePackage/TurboModules/Animated/NativeAnimatedTurboModule.h"
29
30
  #include "generated/RNOH/generated/components/BaseRNCViewPagerComponentInstance.h"
@@ -57,9 +58,15 @@ private:
57
58
  };
58
59
 
59
60
  std::weak_ptr<NativeAnimatedTurboModule> m_swiperNativeAnimatedTurboModule{};
60
-
61
+
62
+ ArkUI_NativeGestureAPI_1 *swiperGestureApi;
63
+
64
+ ArkUI_GestureRecognizer *swiperGestureRecognizer;
65
+
61
66
  public:
62
67
  ViewPagerComponentInstance(Context context);
68
+
69
+ ~ViewPagerComponentInstance() override;
63
70
 
64
71
  void onChildInserted(ComponentInstance::Shared const &childComponentInstance, std::size_t index) override;
65
72
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-ohos/react-native-pager-view",
3
- "version": "6.7.2-rc.2",
3
+ "version": "6.7.3-rc.1",
4
4
  "description": "React Native wrapper for Harmony ViewPager",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -36,14 +36,14 @@
36
36
  ],
37
37
  "repository": {
38
38
  "type": "git",
39
- "url": "https://github.com/react-native-oh-library/react-native-pager-view.git"
39
+ "url": "https://gitcode.com/openharmony-sig/rntpc_react-native-pager-view.git"
40
40
  },
41
41
  "author": "troZee <hello@callstack.com> (https://github.com/callstack)",
42
42
  "license": "MIT",
43
43
  "bugs": {
44
- "url": "https://github.com/callstack/react-native-pager-view/issues"
44
+ "url": "https://gitcode.com/openharmony-sig/rntpc_react-native-pager-view/issues"
45
45
  },
46
- "homepage": "https://github.com/callstack/react-native-pager-view#readme",
46
+ "homepage": "https://gitcode.com/openharmony-sig/rntpc_react-native-pager-view/tree/br_rnoh0.77#readme",
47
47
  "publishConfig": {
48
48
  "registry": "https://registry.npmjs.org/",
49
49
  "access": "public"
@@ -1,17 +0,0 @@
1
- /**
2
- * Use these variables when you tailor your ArkTS code. They must be of the const type.
3
- */
4
- export const HAR_VERSION = '6.7.2-rc.2';
5
- export const BUILD_MODE_NAME = 'debug';
6
- export const DEBUG = true;
7
- export const TARGET_NAME = 'default';
8
-
9
- /**
10
- * BuildProfile Class is used only for compatibility purposes.
11
- */
12
- export default class BuildProfile {
13
- static readonly HAR_VERSION = HAR_VERSION;
14
- static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15
- static readonly DEBUG = DEBUG;
16
- static readonly TARGET_NAME = TARGET_NAME;
17
- }