diff --git a/ArkUIKit/NativeNodeBaseSample/README.md b/ArkUIKit/NativeNodeBaseSample/README.md index 7c8de8b815f2c9fe068b76ac2a69b3c14d018a9b..b667f788f38b1ec925003d83267050d1968fc925 100644 --- a/ArkUIKit/NativeNodeBaseSample/README.md +++ b/ArkUIKit/NativeNodeBaseSample/README.md @@ -2,47 +2,109 @@ ## 介绍 -本示例展示了如何创建文本、输入框、文本域等组件,配置其样式、属性与事件,还含 UI 任务、反色设置等功能,构建文本页面。 +本示例展示了如何创建文本、输入框、文本域、Grid、滑动容器等组件,配置其样式、属性与事件,还含 UI 任务、反色设置等功能,构建文本页面。 ## 效果预览 - -| 预览 | -| -------------------------------------------- | - + + + + + + + + + + + + + + + + + + + + + +
首页TextSwiperWaterFlowGridScrollRefreshList
## 使用说明 1. 安装编译生成的hap包,并打开应用; -2. 首页面会出现对应text选择框,点击选择框进入text界面; +2. 进入首页,可选择不同模块页面。 +3. 点击Text选择框进入Text组件的CAPI接口展示界面; +4. 点击Swiper选择框进入Swiper组件的CAPI接口展示界面; ## 工程目录 ``` -StyledStringNDK +native_node_sample +entry/src/main/cpp/ +├── ArkUINode.h +├── ArkUINodeAdapter.h +├── baseUtils.cpp +├── baseUtils.h +├── CMakeLists.txt (CMake脚本) +├── GridMaker.cpp +├── GridMaker.h +├── ListItemGroup.h +├── ListItemSwipe.h +├── ListMaker.cpp +├── ListMaker.h +├── manager.cpp +├── manager.h +├── napi_init.cpp +├── RefreshMaker.cpp +├── RefreshMaker.h +├── ScrollEvent.h +├── ScrollMaker.cpp +├── ScrollMaker.h +├── ScrollUtils.cpp +├── ScrollUtils.h +├── SwiperMaker.cpp +├── SwiperMaker.h +├── TextMaker.cpp +├── TextMaker.h +├── WaterFlowMaker.cpp +├── WaterFlowMaker.h +└── WaterFlowSection.h + └── types/libentry + ├── Index.d.ts (函数对应的js映射) + └── oh-package.json5 + entry/src/main/ets/ +├── entryability +│ └── EntryAbility.ets +├── entrybackupability +│ └── EntryBackupAbility.ets └── pages - ├── Index.ets (获取导航页面) - └── page_text.ets (文本界面) -entry/src/main/ -├── cpp -│ ├── types -│ │ └── libentry -│ │ └── Index.d.ts (函数对应的js映射) -│ ├── CMakeLists.txt (CMake脚本) -| ├── manager.cpp -| ├── manager.h -│ ├── napi_init.cpp -| ├── baseUtils.cpp -| ├── baseUtils.h -| ├── TextMaker.cpp -│ └── TextMaker.h -└── resources - ├── base - │ ├── element - │ │ ├── color.json - │ │ ├── float.json - │ │ └── string.json - │ └── media + ├── Index.ets (获取导航页面) + ├── page_grid.ets (Grid页面) + ├── page_list.ets (List页面) + ├── page_refresh.ets (Refresh页面) + ├── page_scroll.ets (Scroll页面) + ├── page_swiper.ets (Swiper页面) + ├── page_text.ets (文本界面) + └── page_waterflow.ets (WaterFlow界面) + +entry/src/main/resources/ +├── base +│ ├── element +│ │ ├── color.json +│ │ ├── float.json +│ │ └── string.json +│ ├── media +│ │ ├── background.png +│ │ ├── foreground.png +│ │ ├── layered_image.json +│ │ └── startIcon.png +│ └── profile +│ ├── backup_config.json +│ └── main_pages.json +├── dark +│ └── element +│ └── color.json +└── rawfile ``` ## 相关权限 diff --git a/ArkUIKit/NativeNodeBaseSample/entry/oh-package-lock.json5 b/ArkUIKit/NativeNodeBaseSample/entry/oh-package-lock.json5 deleted file mode 100644 index 5c8c8d64769f4712bca04df64e51eb46442cbc59..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/entry/oh-package-lock.json5 +++ /dev/null @@ -1,18 +0,0 @@ -{ - "meta": { - "stableOrder": true - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "libentry.so@src/main/cpp/types/libentry": "libentry.so@src/main/cpp/types/libentry" - }, - "packages": { - "libentry.so@src/main/cpp/types/libentry": { - "name": "libentry.so", - "version": "1.0.0", - "resolved": "src/main/cpp/types/libentry", - "registryType": "local" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/oh-package-lock.json5 b/ArkUIKit/NativeNodeBaseSample/oh-package-lock.json5 deleted file mode 100644 index 7fcf818273347b97063c0c0a151bb14770ca1c79..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeBaseSample/oh-package-lock.json5 +++ /dev/null @@ -1,27 +0,0 @@ -{ - "meta": { - "stableOrder": true - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.21": "@ohos/hypium@1.0.21" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "@ohos/hamock", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.21": { - "name": "@ohos/hypium", - "version": "1.0.21", - "integrity": "sha512-iyKGMXxE+9PpCkqEwu0VykN/7hNpb+QOeIuHwkmZnxOpI+dFZt6yhPB7k89EgV1MiSK/ieV/hMjr5Z2mWwRfMQ==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.21.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeBaseSample/ohosTest.md b/ArkUIKit/NativeNodeBaseSample/ohosTest.md index bb401db8cea5067c6b683de95441bb64573f476f..3a98183fcd46bd90790a2d105a8414b9a1492f65 100644 --- a/ArkUIKit/NativeNodeBaseSample/ohosTest.md +++ b/ArkUIKit/NativeNodeBaseSample/ohosTest.md @@ -2,7 +2,12 @@ ## 用例表 -| 测试功能 | 预置条件 | 输入 | 预期显示 | 是否自动 | 测试结果 | -| ------------------------------ | ------------ |--------------------------------------------------------------------| ----------------------------------------------------------- | -------- | -------- | -| 启动应用 | 设备正常运行 | 1.开启开发板
2.编译hap包并将hap包及环境烧录进开发板,运行测试用例
| 成功拉起应用。 | 否 | 验证通过 | +| 测试功能 | 预置条件 | 输入 | 预期显示 | 是否自动 | 测试结果 | +| ------------------------------ | ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | -------- | +| 启动应用 | 设备正常运行 | 1.开启开发板
2.编译hap包并将hap包及环境烧录进开发板,运行测试用例
| 成功拉起应用。 | 否 | 验证通过 | | 文本组件及输入框功能展示 | 应用位于首页 | 1.text仅观察以及读取log 2.textinput、textarea均需要点击,输入,回车,撤销,粘贴等操作以及查看log信息 | 1. 页面展示多个文本、输入框及文本域组件2. 各组件样式符合代码配置,输入框可正常输入 | 否 | 验证通过 | +| swiper设置自定义箭头功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第一个swiper左右两侧各有一个圆形的淡灰色的箭头,swiper内容为“0” | 否 | 验证通过 | +| swiper设置自定义导航点功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第二个swiper左上角有一个被选中为红色未被选中为灰色的导航栏,swiper内容为“0” | 否 | 验证通过 | +| swiper设置自定义数字导航栏功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第三个swiper左上角显示数字导航栏,左侧数字为1/14,其中数字1为红色,14为灰色,swiper内容为“0” | 否 | 验证通过 | +| swiper设置常用属性以及事件功能 | 应用位于首页 | 1.点击首页Swiper按钮 | 1.第四个swiper左上角显示数字导航栏,每隔3秒自动滚动并触发滚动事件
2.获取到以A0ff00/Manager为tag的相关日志 | 否 | 验证通过 | + diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/grid.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/grid.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..d5562b6fd02e0953f2093293b0c770404cfc5527 Binary files /dev/null and b/ArkUIKit/NativeNodeBaseSample/screenshot/grid.jpeg differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/index.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/index.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..8b6ab4272d0500d1575740e15dbec15ddc6665a1 Binary files /dev/null and b/ArkUIKit/NativeNodeBaseSample/screenshot/index.jpeg differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/list.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/list.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..7b7b4b1ed63dfb2250ab1ffeb2f0609da40b2c82 Binary files /dev/null and b/ArkUIKit/NativeNodeBaseSample/screenshot/list.jpeg differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/nativeNode.png b/ArkUIKit/NativeNodeBaseSample/screenshot/nativeNode.png deleted file mode 100644 index 7b250284bb902a16be04e865b1a4f8a6e12422e1..0000000000000000000000000000000000000000 Binary files a/ArkUIKit/NativeNodeBaseSample/screenshot/nativeNode.png and /dev/null differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/page_swiper.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/page_swiper.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..714a9b9b5aa1fc5dc638805d0ba595236aec0429 Binary files /dev/null and b/ArkUIKit/NativeNodeBaseSample/screenshot/page_swiper.jpeg differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/refresh.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/refresh.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..4fe0dbe100f6b7b76bb05d7a6c25db3da8a2d912 Binary files /dev/null and b/ArkUIKit/NativeNodeBaseSample/screenshot/refresh.jpeg differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/scroll.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/scroll.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..8858d01b732dddac05656af1604f5e48159b8344 Binary files /dev/null and b/ArkUIKit/NativeNodeBaseSample/screenshot/scroll.jpeg differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/swiper.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/swiper.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..cacae7c84e538588e063dec92dc3c6292498591b Binary files /dev/null and b/ArkUIKit/NativeNodeBaseSample/screenshot/swiper.jpeg differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/text.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/text.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..ed2680839f5cb9e5cc3a9b2a286b98219a3ae16c Binary files /dev/null and b/ArkUIKit/NativeNodeBaseSample/screenshot/text.jpeg differ diff --git a/ArkUIKit/NativeNodeBaseSample/screenshot/waterflow.jpeg b/ArkUIKit/NativeNodeBaseSample/screenshot/waterflow.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..e9d2573e3aa0cb366fdc772929134ca3d67ca13e Binary files /dev/null and b/ArkUIKit/NativeNodeBaseSample/screenshot/waterflow.jpeg differ diff --git a/ArkUIKit/NativeNodeNapiSample/README.md b/ArkUIKit/NativeNodeNapiSample/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8b383ac33fb4ff815854a302c789ec8306872813 --- /dev/null +++ b/ArkUIKit/NativeNodeNapiSample/README.md @@ -0,0 +1,75 @@ +# Native_node_napi + +## 介绍 + +本示例展示了如何通过调用CAPI提供的相关方法来获取navigation组件等组件的相关属性和信息。 + +## 效果预览 + +| 首页 | navigation页面 | +| ---- | -------------------------------------------------------- | +| | | + +## 使用说明 + +1. 安装编译生成的hap包,并打开应用; +2. 进入首页,可选择不同模块页面。 +3. 点击navigation选择框进入navigation组件相关的CAPI接口展示界面,通过点击不同的按钮来触发不同的事件,具体结果在log中查看; + + +## 工程目录 + +``` +native_type_sample +entry/src/main/ets/ +└── pages + ├── Index.ets (获取导航页面) + └── page_navigation.ets (获取导航页面) +entry/src/main/ +├── cpp +│ ├── types +│ │ └── libentry +│ │ └── Index.d.ts (函数对应的js映射) +│ ├── CMakeLists.txt (CMake脚本) +| ├── manager.cpp +| ├── manager.h +│ ├── napi_init.cpp +| ├── ....... +| ├── NavigationContext.cpp +│ └── NavigationContext.h +└── resources + ├── base + │ ├── element + │ │ ├── color.json + │ │ ├── float.json + │ │ └── string.json + │ └── media +``` + +## 相关权限 + +不涉及 + +## 依赖 + +不涉及 + +## 约束和限制 + +1. 本示例支持标准系统上运行,支持设备:RK3568; + +2. 本示例支持API20版本SDK,版本号:6.0.0.36; + +3. 本示例已支持使DevEco Studio 5.1.1 Release (构建版本:5.1.1.840,构建 2025年9月20日)编译运行 + +## 下载 + +如需单独下载本工程,执行如下命令: + +```bash +git init +git config core.sparsecheckout true +echo code/DocsSample/ArkUISample/NativeNodeNapi/native_node_napi > .git/info/sparse-checkout +git remote add origin https://gitcode.com/openharmony/applications_app_samples.git +git pull origin master +``` \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/entry/oh-package-lock.json5 b/ArkUIKit/NativeNodeNapiSample/entry/oh-package-lock.json5 deleted file mode 100644 index 5c8c8d64769f4712bca04df64e51eb46442cbc59..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/entry/oh-package-lock.json5 +++ /dev/null @@ -1,18 +0,0 @@ -{ - "meta": { - "stableOrder": true - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "libentry.so@src/main/cpp/types/libentry": "libentry.so@src/main/cpp/types/libentry" - }, - "packages": { - "libentry.so@src/main/cpp/types/libentry": { - "name": "libentry.so", - "version": "1.0.0", - "resolved": "src/main/cpp/types/libentry", - "registryType": "local" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/oh-package-lock.json5 b/ArkUIKit/NativeNodeNapiSample/oh-package-lock.json5 deleted file mode 100644 index 7fcf818273347b97063c0c0a151bb14770ca1c79..0000000000000000000000000000000000000000 --- a/ArkUIKit/NativeNodeNapiSample/oh-package-lock.json5 +++ /dev/null @@ -1,27 +0,0 @@ -{ - "meta": { - "stableOrder": true - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", - "@ohos/hypium@1.0.21": "@ohos/hypium@1.0.21" - }, - "packages": { - "@ohos/hamock@1.0.0": { - "name": "@ohos/hamock", - "version": "1.0.0", - "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", - "registryType": "ohpm" - }, - "@ohos/hypium@1.0.21": { - "name": "@ohos/hypium", - "version": "1.0.21", - "integrity": "sha512-iyKGMXxE+9PpCkqEwu0VykN/7hNpb+QOeIuHwkmZnxOpI+dFZt6yhPB7k89EgV1MiSK/ieV/hMjr5Z2mWwRfMQ==", - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.21.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/ArkUIKit/NativeNodeNapiSample/screenshots/page_navigation.jpeg b/ArkUIKit/NativeNodeNapiSample/screenshots/page_navigation.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..b33f5ad2181b8044f203a9de4471570e558ab1f8 Binary files /dev/null and b/ArkUIKit/NativeNodeNapiSample/screenshots/page_navigation.jpeg differ diff --git a/ArkUIKit/NativeTypeSample/README.md b/ArkUIKit/NativeTypeSample/README.md index 8cf4e4e3248a4b1b2178d24b356ef5b0e163d8af..6a849823f20184b048fbc9909ef514d16410d38a 100644 --- a/ArkUIKit/NativeTypeSample/README.md +++ b/ArkUIKit/NativeTypeSample/README.md @@ -2,13 +2,13 @@ ## 介绍 -本示例展示了如何创建文本、输入框、文本域、视效、动效等组件,配置其样式、属性与事件设置等功能,构建文本页面。 +本示例展示了如何创建文本、输入框、文本域、视效、动效、滑动容器等组件,配置其样式、属性与事件设置等功能,构建文本页面。 ## 效果预览 -| 预览 | -| -------------------------------------------- | - +| 首页 | Text页面 | Swiper页面 | +| ---- | ----------------------------------------------------- | ------------------------------------------------------- | +| | | | ## 使用说明 1. 安装编译生成的hap包,并打开应用; @@ -18,13 +18,14 @@ ## 工程目录 ``` -StyledStringNDK +native_type_sample entry/src/main/ets/ └── pages ├── Index.ets (获取导航页面) ├── page_animation.ets (动效界面) ├── page_visual_effects.ets (视效界面) ├── page_text.ets (文本界面) + ├── page_swiper.ets (滑动容器页面) ├── page_accessibility.ets (无障碍界面) └── page_embedded_component.ets (嵌入式组件界面) entry/src/main/ @@ -48,6 +49,8 @@ entry/src/main/ | ├── ....... | ├── baseUtils.cpp | ├── baseUtils.h +| ├── SwiperMaker.cpp +| ├── SwiperMaker.h | ├── TextMaker.cpp │ ├── TextMaker.h | ├── AccessibilityMaker.cpp diff --git a/ArkUIKit/NativeTypeSample/screenshot/nativeType.png b/ArkUIKit/NativeTypeSample/screenshots/nativeType.png similarity index 100% rename from ArkUIKit/NativeTypeSample/screenshot/nativeType.png rename to ArkUIKit/NativeTypeSample/screenshots/nativeType.png diff --git a/ArkUIKit/NativeTypeSample/screenshots/page_swiper.jpeg b/ArkUIKit/NativeTypeSample/screenshots/page_swiper.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..714a9b9b5aa1fc5dc638805d0ba595236aec0429 Binary files /dev/null and b/ArkUIKit/NativeTypeSample/screenshots/page_swiper.jpeg differ