diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d2ff20141ceed86d87c0ea5d99481973005bab2b --- /dev/null +++ b/.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/AppScope/app.json5 b/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0b27ddcee853a2d444dce079306abc0b7501940f --- /dev/null +++ b/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.commentreply", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/AppScope/resources/base/element/string.json b/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..9e0ed4ef10ffa00262f8783eb7cba798b87aa8aa --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "CommentReply" + } + ] +} diff --git a/AppScope/resources/base/media/app_icon.png b/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 Binary files /dev/null and b/AppScope/resources/base/media/app_icon.png differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..338e5b0bc22082e0ffcc7121c2ed3897a3ddccb0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/README.md b/README.md index 45ed8d10774fa81f40f41a9c0594747cde892d5c..4d0450704c81ed5854f7c6fad6e259d49e19956b 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,67 @@ -# CommentReply +## 评论回复弹窗 -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} +### 介绍 -#### 软件架构 -软件架构说明 +本示例实现在视频应用中,点击写评论输入框在评论列表上层弹出评论回复模块,在该模块中可进行输入文字、表情、@好友功能。 +### 效果预览 -#### 安装教程 +| 首页 | 评论列表 | 评论回复弹窗(软键盘) | 评论回复弹窗(表情面板) | +|-------------------------------------|---------------------------------------------|-----------------------------------------|-----------------------------------------------| +| ![](./screenshots/devices/home.png) | ![](./screenshots/devices/comment-list.png) | ![](./screenshots/devices/keyboard.png) | ![](./screenshots/devices/emoji-keyboard.png) | -1. xxxx -2. xxxx -3. xxxx +使用说明: -#### 使用说明 +1. 打开应用,在首页点击消息图标,弹出评论列表弹窗。 +2. 点击评论列表下方写评论输入框,弹出评论回复模块弹窗。 +3. 评论模块默认是软键盘输入,点击编辑区域表情按钮,可切换到表情面板输入表情。 +4. 点击@按钮,或通过软键盘输入@符号,显示好友列表,点击好友头像在编辑区域添加@好友内容。 +5. 点击删除按钮,@好友内容先整体选中高亮,再点击删除,@好友内容整体删除。 -1. xxxx -2. xxxx -3. xxxx +### 工程目录 -#### 参与贡献 +``` +├──features +│ ├──home/src/main/ets +│ │ ├──constants +│ │ │ └──HomeConstants.ets // 常量类 +│ │ └──view +│ │ ├──CommentKeyboard.ets // 评论回复模块 +│ │ ├──CommentList.ets // 评论列表 +│ │ ├──CommentSendDialog.ets // 评论发送弹窗 +│ │ ├──Home.ets // 首页 +│ │ ├──HomeContent.ets // 视频页 +│ │ └──NavigationDialog.ets // 基于Navigation弹窗组件 +│ └──home/src/main/resources // 应用静态资源目录 +└──products + ├──entry/src/main/ets + │ ├──entryability + │ │ └──EntryAbility.ets // 程序入口类 + │ └──pages + │ └──Index.ets // 主页面 + └──entry/src/main/resources // 应用静态资源目录 +``` -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +### 具体实现 +1. 使用[Navigation Dialog](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-navigation-navigation-V5)实现弹窗功能。 +2. 使用[RichEditor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-basic-components-richeditor-V5)相关API实现评论模块编辑区域输入文字、表情、@好友功能。 -#### 特技 +### 相关权限 + +不涉及。 + +### 依赖 + +不涉及 + +### 约束与限制 + +1.本示例仅支持标准系统上运行,支持设备:华为手机。 + +2.HarmonyOS系统:HarmonyOS NEXT Beta1及以上。 + +3.DevEco Studio版本:DevEco Studio NEXT Beta1及以上。 + +4.HarmonyOS SDK版本:HarmonyOS NEXT Beta1 SDK及以上。 -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/build-profile.json5 b/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..2c9436e52be68129f750f04d63b8a1f5bba68062 --- /dev/null +++ b/build-profile.json5 @@ -0,0 +1,45 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + "buildOption": { + "strictMode": { + "caseSensitiveCheck": true, + "useNormalizedOHMUrl": true + } + } + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "default", + "srcPath": "./products/default", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, + { + "name": "home", + "srcPath": "./features/home", + } + ] +} \ No newline at end of file diff --git a/features/home/.gitignore b/features/home/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/features/home/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/features/home/Index.ets b/features/home/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..7bcd475032eaa0264fddb6b7a51ebb53261a143f --- /dev/null +++ b/features/home/Index.ets @@ -0,0 +1 @@ +export { Home } from './src/main/ets/view/Home'; diff --git a/features/home/build-profile.json5 b/features/home/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e6773f9f5d76a66d6d19fddc9c6ddb3f5621d3b1 --- /dev/null +++ b/features/home/build-profile.json5 @@ -0,0 +1,31 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest" + } + ] +} diff --git a/features/home/hvigorfile.ts b/features/home/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..42187071482d292588ad40babeda74f7b8d97a23 --- /dev/null +++ b/features/home/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/features/home/oh-package.json5 b/features/home/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f480ab37f3c94d804a9741a33d4eb2ffb5b4d00 --- /dev/null +++ b/features/home/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "name": "home", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "Index.ets", + "author": "", + "license": "Apache-2.0", + "dependencies": {} +} diff --git a/features/home/src/main/ets/constants/HomeConstants.ets b/features/home/src/main/ets/constants/HomeConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..7a6c3e1902ac3814699b13730bb019f36aa4a0fd --- /dev/null +++ b/features/home/src/main/ets/constants/HomeConstants.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024 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. + */ + +export class HomeConstants { + /** + * Size of component + */ + static readonly FIFTH_SIZE: string = '5%'; + static readonly FIFTEEN_SIZE: string = '15%'; + static readonly TWENTY_SIZE: string = '20%'; + static readonly FOURTH_SIZE: string = '40%'; + static readonly FIFTY_SIZE: string = '50%'; + static readonly SIXTY_SIZE: string = '60%'; + static readonly SEVENTY_SIZE: string = '75%'; + static readonly EIGHTY_SIZE: string = '80%'; + static readonly FULL_SIZE: string = '100%'; + + /** + * Text of tabs + */ + static readonly tabBarTitles: string[] = ['首页', '朋友', '发布', '消息', '我']; + + /** + * Constants of window size. + */ + static readonly HALF_WINDOW: number = 12; + static readonly FULL_WINDOW: number = 24; + + /** + * Size of space + */ + static readonly MEDIUM_SPACE: number = 20; + static readonly SMALL_SPACE: number = 10; + + static readonly OPERATE_BUTTON_COUNTS: number[] = [1557, 566, 147]; +} \ No newline at end of file diff --git a/features/home/src/main/ets/view/CommentKeyboard.ets b/features/home/src/main/ets/view/CommentKeyboard.ets new file mode 100644 index 0000000000000000000000000000000000000000..e931ea9a10cf1cf59717c5928c2c0324e989c3ed --- /dev/null +++ b/features/home/src/main/ets/view/CommentKeyboard.ets @@ -0,0 +1,359 @@ +/* + * Copyright (c) 2024 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 { window } from "@kit.ArkUI"; +import { NavigationDialog } from "./NavigationDialog"; + +interface OperateButton { + icon: Resource + onClick?: (event: ClickEvent) => void +} + +export interface User { + id: string, + avatar: ResourceStr + nickname: string +} + +interface ImageInfo { + id: string + title: string + resource: ResourceStr +} + +export interface RichEditorSpan { + value?: string + resourceValue?: ResourceStr + type: 'text' | 'image' | 'builder' + data?: User | ImageInfo +} + +@Component +export struct CommentKeyboard { + private richEditorController = new RichEditorController(); + private frequentEmojiListHeight = 60; + private friends: User[] = [ + { id: '0', avatar: $r('app.media.friend_1'), nickname: '朋友1' }, + { id: '1', avatar: $r('app.media.friend_2'), nickname: '朋友2' }, + ]; + private builderSpans: RichEditorSpan[] = []; + @State keyboardHeight: number = 0; + @State isEmojiKeyboardVisible: boolean = false; + @State isAtFriendListVisible: boolean = false; + @Consume navDialogPageInfos: NavPathStack; + + aboutToAppear(): void { + window.getLastWindow(getContext(this)).then(win => { + this.addKeyboardHeightListener(win); + }); + } + + aboutToDisappear(): void { + window.getLastWindow(getContext(this)).then(win => { + this.removeKeyboardHeightListener(win); + }); + } + + addKeyboardHeightListener(win: window.Window) { + win.on('keyboardHeightChange', height => { + console.info('keyboard height has changed', px2vp(height)); + if (height !== 0) { + this.keyboardHeight = px2vp(height); + return; + } + // if close keyboard, don't set keyboardHeight, avoid EmojiKeyboard height is 0 + if (!this.isEmojiKeyboardVisible) { + // handle keyboard close button click + console.info('click soft keyboard close button'); + this.navDialogPageInfos.pop(); + } + }); + } + + removeKeyboardHeightListener(win: window.Window) { + win.off('keyboardHeightChange'); + } + + getOperateButtons(): OperateButton[] { + return [ + { icon: $r('app.media.at'), onClick: this.onAtButtonClick }, + { + icon: this.isEmojiKeyboardVisible ? $r('app.media.keyboard_circle') : $r('app.media.face'), + onClick: this.onEmojiButtonClick + }, + { icon: $r('app.media.picture') }, + { icon: $r('app.media.paper_plane'), onClick: this.onSendComment } + ]; + } + + onAtButtonClick: (event?: ClickEvent) => void = event => { + const controller = this.richEditorController; + this.isAtFriendListVisible = true; + controller.addTextSpan('@', { offset: controller.getCaretOffset() }); + } + + onEmojiButtonClick: (event: ClickEvent) => void = event => { + this.isEmojiKeyboardVisible = !this.isEmojiKeyboardVisible; + } + + onRichEditorClick: (event: ClickEvent) => void = event => { + this.isEmojiKeyboardVisible = false; + } + + onEmojiClick: (icon: Resource) => void = icon => { + this.richEditorController.addImageSpan(icon, { + offset: this.richEditorController.getCaretOffset(), + imageStyle: { size: [20, 20] } + }); + this.isAtFriendListVisible = false; + } + + onSendComment: () => void = () => { + let builderSpanIndex = 0; + let richEditorSpan: RichEditorSpan; + const richEditorSpans: RichEditorSpan[] = []; + this.richEditorController.getSpans().forEach((span, index) => { + const textSpan = span as RichEditorTextSpanResult; + const imageSpan = span as RichEditorImageSpanResult; + if (textSpan.value) { + richEditorSpan = { value: textSpan.value, type: 'text' }; + } else if (this.isBuilderSpan(span)) { + richEditorSpan = this.builderSpans[builderSpanIndex]; + builderSpanIndex += 1; + } else { + richEditorSpan = { resourceValue: imageSpan.valueResourceStr, type: 'image' }; + } + richEditorSpans.push(richEditorSpan); + }); + console.info('richEditorContent', JSON.stringify(richEditorSpans)); + this.navDialogPageInfos.pop(); + this.navDialogPageInfos.pushPathByName('CommentSendDialog', richEditorSpans); + } + + onAtFriendClick: (friend: User) => void = friend => { + const controller = this.richEditorController; + const offset = controller.getCaretOffset(); + const range: RichEditorRange = { start: offset - 1, end: offset }; + const span = controller.getSpans(range); + if (offset !== 0 && (span[0] as RichEditorTextSpanResult).value === '@') { + controller.deleteSpans(range); + } + controller.addBuilderSpan(() => this.AtSpan(friend.nickname), { + offset: controller.getCaretOffset() + }); + this.setBuilderSpans(controller, friend); + } + + @Builder + AtSpan(nickname: string) { + Text(`@${nickname}`) + .fontColor(0xFF133667) + } + + setBuilderSpans(controller: RichEditorController, friend: User) { + const builderSpan: RichEditorSpan = { + value: `@${friend.nickname}`, + data: friend, + type: 'builder' + }; + const range: RichEditorRange = { end: controller.getCaretOffset() }; + const index = this.getBuilderSpanCount(controller, range) - 1; + this.builderSpans.splice(index, 0, builderSpan); + } + + getBuilderSpanCount(controller: RichEditorController, range: RichEditorRange) { + return controller.getSpans(range).reduce((count: number, span) => { + return this.isBuilderSpan(span) ? count + 1 : count; + }, 0); + } + + aboutToDelete: (value: RichEditorDeleteValue) => boolean = value => { + const controller = this.richEditorController; + const span = value.richEditorDeleteSpans[0]; + if (span && this.isBuilderSpan(span)) { + if (this.hasSelection(controller)) { + this.deleteBuilderSpan(); + return true; + } + controller.setSelection(value.offset, value.offset + 1); + return false; + } + return true; + } + + deleteBuilderSpan() { + const controller = this.richEditorController; + const range: RichEditorRange = { end: controller.getCaretOffset() }; + const index = this.getBuilderSpanCount(controller, range) - 1; + this.builderSpans.splice(index, 1); + } + + isBuilderSpan(span: RichEditorImageSpanResult | RichEditorTextSpanResult): boolean { + return !(span as RichEditorTextSpanResult).value && + !(span as RichEditorImageSpanResult).valueResourceStr?.toString().replaceAll(' ', ''); + } + + hasSelection(controller: RichEditorController) { + const selection = controller.getSelection().selection; + return selection[0] !== selection[1]; + } + + onIMEInputComplete: (result: RichEditorTextSpanResult) => void = result => { + if (result.value) { + this.isAtFriendListVisible = false; + } + } + + aboutToIMEInput: (value: RichEditorInsertValue) => boolean = value => { + if (value.insertValue === '@') { + this.onAtButtonClick(); + return false; + } + return true; + } + + onDeleteComplete: () => void = () => { + const controller = this.richEditorController; + const offset = controller.getCaretOffset(); + const span = controller.getSpans({ start: offset - 1, end: offset }); + if (span[0] && (span[0] as RichEditorTextSpanResult).value === '@') { + this.isAtFriendListVisible = true; + } else { + this.isAtFriendListVisible = false; + } + } + + getEmojiIcons(): Resource[] { + const getRandomNum = () => Math.floor(Math.random() * 2) + 1; + return Array(40).fill(1).map(() => $r(`app.media.emoji_${getRandomNum()}`)); + } + + getFrequentEmojiIcons(): Resource[] { + const getRandomNum = () => Math.floor(Math.random() * 2) + 3; + return Array(10).fill(1).map(() => $r(`app.media.emoji_${getRandomNum()}`)); + } + + @Builder + ToolBar() { + Column() { + RichEditor({ controller: this.richEditorController }) + .customKeyboard(this.isEmojiKeyboardVisible ? this.EmojiKeyboard() : undefined) + .constraintSize({ maxHeight: 120 }) + .placeholder($r('app.string.comment_button_text')) + .defaultFocus(true) + .onClick(this.onRichEditorClick) + .aboutToDelete(this.aboutToDelete) + .onDeleteComplete(this.onDeleteComplete) + .onIMEInputComplete(this.onIMEInputComplete) + .aboutToIMEInput(this.aboutToIMEInput) + Row({ space: 15 }) { + ForEach(this.getOperateButtons(), (operateButton: OperateButton) => { + Image(operateButton.icon) + .width($r('app.float.comment_operate_button_width')) + .onClick(operateButton.onClick) + }, (operateButton: OperateButton) => JSON.stringify(operateButton)) + } + .justifyContent(FlexAlign.End) + .width('100%') + .padding({ bottom: 5, right: 10 }) + } + .margin($r('app.float.padding_small')) + .backgroundColor($r('app.string.comment_button_bg_color')) + .borderRadius(20) + } + + @Builder + EmojiKeyboard() { + Grid() { + ForEach(this.getEmojiIcons(), (icon: Resource) => { + GridItem() { + Image(icon) + .width(45) + .onClick(() => { this.onEmojiClick(icon) }) + } + }) + } + .width('100%') + .height(this.keyboardHeight + this.frequentEmojiListHeight) + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr') + .rowsGap(15) + .padding(10) + .scrollBar(BarState.Off) + } + + @Builder + FrequentEmojiList() { + List({ space: 12 }) { + ForEach(this.getFrequentEmojiIcons(), (icon: Resource) => { + ListItem() { + Image(icon) + .width(40) + .onClick(() => { this.onEmojiClick(icon) }) + } + }) + } + .width('100%') + .height(this.frequentEmojiListHeight) + .padding({ left: 15 }) + .listDirection(Axis.Horizontal) + .scrollBar(BarState.Off) + .alignListItem(ListItemAlign.Center) + .align(Alignment.Start) + } + + @Builder + AtFriendList() { + List({ space: 20 }) { + ForEach(this.friends, (friend: User) => { + ListItem() { + Column() { + Image(friend.avatar) + .width(40) + Text(friend.nickname) + } + .onClick(() => this.onAtFriendClick(friend)) + } + }, (friend: User) => friend.id) + } + .listDirection(Axis.Horizontal) + .scrollBar(BarState.Off) + .width('100%') + .height(this.isAtFriendListVisible ? 70 : 0) + .animation({ duration: 150 }) + .padding({ left: 15, top: 10 }) + .alignListItem(ListItemAlign.Center) + .align(Alignment.Start) + } + + build() { + NavigationDialog({ maskBackgroundColor: 'rgba(0, 0, 0, 0.1)' }) { + Column() { + this.AtFriendList() + this.ToolBar() + Divider() + if (!this.isEmojiKeyboardVisible) { + this.FrequentEmojiList() + } + Column() + .height( + this.isEmojiKeyboardVisible ? + this.keyboardHeight + this.frequentEmojiListHeight : + this.keyboardHeight + ) + } + .backgroundColor(Color.White) + } + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/view/CommentList.ets b/features/home/src/main/ets/view/CommentList.ets new file mode 100644 index 0000000000000000000000000000000000000000..873e40a1449f0ab65bf7e31fcdc5bd23c9676e8a --- /dev/null +++ b/features/home/src/main/ets/view/CommentList.ets @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2024 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 { HomeConstants } from "../constants/HomeConstants"; +import { NavigationDialog } from "./NavigationDialog"; + +@Component +export struct CommentList { + private operateButtonIcons: Resource[] = [ + $r('app.media.at'), + $r('app.media.face'), + $r('app.media.picture'), + $r('app.media.paper_plane') + ] + @Consume navDialogPageInfos: NavPathStack; + + aboutToDisappear(): void { + AppStorage.setOrCreate('commentListHeight', 0); + } + + openCommentKeyboard = () => { + this.navDialogPageInfos.pushPath({ name: 'CommentKeyboard' }); + } + + closeCommentList = () => { + this.navDialogPageInfos.pop(); + } + + onCommentListAreaChange = (oldArea: Area, newArea: Area) => { + AppStorage.setOrCreate('commentListHeight', newArea.height) + } + + @Builder + TitleBar() { + Row() { + Text($r('app.string.comment_list_title')) + .fontSize($r('app.float.comment_title_font_size')) + .fontWeight(FontWeight.Bold) + Blank() + Button() { + Image($r('app.media.cancel')) + .width($r('app.float.close_button_icon_width')) + } + .padding($r('app.float.padding_small')) + .backgroundColor($r('app.string.comment_button_bg_color')) + .onClick(this.closeCommentList) + } + .padding($r('app.float.padding_medium')) + .width(HomeConstants.FULL_SIZE) + } + + @Builder + ToolBar() { + Row({ space: HomeConstants.SMALL_SPACE }) { + Button($r('app.string.comment_button_text')) + .layoutWeight(1) + .align(Alignment.Start) + .backgroundColor($r('app.string.comment_button_bg_color')) + .fontColor($r('app.string.comment_button_text_color')) + .onClick(this.openCommentKeyboard) + ForEach(this.operateButtonIcons, (icon: Resource) => { + Image(icon) + .width($r('app.float.comment_operate_button_width')) + }) + } + .padding($r('app.float.padding_small')) + } + + build() { + NavigationDialog() { + Column() { + this.TitleBar() + Image($r('app.media.comment_list')) + .width(HomeConstants.FULL_SIZE) + this.ToolBar() + } + .backgroundColor(Color.White) + .borderRadius({ + topLeft: $r('app.float.comment_list_border_radius'), + topRight: $r('app.float.comment_list_border_radius') + }) + .padding({ bottom: 20 }) + .onAreaChange(this.onCommentListAreaChange) + } + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/view/CommentSendDialog.ets b/features/home/src/main/ets/view/CommentSendDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..484851519b0b2a34b05930b7e4236c0a0da1b395 --- /dev/null +++ b/features/home/src/main/ets/view/CommentSendDialog.ets @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2024 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 { RichEditorSpan, User } from './CommentKeyboard'; +import { NavigationDialog } from './NavigationDialog'; + +@Component +export struct CommentSendDialog { + @Consume navDialogPageInfos: NavPathStack; + + getComment(): RichEditorSpan[] { + return this.navDialogPageInfos.getParamByName('CommentSendDialog')[0] as RichEditorSpan[]; + } + + build() { + NavigationDialog({ + maskBackgroundColor: 'rgba(0, 0, 0, 0.3)', + alignContent: Alignment.Center + }) { + Column() { + Text('发送的评论内容为:') + .margin({ bottom: 20 }) + Flex({ wrap: FlexWrap.Wrap }) { + ForEach(this.getComment(), (richEditorSpan: RichEditorSpan) => { + if (richEditorSpan.type === 'text') { + Text(richEditorSpan.value) + } else if (richEditorSpan.type === 'image') { + Image(richEditorSpan.resourceValue) + .width(20) + } else { + Text(`${richEditorSpan.value}(`) + .fontColor(0xFF133667) + Text(`id:${(richEditorSpan.data as User).id}; 头像:`) + Image((richEditorSpan.data as User).avatar) + .width(20) + Text(')') + } + }, (richEditorSpan: RichEditorSpan) => JSON.stringify(richEditorSpan)) + } + } + .backgroundColor(Color.White) + .padding(24) + .width('90%') + .borderRadius(32) + .alignItems(HorizontalAlign.Start) + } + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/view/Home.ets b/features/home/src/main/ets/view/Home.ets new file mode 100644 index 0000000000000000000000000000000000000000..d9c1859840c6fd82e55abba8b2fe2fd754e129fd --- /dev/null +++ b/features/home/src/main/ets/view/Home.ets @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2024 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 { HomeConstants } from "../constants/HomeConstants"; +import { CommentKeyboard } from "./CommentKeyboard"; +import { CommentList } from "./CommentList"; +import { CommentSendDialog } from "./CommentSendDialog"; +import { HomeContent } from "./HomeContent"; + +interface TabBar { + icon?: Resource + text?: string +} + +@Extend(Column) +function tabBarContainerStyle() { + .width(HomeConstants.FULL_SIZE) + .height(HomeConstants.FULL_SIZE) + .justifyContent(FlexAlign.Center) +} + +@Component +export struct Home { + private tabBars: TabBar[] = [ + { text: HomeConstants.tabBarTitles[0] }, + { text: HomeConstants.tabBarTitles[1] }, + { icon: $r('app.media.add') }, + { text: HomeConstants.tabBarTitles[3] }, + { text: HomeConstants.tabBarTitles[4] } + ] + @State selectedTabIndex: number = 0 + @Provide navDialogPageInfos: NavPathStack = new NavPathStack() + + @Builder + TabBarTextBuilder(tabBarText: string, tabIndex: number) { + Column() { + Text(tabBarText) + .fontColor(Color.White) + .opacity( + this.selectedTabIndex === tabIndex ? + $r('app.float.tab_bar_text_opacity_active') : + $r('app.float.tab_bar_text_opacity') + ) + } + .tabBarContainerStyle() + } + + @Builder + TabBarIconBuilder(icon: Resource) { + Column() { + Image(icon) + .width($r('app.float.tab_bar_icon_width')) + } + .tabBarContainerStyle() + } + + @Builder + NavDialogPageMap(name: string) { + if (name === 'CommentKeyboard') { + CommentKeyboard() + } else if (name === 'CommentList') { + CommentList() + } else if (name === 'CommentSendDialog') { + CommentSendDialog() + } + } + + onSelectedTabChange(index: number) { + this.selectedTabIndex = index + } + + build() { + Navigation(this.navDialogPageInfos) { + Tabs({ barPosition: BarPosition.End }) { + ForEach(this.tabBars, (tabBar: TabBar, index) => { + TabContent() { + if (index === 0) { + HomeContent() + } + } + .tabBar( + tabBar.icon ? + this.TabBarIconBuilder(tabBar.icon) : + this.TabBarTextBuilder(tabBar.text, index) + ) + }, (tabBar: TabBar) => JSON.stringify(tabBar)) + } + .barHeight(56) + .backgroundColor(Color.Black) + .padding({ bottom: 20 }) + .divider({ strokeWidth: 1, color: 'rgba(255, 255, 255, 0.20)' }) + .onChange((index: number) => { + this.onSelectedTabChange(index) + }) + } + .hideTitleBar(true) + .mode(NavigationMode.Stack) + .navDestination(this.NavDialogPageMap) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/view/HomeContent.ets b/features/home/src/main/ets/view/HomeContent.ets new file mode 100644 index 0000000000000000000000000000000000000000..20127c1706212067e09ee2d113bfd285c8222286 --- /dev/null +++ b/features/home/src/main/ets/view/HomeContent.ets @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2024 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 { HomeConstants } from "../constants/HomeConstants"; +import { display } from "@kit.ArkUI"; + +interface OperateButtonType { + icon: Resource + count: number + onClick?: (event: ClickEvent) => void +} + +@Component +struct OperateButton { + @Require @Prop icon: Resource; + @Require @Prop count: number; + handleClick: (event: ClickEvent) => void = event => {} + + build() { + Column() { + Image(this.icon) + .width($r('app.float.operate_button_icon_width')) + Text(this.count.toString()) + .fontColor(Color.White) + } + .onClick(this.handleClick) + } +} + +@Extend(Text) +function videoInfoStyle() { + .fontSize(14) + .fontColor('rgba(255, 255, 255, 0.80)') +} + +@Component +export struct HomeContent { + private operateButtons: OperateButtonType[] = [ + { + icon: $r('app.media.like'), + count: HomeConstants.OPERATE_BUTTON_COUNTS[0] + }, + { + icon: $r('app.media.comment'), + count: HomeConstants.OPERATE_BUTTON_COUNTS[1], + onClick: this.onCommentButtonClick.bind(this) + }, + { + icon: $r('app.media.share'), + count: HomeConstants.OPERATE_BUTTON_COUNTS[2] + } + ]; + private fullHeight: number = 0; + @Consume navDialogPageInfos: NavPathStack; + @StorageLink('commentListHeight') commentListHeight: number = 0; + + aboutToAppear(): void { + this.setFullHeight(); + } + + async setFullHeight() { + const rects = await display.getAllDisplays() + this.fullHeight = this.getUIContext().px2vp(rects[0].height) + } + + onCommentButtonClick(event: ClickEvent) { + this.navDialogPageInfos.pushPathByName('CommentList', null) + } + + build() { + Stack({ alignContent: Alignment.Top }) { + Image($r('app.media.bg')) + .width(HomeConstants.FULL_SIZE) + .height(this.commentListHeight ? this.fullHeight - this.commentListHeight : '100%') + .objectFit(this.commentListHeight ? ImageFit.Contain : ImageFit.Cover) + Row() { + Column({ space: 15 }) { + Row({ space: 10 }) { + Text($r('app.string.video_title')) + .fontColor(Color.White) + Text($r('app.string.video_title_time')) + .videoInfoStyle() + } + Text($r('app.string.video_info')) + .videoInfoStyle() + Row({ space: 5 }) { + Image($r('app.media.video_music')) + .width(16) + Text($r('app.string.video_info_music')) + .videoInfoStyle() + } + } + .padding(16) + .width('80%') + .alignItems(HorizontalAlign.Start) + Column({ space: HomeConstants.MEDIUM_SPACE }) { + Image($r('app.media.avatar')) + .width($r('app.float.avatar_width')) + ForEach(this.operateButtons, (operateButton: OperateButtonType) => { + OperateButton({ + icon: operateButton.icon, + count: operateButton.count, + handleClick: operateButton.onClick + }) + }, (operateButton: OperateButtonType) => JSON.stringify(operateButton)) + } + .width('20%') + .padding(16) + } + .height(HomeConstants.FULL_SIZE) + .alignItems(VerticalAlign.Bottom) + } + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/view/NavigationDialog.ets b/features/home/src/main/ets/view/NavigationDialog.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebbfb4abb12d15bcb1710871461e2a920554e03f --- /dev/null +++ b/features/home/src/main/ets/view/NavigationDialog.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024 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. + */ + +@Component +export struct NavigationDialog { + @Consume navDialogPageInfos: NavPathStack; + @Prop alignContent: Alignment = Alignment.Bottom; + @Prop maskBackgroundColor: ResourceColor + + @Builder + DefaultContentBuilder() {} + + @BuilderParam + contentBuilderParam: () => void = this.DefaultContentBuilder + + onClose = () => { + this.navDialogPageInfos.pop(); + } + + build() { + NavDestination() { + Stack() { + Column() + .height('100%') + .width('100%') + .backgroundColor(this.maskBackgroundColor) + .onClick(this.onClose) + this.contentBuilderParam() + } + .height('100%') + .alignContent(this.alignContent) + } + .mode(NavDestinationMode.DIALOG) + .hideTitleBar(true) + .expandSafeArea([SafeAreaType.KEYBOARD]) + } +} \ No newline at end of file diff --git a/features/home/src/main/module.json5 b/features/home/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..22f7e0311194065e67a022a775458b051b1ab2b7 --- /dev/null +++ b/features/home/src/main/module.json5 @@ -0,0 +1,9 @@ +{ + "module": { + "name": "home", + "type": "har", + "deviceTypes": [ + "default" + ] + } +} diff --git a/features/home/src/main/resources/base/element/float.json b/features/home/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..2659bc803dcaeb11a6293119c457af431d99d077 --- /dev/null +++ b/features/home/src/main/resources/base/element/float.json @@ -0,0 +1,56 @@ +{ + "float": [ + { + "name": "tab_bar_icon_width", + "value": "36" + }, + { + "name": "tab_bar_text_opacity", + "value": "0.6" + }, + { + "name": "tab_bar_text_opacity_active", + "value": "1" + }, + { + "name": "tab_bar_height", + "value": "56" + }, + { + "name": "operate_button_icon_width", + "value": "36" + }, + { + "name": "avatar_width", + "value": "44" + }, + { + "name": "padding_small", + "value": "10" + }, + { + "name": "padding_medium", + "value": "15" + }, + { + "name": "comment_operate_button_width", + "value": "24" + }, + { + "name": "comment_title_font_size", + "value": "20" + }, + { + "name": "close_button_icon_width", + "value": "18" + }, + { + "name": "comment_list_border_radius", + "value": "32" + }, + { + "name": "comment_button_height", + "value": "40" + } + ] +} \ No newline at end of file diff --git a/features/home/src/main/resources/base/element/string.json b/features/home/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..441e38f2db260d6e6dbb28ef7ae26f8299eef9ce --- /dev/null +++ b/features/home/src/main/resources/base/element/string.json @@ -0,0 +1,52 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + }, + { + "name": "video_title", + "value": "@地理风光" + }, + { + "name": "video_title_time", + "value": "2小时前" + }, + { + "name": "video_info_music", + "value": "创作的音乐" + }, + { + "name": "video_info", + "value": "三江源地区位于青海省南部,平均海拔4000米以上,这里是长江、黄河和..." + }, + { + "name": "comment_list_title", + "value": "23条评论" + }, + { + "name": "comment_button_text", + "value": "写评论" + }, + { + "name": "comment_button_bg_color", + "value": "rgba(0, 0, 0, 0.05)" + }, + { + "name": "comment_button_text_color", + "value": "rgba(0, 0, 0, 0.6)" + }, + { + "name": "comment_keyboard_mask_bgcolor", + "value": "rgba(0, 0, 0, 0.1)" + }, + { + "name": "friend_nickname_1", + "value": "朋友1" + }, + { + "name": "friend_nickname_2", + "value": "朋友2" + } + ] +} diff --git a/features/home/src/main/resources/base/media/add.png b/features/home/src/main/resources/base/media/add.png new file mode 100644 index 0000000000000000000000000000000000000000..a72890b1f229877a487fce4d2e9a10e0884fb070 Binary files /dev/null and b/features/home/src/main/resources/base/media/add.png differ diff --git a/features/home/src/main/resources/base/media/at.svg b/features/home/src/main/resources/base/media/at.svg new file mode 100644 index 0000000000000000000000000000000000000000..e6e9454320431794e15f35fe5a7c6e01bd5fd579 --- /dev/null +++ b/features/home/src/main/resources/base/media/at.svg @@ -0,0 +1,16 @@ + + + Created with Pixso. + + + + + + + + + + + + + diff --git a/features/home/src/main/resources/base/media/avatar.png b/features/home/src/main/resources/base/media/avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..26b3a57d312e9b3a3de28c2b56e13997e7f95a98 Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar.png differ diff --git a/features/home/src/main/resources/base/media/bg.png b/features/home/src/main/resources/base/media/bg.png new file mode 100644 index 0000000000000000000000000000000000000000..2843ed2f84eb7b3a2de2c987172cdd4580e94983 Binary files /dev/null and b/features/home/src/main/resources/base/media/bg.png differ diff --git a/features/home/src/main/resources/base/media/cancel.png b/features/home/src/main/resources/base/media/cancel.png new file mode 100644 index 0000000000000000000000000000000000000000..056c1ca4346a7546e1bc4f6e7c6a62be3a91bbfe Binary files /dev/null and b/features/home/src/main/resources/base/media/cancel.png differ diff --git a/features/home/src/main/resources/base/media/comment.png b/features/home/src/main/resources/base/media/comment.png new file mode 100644 index 0000000000000000000000000000000000000000..185724f593a71dee99ebc3eaba0a7f97ea2324ff Binary files /dev/null and b/features/home/src/main/resources/base/media/comment.png differ diff --git a/features/home/src/main/resources/base/media/comment_list.png b/features/home/src/main/resources/base/media/comment_list.png new file mode 100644 index 0000000000000000000000000000000000000000..9f95106870bed5cb990d571d0f26076a9f115a95 Binary files /dev/null and b/features/home/src/main/resources/base/media/comment_list.png differ diff --git a/features/home/src/main/resources/base/media/emoji_1.png b/features/home/src/main/resources/base/media/emoji_1.png new file mode 100644 index 0000000000000000000000000000000000000000..14fecff532442b08273dad5f55259f49574fcf99 Binary files /dev/null and b/features/home/src/main/resources/base/media/emoji_1.png differ diff --git a/features/home/src/main/resources/base/media/emoji_2.png b/features/home/src/main/resources/base/media/emoji_2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdcca23ba2479648eb4c6a1924c79944ff3a1e72 Binary files /dev/null and b/features/home/src/main/resources/base/media/emoji_2.png differ diff --git a/features/home/src/main/resources/base/media/emoji_3.png b/features/home/src/main/resources/base/media/emoji_3.png new file mode 100644 index 0000000000000000000000000000000000000000..b86ad9d535d11c8d16cec8f9ad1ae24744b58fb4 Binary files /dev/null and b/features/home/src/main/resources/base/media/emoji_3.png differ diff --git a/features/home/src/main/resources/base/media/emoji_4.png b/features/home/src/main/resources/base/media/emoji_4.png new file mode 100644 index 0000000000000000000000000000000000000000..d6d245413f4c3362ee4f3c895a9be503eaaa8322 Binary files /dev/null and b/features/home/src/main/resources/base/media/emoji_4.png differ diff --git a/features/home/src/main/resources/base/media/face.svg b/features/home/src/main/resources/base/media/face.svg new file mode 100644 index 0000000000000000000000000000000000000000..333f98cadd051de6728297b04c118da4f23f1359 --- /dev/null +++ b/features/home/src/main/resources/base/media/face.svg @@ -0,0 +1,16 @@ + + + Created with Pixso. + + + + + + + + + + + + + diff --git a/features/home/src/main/resources/base/media/friend_1.png b/features/home/src/main/resources/base/media/friend_1.png new file mode 100644 index 0000000000000000000000000000000000000000..4774ef15d304098c78d36e827d01b0f8e188d954 Binary files /dev/null and b/features/home/src/main/resources/base/media/friend_1.png differ diff --git a/features/home/src/main/resources/base/media/friend_2.png b/features/home/src/main/resources/base/media/friend_2.png new file mode 100644 index 0000000000000000000000000000000000000000..e026b5d838debc53b4afeb41cbc7a146c83b4441 Binary files /dev/null and b/features/home/src/main/resources/base/media/friend_2.png differ diff --git a/features/home/src/main/resources/base/media/keyboard_circle.png b/features/home/src/main/resources/base/media/keyboard_circle.png new file mode 100644 index 0000000000000000000000000000000000000000..b6013a3abac0a00d17a4a0e5d64d969227deae3b Binary files /dev/null and b/features/home/src/main/resources/base/media/keyboard_circle.png differ diff --git a/features/home/src/main/resources/base/media/like.png b/features/home/src/main/resources/base/media/like.png new file mode 100644 index 0000000000000000000000000000000000000000..6ce65e14753acc838ac375f9c01331d366f8fdf9 Binary files /dev/null and b/features/home/src/main/resources/base/media/like.png differ diff --git a/features/home/src/main/resources/base/media/paper_plane.svg b/features/home/src/main/resources/base/media/paper_plane.svg new file mode 100644 index 0000000000000000000000000000000000000000..bcd28f0545b06296bff05c974adf1070473e6c9a --- /dev/null +++ b/features/home/src/main/resources/base/media/paper_plane.svg @@ -0,0 +1,16 @@ + + + Created with Pixso. + + + + + + + + + + + + + diff --git a/features/home/src/main/resources/base/media/picture.svg b/features/home/src/main/resources/base/media/picture.svg new file mode 100644 index 0000000000000000000000000000000000000000..8f22719adae1bc43a5ef6c1cb240e37e44738373 --- /dev/null +++ b/features/home/src/main/resources/base/media/picture.svg @@ -0,0 +1,16 @@ + + + Created with Pixso. + + + + + + + + + + + + + diff --git a/features/home/src/main/resources/base/media/share.png b/features/home/src/main/resources/base/media/share.png new file mode 100644 index 0000000000000000000000000000000000000000..7c4b0a0a7514fe42ca99b69ca00fef961ad8645a Binary files /dev/null and b/features/home/src/main/resources/base/media/share.png differ diff --git a/features/home/src/main/resources/base/media/video_music.png b/features/home/src/main/resources/base/media/video_music.png new file mode 100644 index 0000000000000000000000000000000000000000..4509b207748754beaa6665cc8df94dd31a913285 Binary files /dev/null and b/features/home/src/main/resources/base/media/video_music.png differ diff --git a/features/home/src/main/resources/en_US/element/string.json b/features/home/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/features/home/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/features/home/src/main/resources/zh_CN/element/string.json b/features/home/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f51a9c8461a55f6312ef950344e3145b7f82d607 --- /dev/null +++ b/features/home/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from package" + } + ] +} diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "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/hvigorfile.ts b/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/hvigorfile.ts @@ -0,0 +1,6 @@ +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/oh-package.json5 b/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..bb12751b97530b9a3504e56e8ed09d8c9ba1fa52 --- /dev/null +++ b/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.19", + "@ohos/hamock": "1.0.0" + } +} diff --git a/products/default/.gitignore b/products/default/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/products/default/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/products/default/build-profile.json5 b/products/default/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4d611879c7913fb0610c686e2399258ab3a6dad1 --- /dev/null +++ b/products/default/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "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/products/default/hvigorfile.ts b/products/default/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/products/default/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/products/default/oh-package.json5 b/products/default/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f79d63efcd5d0fa9581ad7376394ca49bfdb6b4b --- /dev/null +++ b/products/default/oh-package.json5 @@ -0,0 +1,11 @@ +{ + "name": "default", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": { + "home": "file:../../features/home" + } +} \ No newline at end of file diff --git a/products/default/src/main/ets/entryability/EntryAbility.ets b/products/default/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..31333cfc33395f7109359d1fe711693166b9b620 --- /dev/null +++ b/products/default/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,58 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + const mainWindow = windowStage.getMainWindowSync(); + mainWindow.setWindowLayoutFullScreen(true).then(() => { + hilog.info(0x0000, 'testTag', 'Succeeded in setting the window layout to full-screen mode'); + }).catch((err: BusinessError) => { + hilog.info(0x0000, 'testTag', 'Failed to set the window layout to full-screen mode. Cause: %{public}s', JSON.stringify(err) ?? ''); + }) + + const sysBarProps: window.SystemBarProperties = { + statusBarContentColor: '#ffffff' + }; + mainWindow.setWindowSystemBarProperties(sysBarProps).then(() => { + hilog.info(0x0000, 'testTag', 'Succeeded in setting the system bar properties'); + }).catch((err: BusinessError) => { + hilog.info(0x0000, 'testTag', 'Failed to set system bar properties. Cause: %{public}s', JSON.stringify(err) ?? ''); + }) + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/products/default/src/main/ets/entrybackupability/EntryBackupAbility.ets b/products/default/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/products/default/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/products/default/src/main/ets/pages/Index.ets b/products/default/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..3837a07fbb858b3308aae46863103a2d6990c230 --- /dev/null +++ b/products/default/src/main/ets/pages/Index.ets @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 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 { Home } from 'home' + +@Entry +@Component +struct Index { + build() { + Column() { + Home() + } + } +} \ No newline at end of file diff --git a/products/default/src/main/module.json5 b/products/default/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4a0c81ff029da489598dac625718729c3155317f --- /dev/null +++ b/products/default/src/main/module.json5 @@ -0,0 +1,50 @@ +{ + "module": { + "name": "default", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "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" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "EntryBackupAbility", + "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", + "type": "backup", + "exported": false, + "metadata": [ + { + "name": "ohos.extension.backup", + "resource": "$profile:backup_config" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/products/default/src/main/resources/base/element/color.json b/products/default/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/products/default/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/products/default/src/main/resources/base/element/string.json b/products/default/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f94595515a99e0c828807e243494f57f09251930 --- /dev/null +++ b/products/default/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": "label" + } + ] +} \ No newline at end of file diff --git a/products/default/src/main/resources/base/media/background.png b/products/default/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..f939c9fa8cc8914832e602198745f592a0dfa34d Binary files /dev/null and b/products/default/src/main/resources/base/media/background.png differ diff --git a/products/default/src/main/resources/base/media/foreground.png b/products/default/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..4483ddad1f079e1089d685bd204ee1cfe1d01902 Binary files /dev/null and b/products/default/src/main/resources/base/media/foreground.png differ diff --git a/products/default/src/main/resources/base/media/layered_image.json b/products/default/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/products/default/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/products/default/src/main/resources/base/media/startIcon.png b/products/default/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/products/default/src/main/resources/base/media/startIcon.png differ diff --git a/products/default/src/main/resources/base/profile/backup_config.json b/products/default/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/products/default/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/products/default/src/main/resources/base/profile/main_pages.json b/products/default/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/products/default/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/products/default/src/main/resources/en_US/element/string.json b/products/default/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f94595515a99e0c828807e243494f57f09251930 --- /dev/null +++ b/products/default/src/main/resources/en_US/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/products/default/src/main/resources/zh_CN/element/string.json b/products/default/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..597ecf95e61d7e30367c22fe2f8638008361b044 --- /dev/null +++ b/products/default/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/screenshots/devices/comment-list.png b/screenshots/devices/comment-list.png new file mode 100644 index 0000000000000000000000000000000000000000..e5f467dd6525d316861c38c593afe01c4b34a88b Binary files /dev/null and b/screenshots/devices/comment-list.png differ diff --git a/screenshots/devices/comment_list.jpg b/screenshots/devices/comment_list.jpg new file mode 100644 index 0000000000000000000000000000000000000000..870a37b220b9edf16bed48120d240bd1c84ec812 Binary files /dev/null and b/screenshots/devices/comment_list.jpg differ diff --git a/screenshots/devices/emoji-keyboard.jpg b/screenshots/devices/emoji-keyboard.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0ade987e881ac610ab7493567a3ce733e26ab8c3 Binary files /dev/null and b/screenshots/devices/emoji-keyboard.jpg differ diff --git a/screenshots/devices/emoji-keyboard.png b/screenshots/devices/emoji-keyboard.png new file mode 100644 index 0000000000000000000000000000000000000000..e1af813efcd2990b61f6b114ddf0d111c34d7d80 Binary files /dev/null and b/screenshots/devices/emoji-keyboard.png differ diff --git a/screenshots/devices/home.jpg b/screenshots/devices/home.jpg new file mode 100644 index 0000000000000000000000000000000000000000..508fc7430d5c512242f1af3e48d10adb402a24f5 Binary files /dev/null and b/screenshots/devices/home.jpg differ diff --git a/screenshots/devices/home.png b/screenshots/devices/home.png new file mode 100644 index 0000000000000000000000000000000000000000..8b5a4c86175f4dcd5ba9d851b5a70c7fe9c36140 Binary files /dev/null and b/screenshots/devices/home.png differ diff --git a/screenshots/devices/keyboard.jpg b/screenshots/devices/keyboard.jpg new file mode 100644 index 0000000000000000000000000000000000000000..39f4346534db8638f75b6650bc8196c4cf246de0 Binary files /dev/null and b/screenshots/devices/keyboard.jpg differ diff --git a/screenshots/devices/keyboard.png b/screenshots/devices/keyboard.png new file mode 100644 index 0000000000000000000000000000000000000000..2364cbf339c81a78dab76753162ef01186e92381 Binary files /dev/null and b/screenshots/devices/keyboard.png differ