diff --git a/code/ArkTS1.2/ContainernestedslideSample/.gitignore b/code/ArkTS1.2/ContainernestedslideSample/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d2ff20141ceed86d87c0ea5d99481973005bab2b --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/.gitignore @@ -0,0 +1,12 @@ +/node_modules +/oh_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy +**/.test +/.appanalyzer \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/AppScope/app.json5 b/code/ArkTS1.2/ContainernestedslideSample/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d1d07e87295e342f63d924234c1270c38b7701fe --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/AppScope/app.json5 @@ -0,0 +1,36 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "app": { + "bundleName": "com.samples.ContainernestedslideSample", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/code/ArkTS1.2/ContainernestedslideSample/AppScope/resources/base/element/string.json b/code/ArkTS1.2/ContainernestedslideSample/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b03b6608154273ac9bb3af95247e56d81aecf633 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ContainernestedslideSample" + } + ] +} diff --git a/code/ArkTS1.2/ContainernestedslideSample/AppScope/resources/base/media/app_icon.png b/code/ArkTS1.2/ContainernestedslideSample/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/AppScope/resources/base/media/app_icon.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/README.md b/code/ArkTS1.2/ContainernestedslideSample/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c69c2a1274fe338bb2b5595914afe8c3661467d2 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/README.md @@ -0,0 +1,67 @@ +# Scroll容器嵌套多种组件事件处理案例 + +### 介绍 + +Scroll容器嵌套多种组件事件处理案例; + +### 效果预览 + +效果如下所示: + +|Scroll容器嵌套多种组件事件处理案例| +|--------------------------------| +|![Alt text](entry/src/main/resources/base/media/sample.png)| + +使用说明 + +主界面显示Scroll容器嵌套多种组件事件处理案例。 + * 超过一屏可以上下滑动。 + +### 工程目录 + +``` +entry/src/main/ets/ +|---components +| |---CommentPage.ets +|---entryability +| |---EntryAbility.ets +|---mock +| |---NewsDetailData.ets +|---model +| |---NewsCommentModel.ets +|---pages +| |---Index.ets +``` + +### 具体实现 + +* Scroll容器嵌套多种组件事件处理案例,源码参考:[Index.ets](entry/src/main/ets/pages/Index.ets) + * 创建新闻内容和评论区组件,使用Scroll组件进行嵌套。 + * 使用ForEach和List组件循环渲染构造评论区列表。 + * 禁用List滚动手势。 + +### 相关权限 + +无 + +### 依赖 + +无 + +### 约束与限制 + +1. 本示例仅支持标准系统上运行,支持设备:Phone; +2. 本示例为Stage模型,支持API20版本SDK,SDK版本号(API Version 20),镜像版本号(6.0.0.31)。 +3. 本示例需要使用DevEco Studio 版本号(6.0.0.6)版本才可编译运行。 + +### 下载 + +如需单独下载本工程,执行如下命令: + +``` +git init +git config core.sparsecheckout true +echo code/ArkTS1.2/ContainernestedslideSample/ > .git/info/sparse-checkout +git remote add origin https://gitee.com/openharmony/applications_app_samples.git +git pull +``` \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/build-profile.json5 b/code/ArkTS1.2/ContainernestedslideSample/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c83260a8d4a7c41693901753e0c0ea562824569c --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/build-profile.json5 @@ -0,0 +1,68 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "arkTSVersion": "1.2", + "compatibleSdkVersion": "6.0.0(20)", + "runtimeOS": "HarmonyOS", + "buildOption": { + "strictMode": { + "caseSensitiveCheck": true, + "useNormalizedOHMUrl": true + } + } + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/code-linter.json5 b/code/ArkTS1.2/ContainernestedslideSample/code-linter.json5 new file mode 100644 index 0000000000000000000000000000000000000000..87b3919d419c09728067f1b545b7e2d5116adc07 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/code-linter.json5 @@ -0,0 +1,58 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "files": [ + "**/*.ets" + ], + "ignore": [ + "**/src/ohosTest/**/*", + "**/src/test/**/*", + "**/src/mock/**/*", + "**/node_modules/**/*", + "**/oh_modules/**/*", + "**/build/**/*", + "**/.preview/**/*" + ], + "ruleSet": [ + "plugin:@performance/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@security/no-unsafe-aes": "error", + "@security/no-unsafe-hash": "error", + "@security/no-unsafe-mac": "warn", + "@security/no-unsafe-dh": "error", + "@security/no-unsafe-dsa": "error", + "@security/no-unsafe-ecdsa": "error", + "@security/no-unsafe-rsa-encrypt": "error", + "@security/no-unsafe-rsa-sign": "error", + "@security/no-unsafe-rsa-key": "error", + "@security/no-unsafe-dsa-key": "error", + "@security/no-unsafe-dh-key": "error", + "@security/no-unsafe-3des": "error" + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/.gitignore b/code/ArkTS1.2/ContainernestedslideSample/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/build-profile.json5 b/code/ArkTS1.2/ContainernestedslideSample/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..8ac81840b69fd7c78c2024c6570ed01e4292cf6d --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/build-profile.json5 @@ -0,0 +1,29 @@ +{ + "apiType": "stageMode", + "arkTSVersion": "1.2", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/hvigorfile.ts b/code/ArkTS1.2/ContainernestedslideSample/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/obfuscation-rules.txt b/code/ArkTS1.2/ContainernestedslideSample/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..272efb6ca3f240859091bbbfc7c5802d52793b0b --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/oh-package.json5 b/code/ArkTS1.2/ContainernestedslideSample/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..248c3b7541a589682a250f86a6d3ecf7414d2d6a --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/components/CommentPage.ets b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/components/CommentPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e08beb392d7df66b843f288f3b62f20e6031e06 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/components/CommentPage.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NewsCommentModel } from '../model/NewsCommentModel'; +import { Date, Column, Row, VerticalAlign, HorizontalAlign, Image, $r, Text, Span, ImageFit, Blank, Margin, Padding, Component } from '@ohos.arkui.component'; +import { State, StateDecoratedVariable, MutableState, stateOf, observableProxy } from '@ohos.arkui.stateManagement'; + +const FONT_WEIGHT_FIVE_HUNDRED = 500; +const FONT_WEIGHT_FOUR_HUNDRED = 400; + +@Component +export struct CommentPage { + commonData: NewsCommentModel = new NewsCommentModel('', '', '', '', '', '', new Date()); + build() { + Column() { + Row() { + Image(this.commonData.url) + .objectFit(ImageFit.Contain) + .width(30) + .height(30) + .borderRadius(30) + .margin({ top: 10, left: 15 } as Margin) + Column() { + Text() { + Span(this.commonData.user) + .fontSize(14) + .fontWeight(FONT_WEIGHT_FIVE_HUNDRED) + .fontColor('#000000') + Span((new Date().getTime() - this.commonData.commentTime.getTime()) / 1000 <= 5 ? ' 刚刚·杭州' : ' 昨天23:24·杭州') + .fontSize(14) + .fontWeight(FONT_WEIGHT_FOUR_HUNDRED) + .opacity(0.5) + .fontColor('#000000') + } + .width('80%') + .margin({ bottom: 6 } as Margin) + Text(this.commonData.text) + .fontSize(14) + .fontWeight(FONT_WEIGHT_FOUR_HUNDRED) + .opacity(0.8) + .fontColor('#000000') + .lineHeight(20) + .width('80%') + .margin({ bottom: 6 } as Margin) + Row() { + Text('回复 >') + .fontSize(14) + .fontColor('#368AEF') + .fontWeight(FONT_WEIGHT_FOUR_HUNDRED) + .backgroundColor('#dbdbdb') + .borderRadius(5) + .opacity(0.8) + .padding({ left: 3, right: 3, top: 2, bottom: 2 } as Padding) + Blank() + Image($r('app.media.news_follow')) + .width(20) + .height(20) + .objectFit(ImageFit.Fill) + Image($r('app.media.news_HeartBreak')) + .width(20) + .height(20) + .objectFit(ImageFit.Fill) + .margin({ left: 20 } as Margin) + } + .width('85%') + } + .padding({ left: 12, top: 10 } as Padding) + .alignItems(HorizontalAlign.Start) + } + .width('100%') + .alignItems(VerticalAlign.Top) + } + .width('100%') + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/entryability/EntryAbility.ets b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..fe3b52c13f8a90b35013af247f9b5b01443c2fcf --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; +import Want from '@ohos.app.ability.Want'; +import window from '@ohos.window'; +import { BusinessError } from '@ohos.base' +import hilog from '@ohos.hilog' + +class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', 'EntryAbility onCreate'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + hilog.info(0x0000, 'testTag', 'EntryAbility onWindowStageCreate'); + try { + windowStage.loadContent('pages/Index', (err: BusinessError): void => { + hilog.info(0x0000, 'testTag', 'loadContent entering'); + if (err.code) { + hilog.info(0x0000, 'testTag', 'loadContent error'); + return; + } + hilog.info(0x0000, 'testTag', 'loadContent ok'); + }); + } catch (e: Error) { + hilog.info(0x0000, 'testTag', 'loadContent catch error:-----------' + e.message); + } + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/mock/NewsDetailData.ets b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/mock/NewsDetailData.ets new file mode 100644 index 0000000000000000000000000000000000000000..553624dc01967b043ca04f37a863fff636ec4f37 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/mock/NewsDetailData.ets @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { NewsCommentModel } from '../model/NewsCommentModel'; +import { $r } from '@ohos.arkui.component'; + +export function mockData(): Array { + const commentList: Array = new Array(); + commentList.push(new NewsCommentModel('1', $r('app.media.news_image_1'), '你若安好便是晴天', '', '', '国足加油!国足必胜!', new Date('2024-11-01 23:00:00'))) + commentList.push(new NewsCommentModel('2', $r('app.media.news_image_2'), '天要下雨娘要嫁人', '', '', '来点信心,加油加油~', new Date('2024-11-01 23:00:00'))) + commentList.push(new NewsCommentModel('3', $r('app.media.news_image_3'), '太阳打北边出来了', '', '', '下一场什么时候,有直播吗', new Date('2024-11-01 23:00:00'))) + commentList.push(new NewsCommentModel('4', $r('app.media.news_image_4'), '西红柿炒鸡蛋蛋卷(特辣)', '', '', '教练组的战术调整值得肯定,尤其是在中场控制方面有所改善。', new Date('2024-11-01 23:00:00'))) + commentList.push(new NewsCommentModel('5', $r('app.media.news_image_6'), '东边有个塔玛,西边有个喇嘛', '', '', '期待他们在未来的比赛中继续进步!', new Date('2024-11-01 23:00:00'))) + commentList.push(new NewsCommentModel('7', $r('app.media.news_image_7'), '天青色等烟雨而我在等你', '', '', '希望他们能在接下来的比赛中继续发挥,成为球队的中坚力量。',new Date('2024-11-01 23:00:00'))) + commentList.push(new NewsCommentModel('8', $r('app.media.news_image_8'), '大事不妙了', '', '', '与世界强队的差距依然显著,继续努力吧。', new Date('2024-11-01 23:00:00'))) + commentList.push(new NewsCommentModel('9', $r('app.media.news_image_5'), '小猫带耳机', '', '', '国足必胜,加油加油。', new Date('2024-11-01 23:00:00'))) + return commentList; +} + +// 模拟当前用户昵称 +export const curUser: string = '兔子不吃窝边草'; + diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/model/NewsCommentModel.ets b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/model/NewsCommentModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..03c10526ed8190501efc715cae7e7f293831dff9 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/model/NewsCommentModel.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { ResourceStr, Date, DataChangeListener, IDataSource } from '@ohos.arkui.component'; + +/** + * 评论的数据结构 + */ +export class NewsCommentModel { + // 评论id + public id: string; + // 评论头像 + public url: ResourceStr; + // 评论昵称 + public user: string; + // 回复id + public replyId: string; + // 回复用户昵称 + public replyUser: string; + // 回复文本 + public text: string; + // 回复时间 + public commentTime: Date; + // 评论下的回复列表 + + constructor(id: string, url: ResourceStr, user: string, replyId: string, + replyUser: string, text: string, commentTime: Date) { + this.id = id; + this.url = url; + this.user = user; + this.replyId = replyId; + this.replyUser = replyUser; + this.text = text; + this.commentTime = commentTime; + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/pages/Index.ets b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..13ee2940ba8bdd181f50c8f4aebdf2665f1e2177 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { memo, __memo_context_type, __memo_id_type } from '@ohos.arkui.stateManagement' +import { curUser, mockData } from '../mock/NewsDetailData'; +import { NewsCommentModel } from '../model/NewsCommentModel'; +import { CommentPage } from '../components/CommentPage'; +import { UIContext } from '@ohos.arkui.UIContext'; +import hilog from '@ohos.hilog' +import util from '@ohos.util'; +import { Row, FlexAlign, HorizontalAlign, Column, Stack, Alignment, Image, ImageFit, $r, Text, TextAlign, ImageSpan, ImageSpanAlignment, Span, Scroll, ScrollState, OnScrollFrameBeginHandlerResult, OnScrollFrameBeginCallback, Scroller, ScrollDirection, ScrollAlign, BarState, Search, List, ListItem, ListItemAlign, ForEach, Blank, Color, Margin, Padding, Builder, ClickEvent, Component, UserView } from '@ohos.arkui.component' +import { AppStorage, StorageProp, State, StateDecoratedVariable, MutableState, stateOf, observableProxy } from '@ohos.arkui.stateManagement' + +const SEARCH_BUTTON: string = '搜索'; +AppStorage.setOrCreate('PropA', ''); + +@Component +struct MyStateSample { + listScroller: Scroller = new Scroller(); + scroller: Scroller = new Scroller(); + @State commentList: NewsCommentModel[] = new Array(); + curUser: string = curUser; + @StorageProp('PropA') storage: string = ''; + + aboutToAppear() { + this.commentList = mockData(); + } + + onPageShow() { + if (this.storage !== '') { + this.publishComment(); + } + } + + publishComment(): void { + const uuid: string = util.generateRandomUUID(); + const comment: NewsCommentModel = new NewsCommentModel(uuid, $r('app.media.news_user_select'), this.curUser, '', '', this.storage, new Date()); + this.commentList.unshift(comment); + this.commentList = [...this.commentList]; + this.listScroller.scrollToIndex(0, true, ScrollAlign.START); + } + + build() { + Column() { + this.title() + + Scroll(this.scroller) { + Column() { + this.newsBuilder() + this.CommentTitle() + this.listBuilder() + } + .width('100%') + } + .width('100%') + .layoutWeight(1) + .scrollBar(BarState.Off) + + Column() { + Text('发布评论') + .width('100%') + .height(40) + .borderRadius(30) + .backgroundColor(Color.White) + .border({ width: 1, color: '#eeeeee' }) + .padding({ left: 15 } as Padding) + .onClick((e: ClickEvent) => { + this.getUIContext().getRouter().pushUrl({ url: 'pages/CommentInputPage' }); + }) + PublishView() + } + .width('100%') + .padding({ left: 10, right: 10, top: 10 } as Padding) + .height(100) + } + .height('100%') + .width('100%') + } + + @Builder + title() { + Row() { + Stack({ alignContent: Alignment.Bottom }) { + Image($r('app.media.news_batman')) + .width(55) + .height(55) + .borderRadius(30) + Text('+关注') + .fontColor('#ff3d36') + .fontSize(11) + .borderRadius(3) + .height(16) + .width(55) + .backgroundColor('#ffeeee') + .textAlign(TextAlign.Center) + } + Search({ + placeholder: '搜你想看的' + }) + .enableKeyboardOnFocus(false) + .searchButton(SEARCH_BUTTON) + .layoutWeight(1) + .height('75%') + .backgroundColor('#ffffff') + .placeholderColor(Color.Grey) + .placeholderFont({ + size: 14, + weight: 400 + }) + .margin({ left: 15 } as Margin) + Row() { + Text('听') + .fontSize(22) + .margin({ left: 15 } as Margin) + Image($r('app.media.news_more')) + .width(30) + .height(30) + .margin({ left: 15 } as Margin) + } + } + .width('100%') + .height(55) + .padding({ left: 10, right: 10 } as Padding) + } + + @Builder + newsBuilder() { + Column() { + Text('沪媒:国足对阵印尼67年不败金身若被破,足协大概率会考虑换帅') + .width('100%') + .fontSize(20) + .fontWeight(600) + .margin({ top: 10, bottom: 10 } as Margin) + Row() { + Image('https://res.hancibao.com/img/kai/05/5427.png') + .width(40) + .height(40) + Column() { + Text('直播吧') + .fontSize(14) + Text('2024-10-15 09:31 发布于美国 直播吧官方账号') + .fontSize(12) + } + .layoutWeight(1) + .justifyContent(FlexAlign.SpaceBetween) + .alignItems(HorizontalAlign.Start) + .height('100%') + .margin({ left: 10 } as Margin) + Text('+关注') + .fontSize(13) + .fontColor('#ffffff') + .backgroundColor('#ff3f3a') + .borderRadius(3) + .textAlign(TextAlign.Center) + .width(50) + .height(25) + .margin({ left: 10 } as Margin) + } + .width('100%') + .height(40) + .margin({ top: 10, bottom: 10 } as Margin) + Image('https://bpic.588ku.com/back_origin_min_pic/21/04/07/23c8806be022255931d5dcb04c762f37.jpg') + .width('100%') + .objectFit(ImageFit.Contain) + .borderRadius(6) + .margin({ top: 10, bottom: 10 } as Margin) + Text('直播吧10月15日讯 ;对于今晚国足主场对阵印尼的18强赛第4轮比赛,上观新闻发文进行了分析,认为国足对阵印尼67年不败金身若被破,主教练伊万科维奇很可能会就此下课。\n\n' + + '10月15日,青岛青春足球场,克罗地亚籍主教练伊万科维奇执教的中国男足,将在这里交锋2026美加墨世界杯亚洲区18强赛C组的第四个对手——印尼队。尽管历史数据一片光明:国足对阵印尼足球已保持67年不败,历史上更有多次5比0的大比分赢球,然而,保守固执的伊万科维奇用兵迟缓,印尼足球通过归化迅速提升实力,国足此番交锋印尼很有可能迎来颠覆此前历史数据的惊人一幕。\n\n' + + '客场负于澳大利亚队后,中国队主教练伊万科维奇曾表示,对阵印尼队是“真正战斗的开始”。伊万的目标很明确:前三场的对手——日本、沙特和澳大利亚队,都是亚洲一流强队,国足连输三场从结果来说是赛前能想到的;但是,如果要争取小组第四,以获得下阶段比赛的资格,国足就要力争在主场击败印尼队,全取三分。\n\n' + + '其实,在伊万科维奇执教国足在大连11打10竟也能被少一人的沙特队逆转后,中国足协就有过换帅的想法,但被更高层面的机构否定。逃过一劫的伊万科维奇继续获得了两轮执教机会,但更衣室内球员对他的信任已经降至冰点,全国媒体、球迷也缺乏对这位老帅的足够信任。毕竟,国足3场丢了12个球,其中6个都是头球、4个是定位球失分,这些数据足以表明,伊万科维奇领衔的教练组工作不及格,备战不到位。此外,伊万科维奇在人员选拔、战术设计、临场指挥、责任担当等诸多环节,也存在不小的争议。\n\n' + + '有媒体也直接提问伊万科维奇,“过去三场比赛都有补时丢球、定位球失球,教练组是否解决了问题,你的压力大不大?”这位70岁老帅的回答,其实更多像是推卸责任,他再一次甩锅给球员,“我们在补时丢了一些球,具体是5个球,其中有4个是定位球。球员的注意力要更集中,我们要更强调注意力集中到最后一分钟,但不可忽视的是,前三个对手都是小组最强的球队,是亚洲一流球队,长期参加世界杯,比赛难度可想而知。我作为职业教练,四十年的执教经历让我有能力抵抗压力。有机会挑战压力时,我也愿意承担压力。”\n\n' + + '尽管伊万科维奇在输球后从来只会甩锅,但如果此番国足在主场依旧无法取得满意的成绩,遭遇世预赛史无前例的四连败。尤其是国足对阵印尼67年不败金身在青岛被破,第四次引发广大球迷、媒体对教练组的强烈质疑,中国足协大概率会考虑换帅事宜。') + .fontSize(18) + .lineHeight(20) + .margin({ top: 10, bottom: 20 } as Margin) + Text('免责声明:本内容来自xx平台创作者,不代表xx新闻或xx网的观点和立场。') + .width('100%') + .fontSize(14) + Row() { + Image('https://inews.gtimg.com/newsapp_bt/0/1012205723968_6694/0') + .width(40) + .height(40) + .margin({ right: 5 } as Margin) + Text('举报') + } + .width('100%') + .margin({ top: 10, bottom: 10 } as Margin) + } + .width('100%') + .padding({ left: 10, right: 10 } as Padding) + } + + @Builder + CommentTitle() { + Row() { + Text('评论 306') + .fontSize(20) + .fontWeight(700) + Blank() + Text('526 赞 | 49 转发') + .fontSize(14) + .fontWeight(700) + } + .width('95%') + .height(30) + } + + @Builder + listBuilder() { + List({ scroller: this.listScroller }) { + ForEach(this.commentList, (item: NewsCommentModel) => { + ListItem() { + CommentPage({ commonData: item }) + } + }, (item: NewsCommentModel) => item.id) + } + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + .enableScrollInteraction(false) + .width('100%') + } +} + +@Component +struct PublishView { + build() { + Row() { + Text() { + ImageSpan($r('app.media.news_share')) + .width(20) + .height(20) + .objectFit(ImageFit.Fill) + .verticalAlign(ImageSpanAlignment.CENTER) + .margin({ left: 5, right: 8 } as Margin) + Span('分享') + }.width('25%') + Text() { + ImageSpan($r('app.media.news_comment')) + .width(20) + .height(20) + .objectFit(ImageFit.Fill) + .verticalAlign(ImageSpanAlignment.CENTER) + .margin({ left: 5, right: 8 } as Margin) + Span('评论') + }.width('25%') + Text() { + ImageSpan($r('app.media.news_follow')) + .width(20) + .height(20) + .objectFit(ImageFit.Fill) + .verticalAlign(ImageSpanAlignment.CENTER) + .margin({ left: 5, right: 8 } as Margin) + Span('点赞') + }.width('25%') + Text() { + ImageSpan($r('app.media.news_star')) + .width(20) + .height(20) + .objectFit(ImageFit.Fill) + .verticalAlign(ImageSpanAlignment.CENTER) + .margin({ left: 5, right: 8 } as Margin) + Span('收藏') + }.width('25%') + } + .width('100%') + .height(60) + } +} + +export class ComExampleTrivialApplication extends UserView { + getBuilder() { + hilog.info(0x0000, 'testTag', 'getBuilder'); + let wrapper = @memo () => { + hilog.info(0x0000, 'testTag', 'MyStateSample'); + MyStateSample(undefined) + } + return wrapper + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/module.json5 b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..be9a180b17d16103d064486125aa400d38c538ba --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/module.json5 @@ -0,0 +1,42 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet", + ], + "requestPermissions": [ + { + "name": "ohos.permission.INTERNET" + } + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/color.json b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/float.json b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..a0a93dd91fd48f08f3a9532c76e9b26e68d4c034 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/float.json @@ -0,0 +1,8 @@ +{ + "float": [ + { + "name": "page_text_font_size", + "value": "50fp" + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/integer.json b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/integer.json new file mode 100644 index 0000000000000000000000000000000000000000..3b1936d6a96a00d707f9a14b4086f09e4b381961 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/integer.json @@ -0,0 +1,104 @@ +{ + "integer": [ + { + "name": "multiple_files_download_image_size_fifty", + "value": 50 + }, + { + "name": "multiple_files_download_image_size_twenty_five", + "value": 25 + }, + { + "name": "multiple_files_download_text_font_size_fourteen", + "value": 14 + }, + { + "name": "multiple_files_download_text_font_size_twelve", + "value": 12 + }, + { + "name": "multiple_files_download_text_font_size_twenty_five", + "value": 25 + }, + { + "name": "multiple_files_download_text_font_size_twenty", + "value": 20 + }, + { + "name": "multiple_files_download_padding_twenty", + "value": 20 + }, + { + "name": "multiple_files_download_padding_fifteen", + "value": 15 + }, + { + "name": "multiple_files_download_margin_bottom_eighteen", + "value": 18 + }, + { + "name": "multiple_files_download_margin_bottom_twelve", + "value": 12 + }, + { + "name": "multiple_files_download_margin_top_twenty", + "value": 20 + }, + { + "name": "multiple_files_download_margin_top_seven", + "value": 7 + }, + { + "name": "multiple_files_download_margin_top_five", + "value": 5 + }, + { + "name": "multiple_files_download_progress_height", + "value": 5 + }, + { + "name": "multiple_files_download_border_width", + "value": 5 + }, + { + "name": "multiple_files_download_border_radius", + "value": 10 + }, + { + "name": "multiple_files_download_margin_top_thirty", + "value": 30 + }, + { + "name": "multiple_files_download_margin_left_four", + "value": 4 + }, + { + "name": "multiple_files_download_padding_zero", + "value": 0 + }, + { + "name": "multiple_files_download_padding_five", + "value": 5 + }, + { + "name": "multiple_files_download_height_twenty_six", + "value": 26 + }, + { + "name": "multiple_files_download_borderRadius_eight", + "value": 8 + }, + { + "name": "multiple_files_download_borderRadius_twelve", + "value": 12 + }, + { + "name": "multiple_files_download_history_percentage_fifty", + "value": 50 + }, + { + "name": "multiple_files_download_margin_left_sixty", + "value": 60 + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/string.json b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..8e6cb3218a5cc8aef9f11933f5f233b565f28e0f --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "ContainernestedslideSample" + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/background.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/background.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/foreground.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..97014d3e10e5ff511409c378cd4255713aecd85f Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/foreground.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/layered_image.json b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/multiple_files_download_file.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/multiple_files_download_file.png new file mode 100644 index 0000000000000000000000000000000000000000..a323e4d76acc869e00672162e540167576b93c71 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/multiple_files_download_file.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/multiple_files_download_start.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/multiple_files_download_start.png new file mode 100644 index 0000000000000000000000000000000000000000..78100dcba58fcc7cc98d979fe5f025653d823ecb Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/multiple_files_download_start.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/multiple_files_download_stop.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/multiple_files_download_stop.png new file mode 100644 index 0000000000000000000000000000000000000000..5ba740178443c784ba961aec5dca4375b30f7f38 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/multiple_files_download_stop.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_HeartBreak.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_HeartBreak.png new file mode 100644 index 0000000000000000000000000000000000000000..1f2d5d62c170d800ea1a36ee502d31663c55ae77 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_HeartBreak.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_batman.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_batman.png new file mode 100644 index 0000000000000000000000000000000000000000..e87a0fceb9ee13699d368f28058533551feb4571 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_batman.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_comment.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_comment.png new file mode 100644 index 0000000000000000000000000000000000000000..3731a5b7d4f01bbc1255286018058feef07d6574 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_comment.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_follow.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_follow.png new file mode 100644 index 0000000000000000000000000000000000000000..8b955f68c508d8a7c5e511970e7e09f346a35c71 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_follow.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_1.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_1.png new file mode 100644 index 0000000000000000000000000000000000000000..ddbea05998261e0913a99715f1d40223e2fb4fae Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_1.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_2.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_2.png new file mode 100644 index 0000000000000000000000000000000000000000..753e8b834c01afbf81811b94d5f3b9aa62f48698 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_2.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_3.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_3.png new file mode 100644 index 0000000000000000000000000000000000000000..9284d4ea522b82304306b58caa0fc8a3b390e128 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_3.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_4.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_4.png new file mode 100644 index 0000000000000000000000000000000000000000..0405eaa7f7177515eead0de38ac0d4dcfe34e2f7 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_4.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_5.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_5.png new file mode 100644 index 0000000000000000000000000000000000000000..23a5cfbd6b53fd96197be042dfd92e1c86104914 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_5.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_6.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_6.png new file mode 100644 index 0000000000000000000000000000000000000000..7128a6fc2a9d974e0c5c90c46f62529a0f3184af Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_6.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_7.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_7.png new file mode 100644 index 0000000000000000000000000000000000000000..e008a90ba5d87343662f8ea7b3686976e472c522 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_7.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_8.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_8.png new file mode 100644 index 0000000000000000000000000000000000000000..0d228abcbd41b0361c8b3423f75de17f2b36bc11 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_8.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_9.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_9.png new file mode 100644 index 0000000000000000000000000000000000000000..1e0f9686974ba8da052d7f2cfaab4253edd3f384 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_image_9.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_more.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_more.png new file mode 100644 index 0000000000000000000000000000000000000000..aac8db0098ec2d03b07461e8d5807646587454c3 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_more.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_pinglun2.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_pinglun2.png new file mode 100644 index 0000000000000000000000000000000000000000..06cccdc4b93a52d107f05cd4dc7a3ac2f848ac8e Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_pinglun2.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_right.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_right.png new file mode 100644 index 0000000000000000000000000000000000000000..a0e01f88ae5e8728329f294f1a3d2e3c306b912b Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_right.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_share.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_share.png new file mode 100644 index 0000000000000000000000000000000000000000..fb709dcbaf0a2d161635782e8371bc1beac9cf44 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_share.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_star.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_star.png new file mode 100644 index 0000000000000000000000000000000000000000..09688e96cd667299d658a3c54bdaee2989047512 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_star.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_user_select.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_user_select.png new file mode 100644 index 0000000000000000000000000000000000000000..0e12240a062c6f7b958b334c9f06454b06969f16 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/news_user_select.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/sample.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/sample.png new file mode 100644 index 0000000000000000000000000000000000000000..dd345f2f4dcb16a9b9c546d7f9219d1db7002db1 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/sample.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/sample1.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/sample1.png new file mode 100644 index 0000000000000000000000000000000000000000..9f2cb05e25031b1895e9b142aa8493c74faf9281 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/sample1.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/sample2.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/sample2.png new file mode 100644 index 0000000000000000000000000000000000000000..cf4913e63011961de1f7e8c3d1ecb98c1efc05c7 Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/sample2.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/startIcon.png b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/media/startIcon.png differ diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/profile/backup_config.json b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/profile/main_pages.json b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..33a191c20c13d6f76b284811c3ef8923be39c88b --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/Index", + "pages/CommentInputPage" + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/dark/element/color.json b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/dark/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..79b11c2747aec33e710fd3a7b2b3c94dd9965499 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/dark/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#000000" + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/rawfile/news.html b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/rawfile/news.html new file mode 100644 index 0000000000000000000000000000000000000000..e89ca24bf9e3ff8f70e79046526a9ac3f80428ca --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/entry/src/main/resources/rawfile/news.html @@ -0,0 +1,153 @@ + + + + + + + + +
+
+

沪媒:国足对阵印尼67年不败金身若被破,足协大概率会考虑换帅

+
+ +
+
+
+
+
+

+ 图片 +

+

直播吧10月15日讯 对于今晚国足主场对阵印尼的18强赛第4轮比赛,上观新闻发文进行了分析,认为国足对阵印尼67年不败金身若被破,主教练伊万科维奇很可能会就此下课。

+

10月15日,青岛青春足球场,克罗地亚籍主教练伊万科维奇执教的中国男足,将在这里交锋2026美加墨世界杯亚洲区18强赛C组的第四个对手——印尼队。尽管历史数据一片光明:国足对阵印尼足球已保持67年不败,历史上更有多次5比0的大比分赢球,然而,保守固执的伊万科维奇用兵迟缓,印尼足球通过归化迅速提升实力,国足此番交锋印尼很有可能迎来颠覆此前历史数据的惊人一幕。

+

客场负于澳大利亚队后,中国队主教练伊万科维奇曾表示,对阵印尼队是“真正战斗的开始”。伊万的目标很明确:前三场的对手——日本、沙特和澳大利亚队,都是亚洲一流强队,国足连输三场从结果来说是赛前能想到的;但是,如果要争取小组第四,以获得下阶段比赛的资格,国足就要力争在主场击败印尼队,全取三分。

+

其实,在伊万科维奇执教国足在大连11打10竟也能被少一人的沙特队逆转后,中国足协就有过换帅的想法,但被更高层面的机构否定。逃过一劫的伊万科维奇继续获得了两轮执教机会,但更衣室内球员对他的信任已经降至冰点,全国媒体、球迷也缺乏对这位老帅的足够信任。毕竟,国足3场丢了12个球,其中6个都是头球、4个是定位球失分,这些数据足以表明,伊万科维奇领衔的教练组工作不及格,备战不到位。此外,伊万科维奇在人员选拔、战术设计、临场指挥、责任担当等诸多环节,也存在不小的争议。

+

有媒体也直接提问伊万科维奇,“过去三场比赛都有补时丢球、定位球失球,教练组是否解决了问题,你的压力大不大?”这位70岁老帅的回答,其实更多像是推卸责任,他再一次甩锅给球员,“我们在补时丢了一些球,具体是5个球,其中有4个是定位球。球员的注意力要更集中,我们要更强调注意力集中到最后一分钟,但不可忽视的是,前三个对手都是小组最强的球队,是亚洲一流球队,长期参加世界杯,比赛难度可想而知。我作为职业教练,四十年的执教经历让我有能力抵抗压力。有机会挑战压力时,我也愿意承担压力。”

+

尽管伊万科维奇在输球后从来只会甩锅,但如果此番国足在主场依旧无法取得满意的成绩,遭遇世预赛史无前例的四连败。尤其是国足对阵印尼67年不败金身在青岛被破,第四次引发广大球迷、媒体对教练组的强烈质疑,中国足协大概率会考虑换帅事宜。

+
+
+
+
+
+
+
免责声明:本内容来自xx平台创作者,不代表xx新闻或xx网的观点和立场。
+ + 举报 + +
+
+
+
+ + \ No newline at end of file diff --git a/code/ArkTS1.2/ContainernestedslideSample/hvigor/hvigor-config.json5 b/code/ArkTS1.2/ContainernestedslideSample/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..57c58e3641a0b085f39f7f137b9a938ecb20f2fd --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/hvigor/hvigor-config.json5 @@ -0,0 +1,49 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "modelVersion": "5.0.2", + "dependencies": { + "@ohos/hvigor-ohos-online-sign-plugin": "4.0.2" + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/code/ArkTS1.2/ContainernestedslideSample/hvigorfile.ts b/code/ArkTS1.2/ContainernestedslideSample/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f435606b5766719f7203539113d84a2b281b0353 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/hvigorfile.ts @@ -0,0 +1,32 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/code/ArkTS1.2/ContainernestedslideSample/oh-package.json5 b/code/ArkTS1.2/ContainernestedslideSample/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b6f7090658c0e69d5582af5d236fde4eab954ed6 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/oh-package.json5 @@ -0,0 +1,34 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "modelVersion": "5.0.2", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + } +} diff --git a/code/ArkTS1.2/ContainernestedslideSample/ohosTest.md b/code/ArkTS1.2/ContainernestedslideSample/ohosTest.md new file mode 100644 index 0000000000000000000000000000000000000000..6eee4f85025653311c789ec40358ab7e6acbf725 --- /dev/null +++ b/code/ArkTS1.2/ContainernestedslideSample/ohosTest.md @@ -0,0 +1,9 @@ +# 主页Tabs嵌套场景测试用例 + +## 用例表 + +| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | +|-----------------------------------|-------------------------------------|----------------------|------------------------------------|------|------| +| 页面滑动切换 | 1. 需在真机测试
2. 构建并安装测试hap
3.启动测试hap| 1、触摸tab内容滑动,距离不足一半
2、tab内容滑动距离大于一半 | 1、背景条自动回弹
2、背景条会移动到下一个页签,页面切换成功 | 否 | Pass | +| 页面滑动是否正常显示 | 1. 需在真机测试
2. 构建并安装测试hap
3.启动测试hap| 1、进入页面,滑动页面到底部
2、在页面底部时,滑动页面到顶部 | 1、可以滑动到底,无明显卡顿
2、可以滑动到顶,无明显卡顿| 否 | Pass | +| 发布或回复评论 | 1. 需在真机测试
2. 构建并安装测试hap
3.启动测试hap| 1、输入内容,点击发布按钮
2、点击"回复",评论内容,点击发布按钮 | 1、新增评论在评论顶最新一条出现
2、评论的文字成功显示 | 否 | Pass | \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/.gitignore b/code/ArkTS1.2/CustomviewSample/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d2ff20141ceed86d87c0ea5d99481973005bab2b --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/.gitignore @@ -0,0 +1,12 @@ +/node_modules +/oh_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy +**/.test +/.appanalyzer \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/AppScope/app.json5 b/code/ArkTS1.2/CustomviewSample/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..73ebba4a7ba1e16f6f35fbdf81fcfa38bb1bf3d7 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/AppScope/app.json5 @@ -0,0 +1,36 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "app": { + "bundleName": "com.samples.CustomviewSample", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/code/ArkTS1.2/CustomviewSample/AppScope/resources/base/element/string.json b/code/ArkTS1.2/CustomviewSample/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..85e8cacd9188c88ebd62e5bf1ca2dc426eab6dfa --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "CustomviewSample" + } + ] +} diff --git a/code/ArkTS1.2/CustomviewSample/AppScope/resources/base/media/app_icon.png b/code/ArkTS1.2/CustomviewSample/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/AppScope/resources/base/media/app_icon.png differ diff --git a/code/ArkTS1.2/CustomviewSample/README.md b/code/ArkTS1.2/CustomviewSample/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6ded4580a2b09d2a54008cba6a3b5f360f0cbbc2 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/README.md @@ -0,0 +1,57 @@ +# 自定义视图实现Tab效果 + +### 介绍 + +本示例介绍使用Text、List等组件,添加点击、动画等事件 onClick animateTo 自定义视图实现类似Tab效果。; + +### 效果预览 + +效果如下所示: + +![main.jpg](entry/src/main/resources/base/media/main.jpg) + +使用说明 + +1. 自定义视图实现Tab效果 + * 点击页签进行切换,选中态页签字体放大加粗,颜色由灰变黑,起到强调作用。 + * 底部颜色条横线位移到当前选中页签下方,内容区翻页到当前选中页签对应区域。 + +### 工程目录 + +``` +entry/src/main/ets/ +|---pages +| |---Index.ets +``` + +### 具体实现 + +* 自定义视图实现Tab效果案例,源码参考:[Index.ets](entry/src/main/ets/pages/Index.ets) + * 使用ForEach和List组件循环渲染构造Tabs。 + * List添加滑动手势来进行页面的切换,手势响应后,使用scrollToIndex方法来实现平滑的滑动到相应index。 + +### 相关权限 + +无 + +### 依赖 + +无 + +### 约束与限制 + +1. 本示例仅支持标准系统上运行,支持设备:Phone; +2. 本示例为Stage模型,支持API20版本SDK,SDK版本号(API Version 20),镜像版本号(6.0.0.31)。 +3. 本示例需要使用DevEco Studio 版本号(6.0.0.6)版本才可编译运行。 + +### 下载 + +如需单独下载本工程,执行如下命令: + +``` +git init +git config core.sparsecheckout true +echo code/ArkTS1.2/CustomviewSample/ > .git/info/sparse-checkout +git remote add origin https://gitee.com/openharmony/applications_app_samples.git +git pull +``` \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/build-profile.json5 b/code/ArkTS1.2/CustomviewSample/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c83260a8d4a7c41693901753e0c0ea562824569c --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/build-profile.json5 @@ -0,0 +1,68 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "arkTSVersion": "1.2", + "compatibleSdkVersion": "6.0.0(20)", + "runtimeOS": "HarmonyOS", + "buildOption": { + "strictMode": { + "caseSensitiveCheck": true, + "useNormalizedOHMUrl": true + } + } + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/code-linter.json5 b/code/ArkTS1.2/CustomviewSample/code-linter.json5 new file mode 100644 index 0000000000000000000000000000000000000000..87b3919d419c09728067f1b545b7e2d5116adc07 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/code-linter.json5 @@ -0,0 +1,58 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "files": [ + "**/*.ets" + ], + "ignore": [ + "**/src/ohosTest/**/*", + "**/src/test/**/*", + "**/src/mock/**/*", + "**/node_modules/**/*", + "**/oh_modules/**/*", + "**/build/**/*", + "**/.preview/**/*" + ], + "ruleSet": [ + "plugin:@performance/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@security/no-unsafe-aes": "error", + "@security/no-unsafe-hash": "error", + "@security/no-unsafe-mac": "warn", + "@security/no-unsafe-dh": "error", + "@security/no-unsafe-dsa": "error", + "@security/no-unsafe-ecdsa": "error", + "@security/no-unsafe-rsa-encrypt": "error", + "@security/no-unsafe-rsa-sign": "error", + "@security/no-unsafe-rsa-key": "error", + "@security/no-unsafe-dsa-key": "error", + "@security/no-unsafe-dh-key": "error", + "@security/no-unsafe-3des": "error" + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/.gitignore b/code/ArkTS1.2/CustomviewSample/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/build-profile.json5 b/code/ArkTS1.2/CustomviewSample/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..36f9e65afb2abbbbdda625e86543807eee16240c --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/build-profile.json5 @@ -0,0 +1,54 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/hvigorfile.ts b/code/ArkTS1.2/CustomviewSample/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f830cdfd5bfdd8bde92ebfc27fc0562423dca3d --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/hvigorfile.ts @@ -0,0 +1,32 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/code/ArkTS1.2/CustomviewSample/entry/obfuscation-rules.txt b/code/ArkTS1.2/CustomviewSample/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..272efb6ca3f240859091bbbfc7c5802d52793b0b --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/oh-package.json5 b/code/ArkTS1.2/CustomviewSample/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..39ab3f901494a87d5ab258dfaa9e6882de1f5166 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/oh-package.json5 @@ -0,0 +1,36 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/ets/entryability/EntryAbility.ets b/code/ArkTS1.2/CustomviewSample/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..fe3b52c13f8a90b35013af247f9b5b01443c2fcf --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; +import Want from '@ohos.app.ability.Want'; +import window from '@ohos.window'; +import { BusinessError } from '@ohos.base' +import hilog from '@ohos.hilog' + +class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', 'EntryAbility onCreate'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + hilog.info(0x0000, 'testTag', 'EntryAbility onWindowStageCreate'); + try { + windowStage.loadContent('pages/Index', (err: BusinessError): void => { + hilog.info(0x0000, 'testTag', 'loadContent entering'); + if (err.code) { + hilog.info(0x0000, 'testTag', 'loadContent error'); + return; + } + hilog.info(0x0000, 'testTag', 'loadContent ok'); + }); + } catch (e: Error) { + hilog.info(0x0000, 'testTag', 'loadContent catch error:-----------' + e.message); + } + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/ets/pages/Index.ets b/code/ArkTS1.2/CustomviewSample/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd2fddbf1d159cc227a2e0a13c7435c4ca3ac4f4 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { memo, __memo_context_type, __memo_id_type } from '@ohos.arkui.stateManagement' // should be insert by ui-plugins +import { Text, List, ListItem, Column, Button, Image, Row, Stack,ListItemGroup, Divider, Blank, + Tabs, TabContent, Flex, FlexOptions, Callback, px2vp, ItemAlign, BackgroundBrightnessOptions, + ButtonAttribute, ClickEvent, Component, BuilderParam, Padding, $r, SafeAreaEdge, BackgroundBlurStyleOptions, + BarState, NestedScrollOptions, NestedScrollMode, Color, JSON, Alignment, FlexDirection, BarPosition, + FlexAlign, BlurStyle, LazyForEach, ForEach, Builder, Margin, SafeAreaType, MenuItemOptions, + TabsController, TabsOptions ,StackOptions, ThemeColorMode, AdaptiveColor, ResourceStr, SizeOptions, + Reusable, TextOverflowOptions, ListOptions, LinearGradientOptions, Menu, MenuItem, Axis, BorderRadiuses, + WaterFlow, FlowItem, ImageFit, TextAlign, Scroll, ScrollAlign, Scroller, TextOverflow, ShadowStyle, + TabsAnimationEvent, OnTabsAnimationStartCallback, Rating, RatingOptions, GestureGroup, GestureMode, TapGesture, $$, + SheetSize, SheetType, ScrollSizeMode, SheetOptions, CustomBuilder, Entry, + Position, GestureEvent, GestureType, PanGesture, FontWeight, AnimateParam, Curve, PlayMode +} from '@ohos.arkui.component' // TextAttribute should be insert by ui-plugins +import { State, StateDecoratedVariable, MutableState, stateOf, observableProxy } from '@ohos.arkui.stateManagement' // should be insert by ui-plugins +import hilog from '@ohos.hilog' +import { UIContext, Router } from '@ohos.arkui.UIContext' +import router from '@ohos.router' + +@Entry +@Component +export struct CustomView { + // 当前选中的页签index + @State currentIndex: number = 0; + // 颜色条的偏移量 + @State transitionX: number = 30; + // 即将前往的页签index + @State wantGoIndex: number = 0; + // 创建Scroller对象 + private scroller: Scroller = new Scroller(); + // 计算title长度的一半 + private titleLengthHalf: number = 2; + // 颜色条长度的一半 + private colorBarHalf: number = 10; + // title宽度计算基数 + private titleLengthRadix: number = 20; + // 循环因子初始值 + private loopDefault: number = 0; + // duration计算基数 + private durationRadix: number = 200; + // iterations默认值 + private iterationsDefault: number = 1; + // 判断条件值 + private judgmentValue: number = 0; + // currentIndex计算基数 + private currentIndexRadix: number = 1; + // 创建PanGestureOptions对象 + // private panOption: PanGestureOptions = new PanGestureOptions({direction: PanDirection.Left | PanDirection.Right}); + // 是否开始动画标志 + isStartAction: boolean = false; + + aboutToAppear() { + hilog.info(0x0000, 'tabs', '测试初始化生命周期'); + // 获取颜色条偏移量 + this.transitionX = this.getTransitionX(this.currentIndex); + } + + // 获取颜色条偏移量 + getTransitionX(index: number) { + let theNumber: number = 0; + for (let i = this.loopDefault; i <= index; i++) { + const title = this.titleArray[i]; + const titleLength = title.length * this.titleLengthRadix; + if (i === index) { + theNumber += titleLength / this.titleLengthHalf - this.colorBarHalf; + } else { + theNumber += titleLength; + } + } + hilog.info(0x0000, 'tabs', '偏移量'); + return theNumber; + } + + + // 页签显示数据 + private titleArray: Array = ['候补预测', '在线换座', '余票挖掘', '个人中心']; + + changeValue() { + } + + // 实现动画效果 + achieveEffect(temIndex: number) { + // 高性能知识点:scrollToIndex方法,开启smooth动效时,会对经过的所有item进行加载和布局计算,当大量加载item时会导致性能问题 + + this.scroller.scrollToIndex(temIndex, true, ScrollAlign.START); + this.wantGoIndex = temIndex; + // 动画效果 + + this.getUIContext()?.animateTo({ + duration: Math.abs(temIndex - this.currentIndex) * this.durationRadix, + curve: Curve.EaseInOut, + iterations: this.iterationsDefault, + playMode: PlayMode.Normal, + onFinish: () => { + this.currentIndex = temIndex; + } + } as AnimateParam, () => { + this.transitionX = this.getTransitionX(temIndex); + }) + } + + build() { + Column() { + Column() { + Row() { + // TODO 高性能知识点:此处为了演示场景,列表数量只有4个,使用ForEach,列表数量较多的场景,推荐使用LazyForEach+组件复用+缓存列表项实现 + ForEach(this.titleArray, (title: string, idx: number) => { + Text(title) + .id('custom_view_title_' + idx) + // .textAlign(TextAlign.Center) + .height(30) + .width(this.titleLengthRadix * title.length) + .fontColor(this.currentIndex === idx ? + (this.wantGoIndex === idx ? '#111111':'#999999'): + (this.wantGoIndex === idx ? '#111111':'#999999')) + .fontSize(this.currentIndex === idx ? 18 : 14) + .fontWeight(this.currentIndex === idx ? FontWeight.Bold : FontWeight.Normal) + .onClick((e: ClickEvent) => { + // TODO 知识点:页签实现:记录点击index,index变化后,获取颜色条偏移量,刷新页签颜色、字体大小,实现效果 + if (this.currentIndex !== idx) { + // 记录点击index + this.wantGoIndex = idx; + // 动画效果 + this.getUIContext()?.animateTo({ + duration: Math.abs(idx - this.currentIndex) * this.durationRadix, + curve: Curve.EaseInOut, + iterations: this.iterationsDefault, + playMode: PlayMode.Normal, + onFinish: () => { + this.currentIndex = idx; + // 高性能知识点:scrollToIndex方法,开启smooth动效时,会对经过的所有item进行加载和布局计算,当大量加载item时会导致性能问题 + this.scroller.scrollToIndex(this.currentIndex, true, ScrollAlign.START); + } + } as AnimateParam, () => { + // 获取颜色条偏移量 + this.transitionX = this.getTransitionX(idx); + }) + } + }) + }) + } + .id('custom_view_title') + .height(30) + .width('100%') + Row() + .id('custom_view_title_bar') + .width(20) + .height(6) + .borderRadius(3) + .backgroundColor('#3366FF') + .position({x: this.transitionX, y: 30} as Position) + } + .height(40) + .width(320) + + List({ scroller: this.scroller } as ListOptions) { + // 内容区域部分 + // TODO 高性能知识点:此处为了演示场景,列表数量只有4个,使用ForEach,列表数量较多的场景,推荐使用LazyForEach+组件复用+缓存列表项实现 + ForEach(this.titleArray, (item: string, index: number) => { + ListItem() { + Text(item) + .id('custom_view_content_' + index) + .width('100%') + .height(50) + .fontSize(25) + .textAlign(TextAlign.Center) + } + }) + } + .id('custom_view_content') + .scrollBar(BarState.Off) + .listDirection(Axis.Horizontal) + .priorityGesture( + PanGesture() + // TODO 知识点:内容区域实现:添加滑动手势,手势响应后,使用scrollToIndex方法来实现效果 + .onActionUpdate((event: GestureEvent) => { + if (!this.isStartAction) { + this.isStartAction = true; + if (event.offsetX < this.judgmentValue) { + if (this.currentIndex < this.titleArray.length - this.currentIndexRadix) { + const temIndex: number = this.currentIndex + this.currentIndexRadix; + this.achieveEffect(temIndex); + } + } else { + if (this.currentIndex > this.judgmentValue) { + const temIndex: number = this.currentIndex - this.currentIndexRadix; + this.achieveEffect(temIndex); + } + } + } + }) + .onActionEnd((event: GestureEvent) => { + this.isStartAction = false; + }) as GestureType + ) + .backgroundColor('#EEEEEE') + .width('100%') + .height(50) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/module.json5 b/code/ArkTS1.2/CustomviewSample/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f95f9a6e69c03b1b6da379b36fc7aa9ee2c41ac4 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/module.json5 @@ -0,0 +1,64 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/color.json b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..7bccbbf2e9ec34fdab062feaef5506390d2cfa9a --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/color.json @@ -0,0 +1,24 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "font_color_dark", + "value": "#000000" + }, + { + "name": "helper_bindsheet_bgc", + "value": "#303643" + }, + { + "name": "background_blur_selected_text_color", + "value": "#FFEC0707" + }, + { + "name": "background_blur_tabs_bar_background_color", + "value": "#FFE9E9E9" + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/float.json b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..33ea22304f9b1485b5f22d811023701b5d4e35b6 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/float.json @@ -0,0 +1,8 @@ +{ + "float": [ + { + "name": "page_text_font_size", + "value": "50fp" + } + ] +} diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/integer.json b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/integer.json new file mode 100644 index 0000000000000000000000000000000000000000..ce96b23157ebaf0cddbee69137edb1458ea6e143 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/integer.json @@ -0,0 +1,248 @@ +{ + "integer": [ + { + "name": "helper_size", + "value": 30 + }, + { + "name": "nav_destination_title_image_size", + "value": 28 + }, + { + "name": "nav_destination_title_image_background_size", + "value": 40 + }, + { + "name": "nav_destination_title_text_size", + "value": 20 + }, + { + "name": "nav_destination_title_text_margin", + "value": 9 + }, + { + "name": "nav_destination_title_width", + "value": 328 + }, + { + "name": "nav_destination_title_height", + "value": 56 + }, + { + "name": "nav_destination_title_bottom", + "value": 8 + }, + { + "name": "nav_destination_title_image_border_radius", + "value": 100 + }, + { + "name": "swiper_width", + "value": 353 + }, + { + "name": "swiper_height", + "value": 160 + }, + { + "name": "swiper_border_radius", + "value": 16 + }, + { + "name": "swiper_margin_top", + "value": 8 + }, + { + "name": "swiper_margin_bottom", + "value": 8 + }, + { + "name": "helper_help_image_size", + "value": 18 + }, + { + "name": "helper_width", + "value": 40 + }, + { + "name": "helper_border_radius", + "value": 40 + }, + { + "name": "readme_sheet_text_size", + "value": 276 + }, + { + "name": "readme_sheet_size", + "value": 40 + }, + { + "name": "readme_sheet_cancel_image_width", + "value": 20 + }, + { + "name": "readme_sheet_padding", + "value": 17 + }, + { + "name": "readme_sheet_margin", + "value": 16 + }, + { + "name": "nav_destination_padding_bottom", + "value": 64 + }, + { + "name": "nav_destination_padding_bottom_no_title", + "value": 8 + }, + { + "name": "nav_destination_title_text_width", + "value": 250 + }, + { + "name": "collapse_menu_list_border_radius", + "value": 12 + }, + { + "name": "collapse_menu_list_margin_top", + "value": 4 + }, + { + "name": "collapse_menu_list_padding_right", + "value": 12 + }, + { + "name": "collapse_menu_list_margin_left", + "value": 12 + }, + { + "name": "collapse_menu_list_item_margin_top", + "value": 6 + }, + { + "name": "collapse_menu_text_font_size", + "value": 16 + }, + { + "name": "collapse_menu_text_margin_left", + "value": 16 + }, + { + "name": "collapse_menu_arrow_unfold_width", + "value": 24 + }, + { + "name": "collapse_menu_arrow_width", + "value": 12 + }, + { + "name": "collapse_menu_arrow_fold_margin_right", + "value": 6 + }, + { + "name": "collapse_menu_divide_margin_left", + "value": 42 + }, + { + "name": "collapse_menu_divide_margin_right", + "value": 8 + }, + { + "name": "collapse_menu_fourth_level_height", + "value": 48 + }, + { + "name": "background_blur_tab_bar_height", + "value": 60 + }, + { + "name": "functional_scenes_tab_bar_background_width1", + "value": 97 + }, + { + "name": "functional_scenes_tab_bar_background_width2", + "value": 71 + }, + { + "name": "functional_scenes_tab_bar_background_height", + "value": 38 + }, + { + "name": "functional_scenes_tab_bar_background_border_radius", + "value": 21 + }, + { + "name": "functional_scenes_tab_bar_margin", + "value": 9 + }, + { + "name": "functional_scenes_tab_bar_list_margin", + "value": 3 + }, + { + "name": "functional_scenes_tab_bar_list_height", + "value": 38 + }, + { + "name": "functional_scenes_tab_bar_list_padding", + "value": 46 + }, + { + "name": "functional_scenes_tab_bar_image_more", + "value": 20 + }, + { + "name": "functional_scenes_tab_bar_image_more_background_size", + "value": 43 + }, + { + "name": "functional_scenes_tab_bar_image_more_border_radius", + "value": 100 + }, + { + "name": "functional_scenes_tab_bar_image_more_row_width", + "value": 60 + }, + { + "name": "functional_scenes_tab_bar_image_more_row_height", + "value": 43 + }, + { + "name": "functional_scenes_tab_bar_image_more_row_padding", + "value": 13 + }, + { + "name": "functional_scenes_tab_bar_image_more_row_margin", + "value": 8 + }, + { + "name": "functional_scenes_item_width", + "value": 177 + }, + { + "name": "functional_scenes_water_flow_padding_bottom", + "value": 53 + }, + { + "name": "functional_scenes_item_foldable_width", + "value": 158 + }, + { + "name": "functional_scenes_readme_width", + "value": 60 + }, + { + "name": "functional_scenes_readme_height", + "value": 25 + }, + { + "name": "functional_scenes_readme_font_size", + "value": 12 + }, + { + "name": "functional_scenes_rating_width", + "value": 70 + } + ] +} diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/string.json b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..a411ed30dc9df3daa28ef8f5acdb37cb11810f8f --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/element/string.json @@ -0,0 +1,160 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "CustomviewSample" + }, + { + "name": "background_blur_main", + "value": "背景模糊" + }, + { + "name": "background_blur_discover", + "value": "折叠面板" + }, + { + "name": "background_blur_hot", + "value": "瀑布流" + }, + { + "name": "background_blur_my", + "value": "我的" + }, + { + "name": "functional_scenes_page_show", + "value": "page from package" + }, + { + "name": "functional_scenes_difficulty", + "value": "难度 " + }, + { + "name": "functional_scenes_tab_title_data_Native", + "value": "Native" + }, + { + "name": "functional_scenes_tab_title_data_arkui", + "value": "UI布局" + }, + { + "name": "functional_scenes_tab_title_data_other", + "value": "其他" + }, + { + "name": "functional_scenes_tab_title_data_tripartite_library", + "value": "三方库" + }, + { + "name": "functional_scenes_tab_title_data_dynamic_effect", + "value": "动效" + }, + { + "name": "functional_scenes_main_page_top_borderRadius", + "value": "8" + }, + { + "name": "functional_scenes_main_page_list_borderRadius", + "value": "8" + }, + { + "name": "functional_scenes_main_page_padding1", + "value": "10" + }, + { + "name": "functional_scenes_main_page_padding2", + "value": "12" + }, + { + "name": "functional_scenes_main_page_padding3", + "value": "16" + }, + { + "name": "functional_scenes_main_page_padding4", + "value": "18" + }, + { + "name": "functional_scenes_main_page_padding5", + "value": "8" + }, + { + "name": "functional_scenes_main_page_padding6", + "value": "10" + }, + { + "name": "functional_scenes_main_page_padding_list_bottom", + "value": "350" + }, + { + "name": "functional_scenes_main_page_swiper_height", + "value": "200" + }, + { + "name": "functional_scenes_main_page_text_height", + "value": "18" + }, + { + "name": "functional_scenes_main_page_text_width", + "value": "25" + }, + { + "name": "functional_scenes_main_page_text_font_size", + "value": "12" + }, + { + "name": "functional_scenes_main_page_margin1", + "value": "10" + }, + { + "name": "functional_scenes_main_page_margin2", + "value": "12" + }, + { + "name": "functional_scenes_main_page_tab_text_underline", + "value": "2" + }, + { + "name": "functional_scenes_main_page_water_flow_gap", + "value": "6" + }, + { + "name": "functional_scenes_item_gap_half", + "value": "4" + }, + { + "name": "functional_scenes_network_message", + "value": "此功能需联网使用" + }, + { + "name": "functional_scenes_readme", + "value": "查看源码" + }, + { + "name": "functional_scenes_full_size", + "value": "100%" + }, + { + "name": "custom_tab_home", + "value": "首页" + }, + { + "name": "custom_tab_news", + "value": "新品" + }, + { + "name": "custom_tab_friend", + "value": "商城" + }, + { + "name": "custom_tab_mine", + "value": "我的" + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/back_index.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/back_index.svg new file mode 100644 index 0000000000000000000000000000000000000000..0818cbcea6789ebc5b4f337fb232252299b7e45c --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/back_index.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_1.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_1.png new file mode 100644 index 0000000000000000000000000000000000000000..74ce3af508d55e47d47a49450bdc745a48a627bb Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_1.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_2.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_2.png new file mode 100644 index 0000000000000000000000000000000000000000..5411e7ac8de507b7219a1e2d073c98ec725795f5 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_2.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_3.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_3.png new file mode 100644 index 0000000000000000000000000000000000000000..431bc51bab0d0e21736c89fd9eb3836212f81969 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_3.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_4.webp b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_4.webp new file mode 100644 index 0000000000000000000000000000000000000000..3abb5a617a2b3cd397606343ce9d5f017bf0ca80 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/background_pic_4.webp differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_find_normal.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_find_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..69eafb561c07a739bc29b15f38c7fc4e08c346d7 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_find_normal.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_find_select.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_find_select.png new file mode 100644 index 0000000000000000000000000000000000000000..19aa62ec133a06053220699ab3e1d963fd7052b3 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_find_select.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_hot_normal.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_hot_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..3310b14196a8f2dadf76bbde2acae404c956f5e1 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_hot_normal.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_hot_select.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_hot_select.png new file mode 100644 index 0000000000000000000000000000000000000000..706e7c8dcd321b7b9c1a2e98c0481dc8e64306e6 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_hot_select.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_main_normal.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_main_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..ada79f5589d5af7c8a8ed9fa67dfa9f07435f2ee Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_main_normal.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_main_select.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_main_select.png new file mode 100644 index 0000000000000000000000000000000000000000..af4f621097b73b579741d17a549a01c1b9dfb482 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_main_select.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_my_normal.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_my_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..7e9c0747798aa3b4a7b385bc3957c94fa8dbcab3 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_my_normal.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_my_select.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_my_select.png new file mode 100644 index 0000000000000000000000000000000000000000..7895b8cb46876f1ad664cf413545a8f6f52b9957 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/backgroundblur_my_select.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_cart.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_cart.png new file mode 100644 index 0000000000000000000000000000000000000000..b7cc936378606e7905915498a037f2c202acf8ff Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_cart.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_default_icon.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_default_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_default_icon.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_friend.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_friend.svg new file mode 100644 index 0000000000000000000000000000000000000000..37a37252b40ee12e8aa6db651e52f4f96c1d5b7a --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_friend.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_friend_selected.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_friend_selected.svg new file mode 100644 index 0000000000000000000000000000000000000000..db908b3247d4a387517af576a9d26e5bb4f51b96 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_friend_selected.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_home.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_home.svg new file mode 100644 index 0000000000000000000000000000000000000000..7392fa0daa0dec33090bbc10342bfa9aacfef2e6 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_home.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_home + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_home_selected.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_home_selected.svg new file mode 100644 index 0000000000000000000000000000000000000000..751a5c64cff15034e33f9eef3230636b0081c546 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_home_selected.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_home_filled + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_new.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_new.svg new file mode 100644 index 0000000000000000000000000000000000000000..41da014aa7ec77d322e070b0bf28b7cfce2e5051 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_new.svg @@ -0,0 +1,7 @@ + + + ic_gallery_discover + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_new_selected.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_new_selected.svg new file mode 100644 index 0000000000000000000000000000000000000000..40e140b5a2203bd0cf6b34c117dadc0ce7da13d4 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_new_selected.svg @@ -0,0 +1,8 @@ + + + xxhdpi/ic/navigation/discover_action + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_user.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_user.svg new file mode 100644 index 0000000000000000000000000000000000000000..a4c28ffbc49f7eb66f9ade5ab76f4cfb71469170 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_user.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_contacts + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_user_selected.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_user_selected.svg new file mode 100644 index 0000000000000000000000000000000000000000..07e3a3daa5225872b7139417f2dbecd9440d122a --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_user_selected.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_contacts_filled + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_video.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_video.svg new file mode 100644 index 0000000000000000000000000000000000000000..f5cd90d004e9812c74ef9ac4224de439b5070541 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_video.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_video_selected.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_video_selected.svg new file mode 100644 index 0000000000000000000000000000000000000000..d9fe4874cb1742f5cdff75867a25b2221d0dc78f --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/custom_tab_video_selected.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example1.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example1.png new file mode 100644 index 0000000000000000000000000000000000000000..e8e732fc32efa11eb701e09afe5bc2a16b0a29e0 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example1.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example2.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example2.png new file mode 100644 index 0000000000000000000000000000000000000000..e15a9d5b2ae016cf216f5c8beb457ef835fe642f Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example2.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example3.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example3.png new file mode 100644 index 0000000000000000000000000000000000000000..9a5ac68ad513acc8c29d8668d7c000424f9e2142 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example3.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example4.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example4.png new file mode 100644 index 0000000000000000000000000000000000000000..75e06829c832abf33153c9b21997abfb5cd04e34 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/example4.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/foreground.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..97014d3e10e5ff511409c378cd4255713aecd85f Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/foreground.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/functional_scenes_address_exchange.gif b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/functional_scenes_address_exchange.gif new file mode 100644 index 0000000000000000000000000000000000000000..bd9a070650d123b2231d3384e677767830622120 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/functional_scenes_address_exchange.gif differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_down_arrow.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_down_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..351af3d6742d880a5fe8a06d57bff53a6624c85b Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_down_arrow.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_public_cancel.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_public_cancel.svg new file mode 100644 index 0000000000000000000000000000000000000000..11708cc009ca6519b732405a53da6e79ab99f989 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_public_cancel.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_cancel + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_public_more.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_public_more.svg new file mode 100644 index 0000000000000000000000000000000000000000..88fd9e2a80e4c489790c3f835d2bedd7b9a9e330 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_public_more.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_more + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_right_arrow.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_right_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..d5dc67eec85664a24889404b40174e62278f3c74 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/ic_right_arrow.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/img.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/img.png new file mode 100644 index 0000000000000000000000000000000000000000..c69fcc7d031eae79bcbd69ce115ef2ab0ae5cc7c Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/img.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/layered_image.json b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/main.jpg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/main.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b149a766c514371537635db737ffd503ed66abcf Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/main.jpg differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/main.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/main.png new file mode 100644 index 0000000000000000000000000000000000000000..1cd9e54d78378aebb0dba831068237f97ba31db9 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/main.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/startIcon.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/startIcon.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_cart.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_cart.png new file mode 100644 index 0000000000000000000000000000000000000000..b7cc936378606e7905915498a037f2c202acf8ff Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_cart.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_cart_selected.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_cart_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..b49a8b0cbde6bd938a1944ca26283d77facc54fd Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_cart_selected.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_community.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_community.svg new file mode 100644 index 0000000000000000000000000000000000000000..4036c8ec8019c307db7e88a909833436d62b63f2 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_community.svg @@ -0,0 +1,17 @@ + + + discover_shequ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_community_selected.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_community_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..3f922ba641740d06c53c2d90941ab806414275f0 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_community_selected.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_home.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_home.png new file mode 100644 index 0000000000000000000000000000000000000000..3d6ea867d64f3e90b278ec86f10ee39de825781f Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_home.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_new.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_new.png new file mode 100644 index 0000000000000000000000000000000000000000..81efdfd2eb83a97dbf59fb28e5baa4de1fc5f62c Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_new.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_new_selected.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_new_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..8bad8514f88c682521a790486e720858fd16afd4 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_new_selected.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_tabBarMain.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_tabBarMain.png new file mode 100644 index 0000000000000000000000000000000000000000..72852d0769e6e8db449f5273ca0943d908123a9b Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_tabBarMain.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_user.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_user.png new file mode 100644 index 0000000000000000000000000000000000000000..19d7c4de69f30526df035f37fd4a494e510d44a8 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_user.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_user_selected.png b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_user_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..eb04cc0172cec9bb87de3658619927631cbe2823 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tab_user_selected.png differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_homepage.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_homepage.svg new file mode 100644 index 0000000000000000000000000000000000000000..cd456ad983dd898f22b2cd28892aab323d3a8280 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_homepage.svg @@ -0,0 +1,13 @@ + + + ic_edit company + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_homepage_filled.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_homepage_filled.svg new file mode 100644 index 0000000000000000000000000000000000000000..336374e3489a254c74aa6d402afb423d005fc0cf --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_homepage_filled.svg @@ -0,0 +1,13 @@ + + + ic_edit company_filled + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mall.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mall.svg new file mode 100644 index 0000000000000000000000000000000000000000..486947ef9ca03bfdbd7de48d26164e420a8880f9 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mall.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_appstore + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mall_filled.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mall_filled.svg new file mode 100644 index 0000000000000000000000000000000000000000..302452914b5467edb8715cdeb764500d26b56614 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mall_filled.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_appstore_filled + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mine.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mine.svg new file mode 100644 index 0000000000000000000000000000000000000000..271077d92a4f6bcb2e89e365b5f7e9f4d8f7d270 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mine.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_contacts + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mine_filled.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mine_filled.svg new file mode 100644 index 0000000000000000000000000000000000000000..c8cb6dede78796728f24f27b2c9c02af3b2c6a37 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_mine_filled.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_contacts_filled + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_play.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_play.svg new file mode 100644 index 0000000000000000000000000000000000000000..fd027d5b3e27c8bab499c8ad84cf55734abd13d4 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_play.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_play + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_play_video.MP4 b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_play_video.MP4 new file mode 100644 index 0000000000000000000000000000000000000000..9bcf0eaee14311ad17b1dd01043e4da04cbff4c5 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_play_video.MP4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48f6dc6969fd44c46ad3e3940e13b770d2a383ecaa61ca36a9da8d42e69835c3 +size 3043166 diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_preview.jpg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_preview.jpg new file mode 100644 index 0000000000000000000000000000000000000000..391c783cb7d1ae1485ca9f02e9d57e02f5531a81 Binary files /dev/null and b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_preview.jpg differ diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_video.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_video.svg new file mode 100644 index 0000000000000000000000000000000000000000..4efd2acd00dec11e18b69d57a1aa2cb490c22c3f --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_video.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_play_norm + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_video_filled.svg b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_video_filled.svg new file mode 100644 index 0000000000000000000000000000000000000000..39ed68dbc9c54a368f9dbb084b0162c7eef12788 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/media/tabcontentoverflow_video_filled.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_play_norm + + + + + + + + + + \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/profile/backup_config.json b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/profile/main_pages.json b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/dark/element/color.json b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/dark/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..79b11c2747aec33e710fd3a7b2b3c94dd9965499 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/entry/src/main/resources/dark/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#000000" + } + ] +} \ No newline at end of file diff --git a/code/ArkTS1.2/CustomviewSample/hvigor/hvigor-config.json5 b/code/ArkTS1.2/CustomviewSample/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..57c58e3641a0b085f39f7f137b9a938ecb20f2fd --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/hvigor/hvigor-config.json5 @@ -0,0 +1,49 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "modelVersion": "5.0.2", + "dependencies": { + "@ohos/hvigor-ohos-online-sign-plugin": "4.0.2" + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/code/ArkTS1.2/CustomviewSample/hvigorfile.ts b/code/ArkTS1.2/CustomviewSample/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f435606b5766719f7203539113d84a2b281b0353 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/hvigorfile.ts @@ -0,0 +1,32 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/code/ArkTS1.2/CustomviewSample/oh-package.json5 b/code/ArkTS1.2/CustomviewSample/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b6f7090658c0e69d5582af5d236fde4eab954ed6 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/oh-package.json5 @@ -0,0 +1,34 @@ +/** + * + * Copyright (c) 2025 Huawei Device Co., Ltd. + * + * All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice,this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, + * + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +{ + "modelVersion": "5.0.2", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + } +} diff --git a/code/ArkTS1.2/CustomviewSample/ohosTest.md b/code/ArkTS1.2/CustomviewSample/ohosTest.md new file mode 100644 index 0000000000000000000000000000000000000000..1226cd4bc3d821200c7096a70cda3cadb3628443 --- /dev/null +++ b/code/ArkTS1.2/CustomviewSample/ohosTest.md @@ -0,0 +1,8 @@ +# 自定义视图实现Tab效果 + +## 用例表 + +| 测试功能 | 预置条件 | 输入 | 预期输出 | 是否自动 | 测试结果 | +|-----------------------------------|-------------------------------------|----------------------|------------------------------------|------|------| +| 页签点击切换功能 | 1. 需在真机测试
2. 构建并安装测试hap | 1.点击任意页签 | 1.切换至对应页签,页签文本加强显示及页面随后滑动切换至当前页签 | 否 | Pass | +| 页签滑动切换功能 | 1. 需在真机测试
2. 构建并安装测试hap | 1.滑动页签下方文本内容 | 1.切换动画与预期结果与点击切换相同,在非首尾页左右滑动均生效 | 否 | Pass | \ No newline at end of file