diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 Binary files /dev/null and b/.DS_Store differ diff --git a/AppScope/app.json5 b/AppScope/app.json5 new file mode 100755 index 0000000000000000000000000000000000000000..1bb88a4dfaf695f1b9b137f2fd7506cb73659595 --- /dev/null +++ b/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.multdevicecommunication", + "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 100755 index 0000000000000000000000000000000000000000..fba20a0675010b86e51a86658919f2463e02a290 --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MultDeviceCommunication" + } + ] +} diff --git a/AppScope/resources/base/media/app_icon.png b/AppScope/resources/base/media/app_icon.png new file mode 100755 index 0000000000000000000000000000000000000000..cd45accb1dfd2fd0da16c732c72faa6e46b26521 Binary files /dev/null and b/AppScope/resources/base/media/app_icon.png differ diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 73d9c54d21a0c8325bc427b3be4831a6abe48b24..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# MultiDeviceCommunication - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 5826ab5db0751a10808216d61fb7eb18f692aa90..9b9130fb403d2e685fff99e4a6a0c567c3d61283 --- a/README.md +++ b/README.md @@ -1,39 +1,49 @@ -# MultiDeviceCommunication - -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -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/) +# 一多开发实例-即时通讯 + +### 简介 + +基于自适应和响应式布局,实现一次开发,多端部署-即时通讯。 + +#### 介绍 + +本篇Codelab基于自适应布局和响应式布局,实现一次开发,多端部署的即时通讯页面。通过“三层工程架构”实现代码复用,并根据手机、折叠屏以及2in1不同的设备尺寸设计对应页面。 +手机效果如图所示: + +![](screenshots/device/phone.png) + +折叠屏展开态效果如图所示: + +![](screenshots/device/foldable.png) + +2in1效果如图所示: + +![](screenshots/device/pad.png) + +#### 相关概念 + +- 一次开发,多端部署:一套代码工程,一次开发上架,多端按需部署。支撑开发者快速高效的开发支持多种终端设备形态的应用,实现对不同设备兼容的同时,提供跨设备的流转、迁移和协同的分布式体验。 +- 自适应布局:当外部容器大小发生变化时,元素可以根据相对关系自动变化以适应外部容器变化的布局能力。相对关系如占比、固定宽高比、显示优先级等。常见的自适应布局有:线性布局、层叠布局、弹性布局、相对布局等。自适应布局能力可以实现界面显示随外部容器大小连续变化。 +- 响应式布局:当外部容器大小发生变化时,元素可以根据断点、栅格或特定的特征(如屏幕方向、窗口宽高等)自动变化以适应外部容器变化的布局能力。 +- Navigation:页面根容器,一般用于分栏布局场景使用。 + +#### 相关权限 + +不涉及。 + +#### 使用说明 + +- 分别在手机、折叠屏、平板安装并打开应用,不同设备的应用页面通过响应式布局和自适应布局呈现不同的效果。 +- 点击底部消息、通讯录、社交圈,将切换显示对应的标签页,默认显示消息标签页。 + +#### 约束与限制 + +1. 本示例仅支持标准系统上运行,支持设备:华为手机。 +2. HarmonyOS系统:HarmonyOS NEXT Developer Beta1及以上。 +3. DevEco Studio版本:DevEco Studio NEXT Developer Beta1及以上。 +4. HarmonyOS SDK版本:HarmonyOS NEXT Developer Beta1 SDK及以上。 + +### 注意 + +运行时需设置引用所有HSP模块。点击Run > Edit Configurations,选择Deploy Multi Hap标签页,勾选Deploy Multi Hap Packages, 选择使用方模块(phone)和所有HSP模块,点击OK。单击Run > Run "模块名称"(如Run "phone")或![](screenshots/device/run.png)来启动应用/服务的编译构建。 + +![](screenshots/device/config.PNG) diff --git a/build-profile.json5 b/build-profile.json5 new file mode 100755 index 0000000000000000000000000000000000000000..2a19c0eb4bf48654bc249f2c339c40982210c92c --- /dev/null +++ b/build-profile.json5 @@ -0,0 +1,71 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS" + } + ], + "buildModeSet": [ + { + "name": "debug" + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "phone", + "srcPath": "./products/phone", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, + { + "name": "home", + "srcPath": "./features/home", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, + { + "name": "socialCircle", + "srcPath": "./features/socialCircle", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + }, + { + "name": "base", + "srcPath": "./common/base", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/common/base/Index.ets b/common/base/Index.ets new file mode 100755 index 0000000000000000000000000000000000000000..c83f22e3e12fd7290909cf375e82450277d3a393 --- /dev/null +++ b/common/base/Index.ets @@ -0,0 +1,20 @@ +export { BreakpointConstants } from "./src/main/ets/constants/BreakpointConstants"; + +export { TabInfoModel } from "./src/main/ets/viewmodel/CommonViewModel"; + +export { TabText } from "./src/main/ets/views/text/TabText"; + +export { IntroduceText } from "./src/main/ets/views/text/IntroduceText"; + +export { StandardIcon } from "./src/main/ets/views/image/StandardIcon"; + +export { NormalText } from "./src/main/ets/views/text/NormalText"; + +export { BreakpointType } from "./src/main/ets/utils/Breakpoint/BreakpointType"; + +export { default as Logger } from "./src/main/ets/utils/Logger/Logger"; + +export { BaseConstants, CurrentFeature, CurrentPage,DeviceTypes } from "./src/main/ets/constants/BaseConstants"; + +export { Adaptive } from "./src/main/ets/viewmodel/AdaptiveViewModel"; + diff --git a/common/base/build-profile.json5 b/common/base/build-profile.json5 new file mode 100755 index 0000000000000000000000000000000000000000..78a5a3f1f587ddd84cd8f23ea0f6a818d6d25676 --- /dev/null +++ b/common/base/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + "arkOptions": { + // "apPath": "./modules.ap" /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */ + } + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + } + ] +} \ No newline at end of file diff --git a/common/base/hvigorfile.ts b/common/base/hvigorfile.ts new file mode 100755 index 0000000000000000000000000000000000000000..64fa6f97b15f9d477f14026c181352882b94a21b --- /dev/null +++ b/common/base/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hspTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hspTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/common/base/obfuscation-rules.txt b/common/base/obfuscation-rules.txt new file mode 100755 index 0000000000000000000000000000000000000000..3ae3d22892781d9b4f8833eb1b19d819c3032d58 --- /dev/null +++ b/common/base/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/common/base/oh-package.json5 b/common/base/oh-package.json5 new file mode 100755 index 0000000000000000000000000000000000000000..95cbac4429e401c044a01e4da1ad3c20c38bd1e1 --- /dev/null +++ b/common/base/oh-package.json5 @@ -0,0 +1,11 @@ +{ + "license": "Apache-2.0", + "devDependencies": {}, + "author": "", + "name": "base", + "description": "Please describe the basic information.", + "main": "Index.ets", + "version": "1.0.0", + "dynamicDependencies": {}, + "dependencies": {} +} diff --git a/common/base/src/main/ets/constants/BaseConstants.ets b/common/base/src/main/ets/constants/BaseConstants.ets new file mode 100755 index 0000000000000000000000000000000000000000..ad12576a544cffc69cb7e267f454ce771015d2a8 --- /dev/null +++ b/common/base/src/main/ets/constants/BaseConstants.ets @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2023 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 BaseConstants { + /** + * Component size + */ + static readonly FULL_PERCENT: string = '100%'; + static readonly FULL_SIZE: string = '100%'; + static readonly FULL_HEIGHT: string = '100%'; + static readonly FULL_WIDTH: string = '100%'; + static readonly NINETY_WIDTH_PERCENT: string = '90%'; + static readonly IMAGE_ONE_WIDTH_SM: string = '66.6%'; + static readonly IMAGE_ONE_WIDTH_MD: string = '63.8%'; + static readonly IMAGE_ONE_WIDTH_LG: string = '32.1%'; + static readonly TAB_PADDING_TOP: string = '28.6%' + static readonly TAB_PADDING_BOTTOM: string = '28.6%' + static readonly HOME_LIST_WIDTH: string = '37%' + static readonly APPLET_LIST_WIDTH: string = '37%' + static readonly IMAGE_ONE_ASPECT_RATIO: number = 1.33; + static readonly SMALL_MINI_FONT_SIZE: Resource = $r('app.float.smaller_mini_font_size'); + /** + * Text property + */ + static readonly FONT_FAMILY_SEMI_BOLD: Resource = $r('app.float.font_family_semi_bold'); + static readonly FONT_FAMILY_NORMAL: Resource = $r('app.float.font_family_normal'); + static readonly FONT_FAMILY_BOLD: Resource = $r('app.float.font_family_bold'); + static readonly FONT_FAMILY_MEDIUM: Resource = $r('app.float.font_family_medium'); + static readonly FONT_WEIGHT_SEVEN: number = 700; + static readonly FONT_WEIGHT_SIX: number = 600; + static readonly FONT_WEIGHT_FIVE: number = 500; + static readonly FONT_WEIGHT_FOUR: number = 400; + static readonly FONT_SIZE_TEN: Resource = $r('app.float.font_size_ten'); + static readonly FONT_SIZE_ELEVEN: Resource = $r('app.float.font_size_eleven'); + static readonly FONT_SIZE_TWELVE: Resource = $r('app.float.font_size_twelve'); + static readonly FONT_SIZE_FOURTEEN: Resource = $r('app.float.font_size_fourteen'); + static readonly FONT_SIZE_SIXTEEN: Resource = $r('app.float.font_size_sixteen'); + static readonly FONT_SIZE_EIGHTEEN: Resource = $r('app.float.font_size_eighteen'); + static readonly FONT_SIZE_TWENTY: Resource = $r('app.float.font_size_twenty'); + static readonly FONT_SIZE_TWENTY_FOUR: Resource = $r('app.float.font_size_twenty_four'); + static readonly FONT_SIZE_THIRTY_TWO: Resource = $r('app.float.font_size_thirty_two'); + /** + * Application about + */ + static readonly SPLIT_DOCUMENT_SCREEN = false; + static readonly SPLIT_APPLET_SCREEN = false; + /** + * Flex about + */ + static readonly FLEX_GROW_ONE = 1; + static readonly LAYOUT_WEIGHT_ONE = 1; + static readonly FLEX_SHRINK_ZERO = 0; + static readonly FLEX_SHRINK_ONE = 1; + /** + * HomeTab + */ + static readonly HOME_TAB_HEIGHT_SM: string = '56vp'; + static readonly HOME_TAB_HEIGHT_MD: string = '56vp'; + static readonly HOME_TAB_HEIGHT_LG: string = '100%'; + static readonly HOME_TAB_WIDTH_SM: string = '100%'; + static readonly HOME_TAB_WIDTH_MD: string = '100%'; + static readonly HOME_TAB_WIDTH_LG: string = '96vp'; + static readonly CONTACTS_PHONE_WIDTH_SM: string = '27%'; + static readonly CONTACTS_PHONE_WIDTH_MD: string = '28%'; + static readonly CONTACTS_PHONE_WIDTH_LG: string = '25%'; + static readonly CONTACTS_DETAIL_HEIGHT_SM: string = '100%'; + static readonly CONTACTS_DETAIL_HEIGHT_MD: string = '100%'; + static readonly CONTACTS_DETAIL_HEIGHT_LG: string = '90%'; + static readonly CONTACTS_ITEM_HEIGHT_SM: string = '11%'; + static readonly CONTACTS_ITEM_HEIGHT_MD: string = '11%'; + static readonly CONTACTS_ITEM_HEIGHT_LG: string = '10%'; + /** + * Document tab + */ + static readonly DOCUMENT_TITLE_HEIGHT_SM: string = '33%'; + static readonly DOCUMENT_TITLE_HEIGHT_MD: string = '58%'; + static readonly DOCUMENT_TITLE_HEIGHT_LG: string = '100%'; + static readonly DOCUMENT_TITLE_SPACE_SM: number = 32; + static readonly DOCUMENT_TITLE_SPACE_MD: number = 56; + static readonly DOCUMENT_TITLE_SPACE_LG: number = 103; + /** + * Component opacity value: 1. + */ + static readonly FULL_OPACITY: number = 1; + /** + * Component opacity value: 0.6. + */ + static readonly SIXTY_OPACITY: number = 0.6; + /** + * Device grid column list. + */ + static readonly DEVICE_GRID_COLUMNS: string[] = ['1fr 1fr', '1fr 1fr 1fr', '1fr 1fr 1fr 1fr', '1fr 1fr 1fr 1fr 1fr', + '1fr 1fr 1fr 1fr 1fr 1fr 1fr']; + /** + * Device 2in1. + */ + static readonly DEVICE_2IN1: string = '2in1'; +} + +/** + * Current feature home, applet or document + */ +export enum CurrentFeature { + HOME = 0, + APPLET = 1, + DOCUMENT = 2 +} + +/** + * Current page home,conversation or socialCircle + */ +export enum CurrentPage { + HOME = 0, + CONVERSATION = 1, + SOCIAL_CIRCLE = 2, + ME = 3 +} + +export enum DeviceTypes { + PHONE = 'phone', + TABLET = 'tablet', + "2IN1" = '2in1', +} \ No newline at end of file diff --git a/common/base/src/main/ets/constants/BreakpointConstants.ets b/common/base/src/main/ets/constants/BreakpointConstants.ets new file mode 100755 index 0000000000000000000000000000000000000000..60a209127c02e9ddcc71349963af5d2af3da77b9 --- /dev/null +++ b/common/base/src/main/ets/constants/BreakpointConstants.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 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. + */ + +/** + * Constants for breakpoint. + */ +export class BreakpointConstants { + /** + * Breakpoints that represent smaller device types. + */ + static readonly BREAKPOINT_XS: string = 'xs'; + /** + * Breakpoints that represent small device types. + */ + static readonly BREAKPOINT_SM: string = 'sm'; + /** + * Breakpoints that represent middle device types. + */ + static readonly BREAKPOINT_MD: string = 'md'; + /** + * Breakpoints that represent large device types. + */ + static readonly BREAKPOINT_LG: string = 'lg'; + /** + * Breakpoints that represent large device types. + */ + static readonly BREAKPOINT_SCOPE: number[] = [0, 320, 600, 840]; + /** + * Grid row column list. + */ + static readonly GRID_ROW_COLUMNS: number[] = [12, 15, 4]; + /** + * Grid column span list. + */ + static readonly GRID_COLUMN_SPANS: number[] = [12, 6, 7, 5, 3, 4, 2]; +} \ No newline at end of file diff --git a/common/base/src/main/ets/pages/Index.ets b/common/base/src/main/ets/pages/Index.ets new file mode 100755 index 0000000000000000000000000000000000000000..fa1e3f69fa6d24ecf5c346d6f58e3c3d7dad5644 --- /dev/null +++ b/common/base/src/main/ets/pages/Index.ets @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 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 { StandardIcon } from '../views/image/StandardIcon'; + +@Entry +@Component +struct Index { + build() { + Column() { + StandardIcon({ icon: $r("app.media.app_icon") }) + } + } +} \ No newline at end of file diff --git a/common/base/src/main/ets/utils/Breakpoint/BreakpointType.ets b/common/base/src/main/ets/utils/Breakpoint/BreakpointType.ets new file mode 100755 index 0000000000000000000000000000000000000000..8d5078daab2319d48379952e96c72fc89434cc04 --- /dev/null +++ b/common/base/src/main/ets/utils/Breakpoint/BreakpointType.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 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 { BreakpointConstants } from '../../constants/BreakpointConstants'; + +export class BreakpointType { + static currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM + sm: T; + md: T; + lg: T; + + constructor(sm: T, md: T, lg: T) { + this.sm = sm; + this.md = md; + this.lg = lg; + } + + GetValue(currentBreakpoint: string): T { + if (currentBreakpoint === BreakpointConstants.BREAKPOINT_MD) { + return this.md; + } + if (currentBreakpoint === BreakpointConstants.BREAKPOINT_LG) { + return this.lg; + } else { + return this.sm; + } + } +} \ No newline at end of file diff --git a/common/base/src/main/ets/utils/Logger/Logger.ets b/common/base/src/main/ets/utils/Logger/Logger.ets new file mode 100755 index 0000000000000000000000000000000000000000..4ece5a961cf32af57ccffd4ece77429b35419cdb --- /dev/null +++ b/common/base/src/main/ets/utils/Logger/Logger.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2023 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 { hilog } from '@kit.PerformanceAnalysisKit'; + + +class Logger { + private domain: number; + private prefix: string; + private format: string = '%{public}s, %{public}s'; + + /** + * constructor. + * + * @param Prefix Identifies the log tag. + * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. + */ + constructor(prefix: string) { + this.prefix = prefix; + this.domain = 0xFF00; + } + + debug(...args: string[]): void { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: string[]): void { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: string[]): void { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: string[]): void { + hilog.error(this.domain, this.prefix, this.format, args); + } +} + +export default new Logger('MultiDeviceCommunication'); \ No newline at end of file diff --git a/common/base/src/main/ets/viewmodel/AdaptiveViewModel.ets b/common/base/src/main/ets/viewmodel/AdaptiveViewModel.ets new file mode 100755 index 0000000000000000000000000000000000000000..59e0fa3658d69c2aa0258543c54acb0fdd07a3dd --- /dev/null +++ b/common/base/src/main/ets/viewmodel/AdaptiveViewModel.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 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 { BaseConstants as Constants } from '../constants/BaseConstants'; +import { BreakpointType } from '../utils/Breakpoint/BreakpointType'; + +export class Adaptive { + static CircleImageOneWidth = (currentBreakpoint: string): string => { + return new BreakpointType( + Constants.IMAGE_ONE_WIDTH_SM, + Constants.IMAGE_ONE_WIDTH_MD, + Constants.IMAGE_ONE_WIDTH_LG + ).GetValue(currentBreakpoint); + } + static HomeTabHeight = (currentBreakpoint: string): string => { + return new BreakpointType( + Constants.HOME_TAB_HEIGHT_SM, + Constants.HOME_TAB_HEIGHT_MD, + Constants.HOME_TAB_HEIGHT_LG + ).GetValue(currentBreakpoint); + } + static HomeTabWidth = (currentBreakpoint: string): string => { + return new BreakpointType( + Constants.HOME_TAB_WIDTH_SM, + Constants.HOME_TAB_WIDTH_MD, + Constants.HOME_TAB_WIDTH_LG + ).GetValue(currentBreakpoint); + } + static ContactPhoneWidth = (currentBreakpoint: string): string => { + return new BreakpointType( + Constants.CONTACTS_PHONE_WIDTH_SM, + Constants.CONTACTS_PHONE_WIDTH_MD, + Constants.CONTACTS_PHONE_WIDTH_LG + ).GetValue(currentBreakpoint); + } + static ContactDetailHeight = (currentBreakpoint: string): string => { + return new BreakpointType( + Constants.CONTACTS_DETAIL_HEIGHT_SM, + Constants.CONTACTS_DETAIL_HEIGHT_MD, + Constants.CONTACTS_DETAIL_HEIGHT_LG + ).GetValue(currentBreakpoint); + } + static ContactItemHeight = (currentBreakpoint: string): string => { + return new BreakpointType( + Constants.CONTACTS_ITEM_HEIGHT_SM, + Constants.CONTACTS_ITEM_HEIGHT_MD, + Constants.CONTACTS_ITEM_HEIGHT_LG + ).GetValue(currentBreakpoint); + } + static DocumentTitleColumnHeight = (currentBreakpoint: string): string => { + return new BreakpointType( + Constants.DOCUMENT_TITLE_HEIGHT_SM, + Constants.DOCUMENT_TITLE_HEIGHT_MD, + Constants.DOCUMENT_TITLE_HEIGHT_LG + ).GetValue(currentBreakpoint); + } + static DocumentTitleColumnSpace = (currentBreakpoint: string): number => { + return new BreakpointType( + Constants.DOCUMENT_TITLE_SPACE_SM, + Constants.DOCUMENT_TITLE_SPACE_MD, + Constants.DOCUMENT_TITLE_SPACE_LG + ).GetValue(currentBreakpoint); + } +} \ No newline at end of file diff --git a/common/base/src/main/ets/viewmodel/CommonViewModel.ets b/common/base/src/main/ets/viewmodel/CommonViewModel.ets new file mode 100755 index 0000000000000000000000000000000000000000..cd756b85cb980ba18625626b23d33491d5b9b1ea --- /dev/null +++ b/common/base/src/main/ets/viewmodel/CommonViewModel.ets @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 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. + */ + +interface TabInfoModel { + index: number; + img: Resource; + selectImg?: Resource; + title: Resource; +}; + +export { TabInfoModel }; \ No newline at end of file diff --git a/common/base/src/main/ets/views/image/StandardIcon.ets b/common/base/src/main/ets/views/image/StandardIcon.ets new file mode 100755 index 0000000000000000000000000000000000000000..19c87805c3d73e941fc40eba958789e282a35b1d --- /dev/null +++ b/common/base/src/main/ets/views/image/StandardIcon.ets @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 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 StandardIcon { + @Prop icon: Resource; + + build() { + Image(this.icon) + .width($r('app.float.icon_height_one')) + .height($r('app.float.icon_width_one')) + } +} \ No newline at end of file diff --git a/common/base/src/main/ets/views/text/IntroduceText.ets b/common/base/src/main/ets/views/text/IntroduceText.ets new file mode 100755 index 0000000000000000000000000000000000000000..d825024ef3d993b6a8c5ee25559010e5ae036209 --- /dev/null +++ b/common/base/src/main/ets/views/text/IntroduceText.ets @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 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 { BaseConstants } from '../../constants/BaseConstants'; + +@Component +export struct IntroduceText { + @Prop data: string; + @Prop fontSize: Resource = $r('app.float.micro_font_size'); + @Prop fontColor: Resource = $r('app.color.font_color_black_two'); + @Prop fontWeight: number = BaseConstants.FONT_WEIGHT_FOUR; + + build() { + Text(this.data) + .opacity(0.5) + .fontFamily(BaseConstants.FONT_FAMILY_NORMAL) + .fontSize(this.fontSize) + .fontColor(this.fontColor) + .textAlign(TextAlign.Start) + .lineHeight($r('app.float.text_line_height_five')) + .fontWeight(this.fontWeight) + } +} \ No newline at end of file diff --git a/common/base/src/main/ets/views/text/NormalText.ets b/common/base/src/main/ets/views/text/NormalText.ets new file mode 100755 index 0000000000000000000000000000000000000000..872f70b0fe3d63a44640d978668d711add2b5343 --- /dev/null +++ b/common/base/src/main/ets/views/text/NormalText.ets @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 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 { BaseConstants } from '../../constants/BaseConstants'; + +@Component +export struct NormalText { + @Prop data: string; + @Prop fontSize: Resource = BaseConstants.FONT_SIZE_TWELVE; + @Prop fontColor: Resource = $r('app.color.font_color_black_two'); + @Prop fontWeight: number = BaseConstants.FONT_WEIGHT_FOUR; + @Prop fontFamily: Resource = BaseConstants.FONT_FAMILY_NORMAL; + + build() { + Text(this.data) + .fontFamily(this.fontFamily) + .fontSize(this.fontSize) + .fontColor(this.fontColor) + .textAlign(TextAlign.Start) + .lineHeight($r('app.float.text_line_height_five')) + .fontWeight(this.fontWeight) + .copyOption(CopyOptions.LocalDevice) + } +} \ No newline at end of file diff --git a/common/base/src/main/ets/views/text/TabText.ets b/common/base/src/main/ets/views/text/TabText.ets new file mode 100755 index 0000000000000000000000000000000000000000..bfe9b5534c7dc28b1bfd9fcaf91c6d1d56b07df1 --- /dev/null +++ b/common/base/src/main/ets/views/text/TabText.ets @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 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 { BaseConstants } from '../../constants/BaseConstants'; + +@Component +export struct TabText { + @Prop data: string = ''; + @Prop resourceData: Resource; + @Prop fontSize: Resource = BaseConstants.SMALL_MINI_FONT_SIZE; + @Prop fontColor: Resource = $r('app.color.font_color_one'); + @Prop fontWeight: number = BaseConstants.FONT_WEIGHT_FIVE; + @Prop fontFamily: Resource = BaseConstants.FONT_FAMILY_MEDIUM; + + build() { + Text(this.data || this.resourceData) + .fontFamily(this.fontFamily) + .fontSize(this.fontSize) + .fontColor(this.fontColor) + .textAlign(TextAlign.Center) + .lineHeight($r('app.float.text_line_height_five')) + .fontWeight(this.fontWeight) + } +} \ No newline at end of file diff --git a/common/base/src/main/module.json5 b/common/base/src/main/module.json5 new file mode 100755 index 0000000000000000000000000000000000000000..0e0f4fe2515d121094acfdfc5c2aeb2071da539e --- /dev/null +++ b/common/base/src/main/module.json5 @@ -0,0 +1,14 @@ +{ + "module": { + "name": "base", + "type": "shared", + "description": "$string:shared_desc", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "pages": "$profile:main_pages" + } +} \ No newline at end of file diff --git a/common/base/src/main/resources/base/element/color.json b/common/base/src/main/resources/base/element/color.json new file mode 100755 index 0000000000000000000000000000000000000000..0ac304c5c6e3ab5cc7b6735f19af6bbb7836604e --- /dev/null +++ b/common/base/src/main/resources/base/element/color.json @@ -0,0 +1,44 @@ +{ + "color": [ + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "focus_color", + "value": "#0A59F7" + }, + { + "name": "background_color_grey", + "value": "#F6F6F6" + }, + { + "name": "background_color_grey_two", + "value": "#F1F3F5" + }, + { + "name": "background_color_grey_three", + "value": "#8A9097" + }, + { + "name": "background_color_pink", + "value": "#FCF7F6" + }, + { + "name": "background_color_icon", + "value": "#F0A6C3" + }, + { + "name": "font_color_one", + "value": "#000000" + }, + { + "name": "font_color_black_two", + "value": "#182431" + }, + { + "name": "line_color", + "value": "#E7E7E7" + } + ] +} \ No newline at end of file diff --git a/common/base/src/main/resources/base/element/float.json b/common/base/src/main/resources/base/element/float.json new file mode 100755 index 0000000000000000000000000000000000000000..d105bb99825c612912859988f98a717f67e8e160 --- /dev/null +++ b/common/base/src/main/resources/base/element/float.json @@ -0,0 +1,120 @@ +{ + "float": [ + { + "name": "micro_font_size", + "value": "10fp" + }, + { + "name": "smaller_mini_font_size", + "value": "11fp" + }, + { + "name": "icon_height_one", + "value": "24vp" + }, + { + "name": "icon_width_one", + "value": "24vp" + }, + { + "name": "icon_margin_one", + "value": "12vp" + }, + { + "name": "icon_margin_two", + "value": "24vp" + }, + { + "name": "main_image_size", + "value": "22vp" + }, + { + "name": "main_image_size_lg", + "value": "24vp" + }, + { + "name": "avatar_image_size", + "value": "40vp" + }, + { + "name": "bar_width", + "value": "96vp" + }, + { + "name": "text_line_height_one", + "value": "19fp" + }, + { + "name": "text_line_height_three", + "value": "14fp" + }, + { + "name": "text_line_height_two", + "value": "22fp" + }, + { + "name": "text_line_height_five", + "value": "21fp" + }, + { + "name": "background_color_grey", + "value": "#111111" + }, + { + "name": "input_raduis_one", + "value": "20vp" + }, + { + "name": "font_family_normal", + "value": "HarmonyHeiTi" + }, + { + "name": "font_family_medium", + "value": "HarmonyHeiTi-Medium" + }, + { + "name": "font_family_bold", + "value": "HarmonyHeiTi-Bold" + }, + { + "name": "font_family_semi_bold", + "value": "HarmonyHeiTi-SemiBold" + }, + { + "name": "font_size_ten", + "value": "10fp" + }, + { + "name": "font_size_eleven", + "value": "11fp" + }, + { + "name": "font_size_twelve", + "value": "12fp" + }, + { + "name": "font_size_fourteen", + "value": "14fp" + }, + { + "name": "font_size_sixteen", + "value": "16fp" + }, + { + "name": "font_size_eighteen", + "value": "18fp" + }, + { + "name": "font_size_twenty", + "value": "20fp" + }, + { + "name": "font_size_twenty_four", + "value": "24fp" + }, + { + "name": "font_size_thirty_two", + "value": "32fp" + } + ] +} \ No newline at end of file diff --git a/common/base/src/main/resources/base/element/string.json b/common/base/src/main/resources/base/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..23c93dd35068126defd37681f5e152798cdd6914 --- /dev/null +++ b/common/base/src/main/resources/base/element/string.json @@ -0,0 +1,24 @@ +{ + "string": [ + { + "name": "shared_desc", + "value": "description" + }, + { + "name": "test_sm", + "value": "sm" + }, + { + "name": "test_md", + "value": "md" + }, + { + "name": "test_lg", + "value": "lg" + }, + { + "name": "test_aaa", + "value": "11fp" + } + ] +} \ No newline at end of file diff --git a/common/base/src/main/resources/base/media/icon.png b/common/base/src/main/resources/base/media/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/common/base/src/main/resources/base/media/icon.png differ diff --git a/common/base/src/main/resources/base/media/setting.jpeg b/common/base/src/main/resources/base/media/setting.jpeg new file mode 100755 index 0000000000000000000000000000000000000000..57e67dd49d39ad64ef090f59db3db9dfe6632106 Binary files /dev/null and b/common/base/src/main/resources/base/media/setting.jpeg differ diff --git a/common/base/src/main/resources/base/profile/main_pages.json b/common/base/src/main/resources/base/profile/main_pages.json new file mode 100755 index 0000000000000000000000000000000000000000..14bbd62cb9de385b1f5551945d749bb5e0e5fc2c --- /dev/null +++ b/common/base/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/features/home/Index.ets b/features/home/Index.ets new file mode 100755 index 0000000000000000000000000000000000000000..ef00decacd90ec409944182b273e656c705751ec --- /dev/null +++ b/features/home/Index.ets @@ -0,0 +1 @@ +export { Index as Home } from "./src/main/ets/pages/Index"; \ No newline at end of file diff --git a/features/home/build-profile.json5 b/features/home/build-profile.json5 new file mode 100755 index 0000000000000000000000000000000000000000..78a5a3f1f587ddd84cd8f23ea0f6a818d6d25676 --- /dev/null +++ b/features/home/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + "arkOptions": { + // "apPath": "./modules.ap" /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */ + } + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + } + ] +} \ No newline at end of file diff --git a/features/home/hvigorfile.ts b/features/home/hvigorfile.ts new file mode 100755 index 0000000000000000000000000000000000000000..64fa6f97b15f9d477f14026c181352882b94a21b --- /dev/null +++ b/features/home/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hspTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hspTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/features/home/obfuscation-rules.txt b/features/home/obfuscation-rules.txt new file mode 100755 index 0000000000000000000000000000000000000000..3ae3d22892781d9b4f8833eb1b19d819c3032d58 --- /dev/null +++ b/features/home/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/features/home/oh-package.json5 b/features/home/oh-package.json5 new file mode 100755 index 0000000000000000000000000000000000000000..c225b1c88d95ae7e9073be1237af6602999b44b7 --- /dev/null +++ b/features/home/oh-package.json5 @@ -0,0 +1,14 @@ +{ + "license": "Apache-2.0", + "devDependencies": {}, + "author": "", + "name": "home", + "description": "Please describe the basic information.", + "main": "Index.ets", + "version": "1.0.0", + "dynamicDependencies": {}, + "dependencies": { + "@ohos/base": "file:../../common/base", + "@ohos/socialcircle": "file:../socialCircle" + } +} diff --git a/features/home/src/main/ets/constants/HomeConstants.ets b/features/home/src/main/ets/constants/HomeConstants.ets new file mode 100755 index 0000000000000000000000000000000000000000..27c9e3d2dd4e74041b4230f226f7570a3ab7a280 --- /dev/null +++ b/features/home/src/main/ets/constants/HomeConstants.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2023 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 { + /** + * Grid row column list. + */ + static readonly GRID_ROW_COLUMNS: number[] = [1, 2, 3, 4, 5]; + static readonly GRID_COL_COLUMNS: number[] = [0, 1, 2, 3, 4, 5]; + static readonly TAB_MESSAGE_INDEX = 0; + /** + * Index of CONTACTS tab. + */ + static readonly TAB_CONTACTS_INDEX = 1; + /** + * Index of SOCIAL_CIRCLE tab. + */ + static readonly TAB_SOCIAL_CIRCLE_INDEX = 2; + /** + * Index of ME tab. + */ + static readonly TAB_ME_INDEX = 3; + static readonly CONTACTS_DETAIL_AVATAR_Z_INDEX = 2; + /** + * Image message + */ + static readonly USER_PHONE = '15988880000'; + static readonly LAST_POST = '最新动态'; + static readonly IMAGES_SCOPE = 2; + static readonly IMAGE_ASPECT_RATIO = 1; + /** + * Contacts list detail + */ + static readonly CONTACTS_NAME = '通讯录'; + static readonly CONTACTS_LIST = ['群组', '名片夹']; + static readonly CONTACTS_DEFAULT_SELECTED_INDEX = 0; + static readonly CONTACTS_DEFAULT_SELECTED_NAME = '阿兰'; + /** + * Conversation detail + */ + static readonly CONVERSATION_LIST_APPLET = ['芬芬邀请你喝奶茶啦', '请你喝奶茶,快点单吧!!速度速度,就差你了', '哈哈,今天有什么喜事说来听听']; + static readonly CONVERSATION_LIST_DOCUMENT = ['市场部2023年新产品宣传规划', '这是明天会议的资料,请发给Jack,让他确认', '好的,收到']; + static readonly IS_APPLET_CONVERSATION = true; + static readonly IS_DOCUMENT_CONVERSATION = true; + static readonly IS_RECEIVED = true; + static readonly CONVERSATION_DEFAULT_SIZE = 3; + static readonly CONVERSATION_TITLE = '消息'; + /** + * Conversation top search + */ + static readonly SEARCH_TEXT_FLEX_BASIS = 150; + static readonly SEARCH_TEXT_INPUT = '搜索...'; + static readonly ENABLE_KEY_BOARD_ON_FOCUS = false; + static readonly FLEX_BASIS_AUTO = 'auto'; + /** + * Conversation detail + */ + static readonly CONVERSATION_DETAIL_BOTTOM_TEXT_RADIUS = 20; + static readonly CONVERSATION_DETAIL_TOP_TITLE = '芬芬'; + static readonly CONVERSATION_DETAIL_MAX_LINE = 1; + static readonly CONVERSATION_DETAIL_FILL_OPACITY = 1; + static readonly CONVERSATION_DETAIL_STROKE_WIDTH = 1; + static readonly PATH_BORDER_RADIUS = 8; + /** + * Applet detail + */ + static readonly APPLET_TITLE = '奶茶'; + static readonly APPLET_DESCRIBE = '应用'; + /** + * Document detail + */ + static readonly DOCUMENT_SIZE = '24KB'; + static readonly DOCUMENT_INTRODUCE = '文档'; + static readonly DOCUMENT_DIVIDER_WIDTH = 1; + /** + * Default avatar + */ + static readonly DEFAULT_AVATAR = $r('app.media.avatar1') + /** + * Navigation navBarWidth percent + */ + static readonly NAVIGATION_NAV_BAR_WIDTH_MD = '50%' + static readonly NAVIGATION_NAV_BAR_WIDTH_LG = '44.5%' +} \ No newline at end of file diff --git a/features/home/src/main/ets/pages/ContactsDetail.ets b/features/home/src/main/ets/pages/ContactsDetail.ets new file mode 100755 index 0000000000000000000000000000000000000000..abcf3fbc00ef7ba325b5e2921f4eff3a5fccae82 --- /dev/null +++ b/features/home/src/main/ets/pages/ContactsDetail.ets @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2023 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 { Adaptive, BaseConstants, BreakpointConstants, StandardIcon } from '@ohos/base'; +import { HomeConstants } from '../constants/HomeConstants'; +import { SocialCirclePictures } from '../viewmodel/SocialCircleViewModel'; +import { deviceInfo } from '@kit.BasicServicesKit'; + +@Component +export struct ContactsDetail { + @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + @Prop currentContactUserName: string + @Prop currentContactUserIcon: Resource + @Consume('pageInfo') pageInfo: NavPathStack; + + build() { + NavDestination() { + Stack({ alignContent: Alignment.Top }) { + Column() { + Column() { + if (this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM) { + StandardIcon({ icon: $r('app.media.ic_public_back') }) + .onClick(() => { + this.pageInfo.clear(); + + }) + } + } + .padding({ top: $r('app.float.back_icon_top'), left: $r('app.float.back_icon_left') }) + .alignItems(HorizontalAlign.Start) + .width(BaseConstants.FULL_WIDTH) + } + .width(BaseConstants.FULL_WIDTH) + .height(BaseConstants.FULL_HEIGHT) + .backgroundColor($r('app.color.background_color_pink')) + .padding({ + top: deviceInfo.deviceType === BaseConstants.DEVICE_2IN1 ? $r('app.float.zero') : $r('app.float.device_padding_top') + }) + + Image(this.currentContactUserIcon) + .height($r('app.float.contacts_detail_avatar_height')) + .margin({ top: $r('app.float.contacts_detail_avatar_top') }) + .zIndex(HomeConstants.CONTACTS_DETAIL_AVATAR_Z_INDEX) + .border({ + width: $r('app.float.contacts_detail_avatar_border_width'), + color: Color.White, + radius: $r('app.float.contacts_detail_avatar_border_radius') + }) + Column() { + Column() { + Column() { + Text(this.currentContactUserName || HomeConstants.CONTACTS_DEFAULT_SELECTED_NAME) + .fontSize(BaseConstants.FONT_SIZE_THIRTY_TWO) + .fontFamily(BaseConstants.FONT_FAMILY_MEDIUM) + .fontWeight(BaseConstants.FONT_WEIGHT_FIVE) + .fontColor(Color.Black) + } + .width(BaseConstants.FULL_WIDTH) + .alignItems(HorizontalAlign.Center) + .padding({ top: $r('app.float.contacts_detail_user_top') }) + + Row() { + Column() { + Text(HomeConstants.USER_PHONE) + .fontFamily(BaseConstants.FONT_FAMILY_MEDIUM) + .fontSize(BaseConstants.FONT_SIZE_SIXTEEN) + .fontWeight(BaseConstants.FONT_WEIGHT_FIVE) + } + .margin({ left: $r('app.float.phone_left') }) + + Blank() + StandardIcon({ icon: $r('app.media.ic_public_phone') }) + .margin({ right: $r('app.float.phone_icon_right') }) + StandardIcon({ icon: $r('app.media.ic_public_video') }) + .margin({ right: $r('app.float.phone_icon_right') }) + StandardIcon({ icon: $r('app.media.ic_public_comments') }) + .margin({ right: $r('app.float.phone_icon_right') }) + } + .width(BaseConstants.FULL_WIDTH) + .padding({ top: $r('app.float.phone_column_top') }) + + Column() { + Divider() + .color($r('app.color.line_color')) + .width(BaseConstants.FULL_WIDTH) + .margin({ left: $r('app.float.phone_divider_left'), right: $r('app.float.phone_divider_right') }) + } + .width(BaseConstants.FULL_WIDTH) + .padding({ top: $r('app.float.phone_divider_top') }) + + Column() { + Text(HomeConstants.LAST_POST) + .fontSize(BaseConstants.FONT_SIZE_TWELVE) + .fontColor(Color.Black) + .fontWeight(BaseConstants.FONT_WEIGHT_FOUR) + .fontFamily(BaseConstants.FONT_FAMILY_NORMAL) + } + .width(BaseConstants.FULL_WIDTH) + .padding({ left: $r('app.float.last_post_left'), top: $r('app.float.last_post_top') }) + .alignItems(HorizontalAlign.Start) + + Column() { + List({ space: HomeConstants.IMAGES_SCOPE }) { + ForEach(SocialCirclePictures, (item: Resource) => { + ListItem() { + Image(item) + .width(Adaptive.ContactPhoneWidth(this.currentBreakpoint)) + .aspectRatio(HomeConstants.IMAGE_ASPECT_RATIO) + } + }, (item: Resource, index: number) => index + JSON.stringify(item)) + } + .width(BaseConstants.FULL_WIDTH) + .height(BaseConstants.FULL_HEIGHT) + .listDirection(Axis.Horizontal) + } + .padding({ left: $r('app.float.images_left'), top: $r('app.float.images_top') }) + } + .margin(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? {} : { + left: $r('app.float.images_column_left'), + right: $r('app.float.images_column_right') + }) + .height(Adaptive.ContactDetailHeight(this.currentBreakpoint)) + .borderRadius({ + topLeft: $r('app.float.contacts_detail_left'), + topRight: $r('app.float.contacts_detail_right') + }) + .backgroundColor(Color.White) + } + .margin({ top: $r('app.float.contacts_detail_column_top') }) + .width(BaseConstants.FULL_WIDTH) + .alignItems(HorizontalAlign.Start) + } + } + .hideTitleBar(true) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/pages/ContactsList.ets b/features/home/src/main/ets/pages/ContactsList.ets new file mode 100755 index 0000000000000000000000000000000000000000..c9ac2a5e9722f977fee310b46f9d78933ea262d4 --- /dev/null +++ b/features/home/src/main/ets/pages/ContactsList.ets @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2023 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 { Adaptive, BaseConstants, BreakpointConstants } from '@ohos/base'; +import { Alphabets, ContactsListData, ContactsDataInterface } from '../viewmodel/ConstactsViewModel'; +import { ContactsItem } from '../views/Contacts/ContactsItem'; +import { HomeConstants } from '../constants/HomeConstants'; +import { HomeTopSearch } from '../views/common/HomeTopSearch'; + +@Component +export struct ContactsList { + @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + @Link currentContactUserName: string; + @Link currentContactUserIcon: Resource; + @Link currentConversationUserName: string; + @Consume('pageInfo') pageInfo: NavPathStack; + @State selectedIndex: number = HomeConstants.CONTACTS_DEFAULT_SELECTED_INDEX; + @State private currentIndex: number = 0; + private listScroller: Scroller = new Scroller(); + + /** + * Find checked contact + */ + findContactsItemIndex(index: number): number { + if (index < 0) return 0; + const currentIndex = ContactsListData.findIndex(item => item.en_name[0].toUpperCase() === Alphabets[index]); + if (currentIndex === -1) { + return this.findContactsItemIndex(index - 1); + } else { + return currentIndex; + } + } + + build() { + Flex({ direction: FlexDirection.Column }) { + HomeTopSearch({ title: HomeConstants.CONTACTS_NAME }) + .height(Adaptive.ContactItemHeight(this.currentBreakpoint)) + Stack({ alignContent: Alignment.End }) { + List({ scroller: this.listScroller }) { + ListItem() { + ContactsItem({ name: HomeConstants.CONTACTS_LIST[0], icon: $r('app.media.ic_public_groups') }) + } + .height(Adaptive.ContactItemHeight(this.currentBreakpoint)) + .backgroundColor(Color.White) + + ListItem() { + ContactsItem({ name: HomeConstants.CONTACTS_LIST[1], icon: $r('app.media.ic_public_names') }) + } + .height(Adaptive.ContactItemHeight(this.currentBreakpoint)) + .backgroundColor(Color.White) + + ForEach(ContactsListData, (item: ContactsDataInterface, index: number) => { + ListItem() { + ContactsItem({ name: item.name, icon: item.icon }) + .onClick(() => { + if (this.pageInfo.size() > 1) { + this.pageInfo.pop(); + } + this.pageInfo.pushPath({ name: 'ContactsDetail' }); + this.currentContactUserName = item.name; + this.currentContactUserIcon = item.icon; + this.currentConversationUserName = ''; + this.currentIndex = index; + }) + .height(BaseConstants.FULL_HEIGHT) + .padding($r('app.float.contacts_item_padding')) + .backgroundColor(this.currentIndex === index ? $r('app.color.conversation_clicked_bg_color') : Color.White) + } + .height(Adaptive.ContactItemHeight(this.currentBreakpoint)) + }, (item: ContactsDataInterface, index: number) => index + JSON.stringify(item)) + } + .width(BaseConstants.FULL_WIDTH) + .height(BaseConstants.FULL_HEIGHT) + .onScrollIndex((firstIndex: number) => { + this.selectedIndex = firstIndex; + }) + + AlphabetIndexer({ arrayValue: Alphabets, selected: 0 }) + .onSelect((index: number) => { + const currentIndex = this.findContactsItemIndex(index); + this.listScroller.scrollToIndex(currentIndex + 2); + }) + .margin({ right: $r('app.float.alphabet_indexer_right') }) + .color(Color.Black) + .font({ + size: BaseConstants.FONT_SIZE_TWELVE, + weight: BaseConstants.FONT_WEIGHT_FIVE, + family: BaseConstants.FONT_FAMILY_MEDIUM + }) + } + } + .height(BaseConstants.FULL_HEIGHT) + .width(BaseConstants.FULL_WIDTH) + } +} diff --git a/features/home/src/main/ets/pages/ConversationDetail.ets b/features/home/src/main/ets/pages/ConversationDetail.ets new file mode 100755 index 0000000000000000000000000000000000000000..34f8a304ebd58a2ab35c2115eee019e3e6f8ede3 --- /dev/null +++ b/features/home/src/main/ets/pages/ConversationDetail.ets @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2023 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 { Adaptive, BaseConstants, BreakpointConstants } from '@ohos/base'; +import { ConversationDetailBottom } from '../views/Conversation/ConversationDetailBottom'; +import ConversationDetailItem from '../views/Conversation/ConversationDetailItem'; +import { ConversationDetailTopSearch } from '../views/Conversation/ConversationDetailTopSearch'; +import { HomeConstants } from '../constants/HomeConstants'; +import { deviceInfo } from '@kit.BasicServicesKit'; + +@Component +export struct ConversationDetail { + @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + @Prop currentConversationUserName: string; + @Prop currentFeatureIndex: number; + @Consume('pageInfo') pageInfo: NavPathStack; + + build() { + NavDestination() { + Flex({ direction: FlexDirection.Column }) { + ConversationDetailTopSearch({ currentConversationUserName: $currentConversationUserName, }) + .height(Adaptive.ContactItemHeight(this.currentBreakpoint)) + if (this.currentConversationUserName.length === HomeConstants.CONVERSATION_DEFAULT_SIZE) { + ConversationDetailItem({ + receivedName: $currentConversationUserName, + isReceived: HomeConstants.IS_RECEIVED, + content: HomeConstants.CONVERSATION_LIST_APPLET[0], + isAppletMsg: HomeConstants.IS_APPLET_CONVERSATION, + currentFeatureIndex: $currentFeatureIndex + }) + ConversationDetailItem({ + receivedName: $currentConversationUserName, + isReceived: HomeConstants.IS_RECEIVED, + content: HomeConstants.CONVERSATION_LIST_APPLET[1], + currentFeatureIndex: $currentFeatureIndex + }) + ConversationDetailItem({ + receivedName: $currentConversationUserName, + isReceived: !HomeConstants.IS_RECEIVED, + content: HomeConstants.CONVERSATION_LIST_APPLET[2], + currentFeatureIndex: $currentFeatureIndex + }) + } else { + ConversationDetailItem({ + receivedName: $currentConversationUserName, + isReceived: HomeConstants.IS_RECEIVED, + content: HomeConstants.CONVERSATION_LIST_DOCUMENT[0], + isDocumentMsg: HomeConstants.IS_DOCUMENT_CONVERSATION, + currentFeatureIndex: $currentFeatureIndex + }) + ConversationDetailItem({ + receivedName: $currentConversationUserName, + isReceived: HomeConstants.IS_RECEIVED, + content: HomeConstants.CONVERSATION_LIST_DOCUMENT[1], + currentFeatureIndex: $currentFeatureIndex + }) + ConversationDetailItem({ + receivedName: $currentConversationUserName, + isReceived: !HomeConstants.IS_RECEIVED, + content: HomeConstants.CONVERSATION_LIST_DOCUMENT[2], + currentFeatureIndex: $currentFeatureIndex + }) + } + Blank() + ConversationDetailBottom() + } + .height(BaseConstants.FULL_HEIGHT) + .width(BaseConstants.FULL_WIDTH) + .backgroundColor($r('app.color.background_color_grey')) + .padding({ + bottom: deviceInfo.deviceType !== BaseConstants.DEVICE_2IN1 ? + $r('app.float.tab_content_pb') : $r('app.float.zero') + }) + } + .hideTitleBar(true) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/pages/ConversationList.ets b/features/home/src/main/ets/pages/ConversationList.ets new file mode 100755 index 0000000000000000000000000000000000000000..8f83c2b76b954c93770c5f5bc2506405b8bb0469 --- /dev/null +++ b/features/home/src/main/ets/pages/ConversationList.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 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 { Adaptive, BaseConstants, BreakpointConstants } from '@ohos/base'; +import { ConversationDataInterface, ConversationListData } from '../viewmodel/ConversationViewModel'; +import { ConversationItem } from '../views/Conversation/ConversationItem'; +import { HomeTopSearch } from '../views/common/HomeTopSearch'; +import { HomeConstants } from '../constants/HomeConstants'; +import { deviceInfo } from '@kit.BasicServicesKit'; + +@Component +export struct ConversationList { + @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + @Link currentConversationUserName: string; + @Link currentContactUserName: string; + @State private currentIndex: number = 0 + @Consume('pageInfo') pageInfo: NavPathStack; + + build() { + Flex({ direction: FlexDirection.Column }) { + HomeTopSearch({ title: HomeConstants.CONVERSATION_TITLE }) + .height(Adaptive.ContactItemHeight(this.currentBreakpoint)) + List() { + ForEach(ConversationListData, (item: ConversationDataInterface, index: number) => { + ListItem() { + ConversationItem(item) + .onClick(() => { + if (this.pageInfo.size() > 1) { + this.pageInfo.pop(); + } + this.pageInfo.pushPath({ name: 'ConversationDetail' }); + this.currentConversationUserName = item.name; + this.currentContactUserName = ''; + this.currentIndex = index; + }) + .backgroundColor(this.currentIndex === index ? $r('app.color.conversation_clicked_bg_color') : Color.White) + } + .height(Adaptive.ContactItemHeight(this.currentBreakpoint)) + + }, (item: ConversationDataInterface, index: number) => index + JSON.stringify(item)) + } + .padding({ + bottom: deviceInfo.deviceType !== BaseConstants.DEVICE_2IN1 && + this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + $r('app.float.tab_content_pb') : $r('app.float.zero') + }) + .backgroundColor(Color.White) + .width(BaseConstants.FULL_WIDTH) + .height(BaseConstants.FULL_HEIGHT) + } + + .height(BaseConstants.FULL_HEIGHT) + .width(BaseConstants.FULL_WIDTH) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/pages/Index.ets b/features/home/src/main/ets/pages/Index.ets new file mode 100755 index 0000000000000000000000000000000000000000..a4f88e7305baa580406cc02fd3350fd90f1ca3c2 --- /dev/null +++ b/features/home/src/main/ets/pages/Index.ets @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2023 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 { Adaptive, BaseConstants, BreakpointConstants, CurrentFeature, CurrentPage } from '@ohos/base'; +import ConversationDetailNone from '../views/Conversation/ConversationDetailNone'; +import { ContactsDetail } from './ContactsDetail'; +import { ContactsList } from './ContactsList'; +import { ConversationDetail } from './ConversationDetail'; +import { ConversationList } from './ConversationList'; +import { HomeConstants } from '../constants/HomeConstants'; +import { HomeTab } from '../views/HomeTab'; +import { SocialCircle } from '@ohos/SocialCircle'; +import { deviceInfo } from '@kit.BasicServicesKit'; + +@Entry +@Component +export struct Index { + @StorageProp('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + @Provide('pageInfo') pageInfo: NavPathStack = new NavPathStack(); + @State currentConversationUserName: string = ''; + @State currentContactUserName: string = ''; + @State currentContactUserIcon: Resource = HomeConstants.DEFAULT_AVATAR; + @State currentPageIndex: number = CurrentPage.HOME; + @State currentFeatureIndex: Number = CurrentFeature.HOME; + @State isSplitAppletScreen: boolean = BaseConstants.SPLIT_APPLET_SCREEN; + @State isSplitDocumentScreen: boolean = BaseConstants.SPLIT_DOCUMENT_SCREEN; + + watchCurrentBreakpoint() { + if (this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM && + this.pageInfo.getParamByName('ConversationDetailNone').length === 1 && this.pageInfo.size() === 1) { + this.pageInfo.pop(); + } + } + + @Builder + PageMap(name: string) { + if (name === 'ConversationDetail') { + ConversationDetail({ currentConversationUserName: this.currentConversationUserName, currentFeatureIndex: 1 }); + } else if (name === 'ConversationDetailNone') { + ConversationDetailNone(); + } else if (name === 'ContactsDetail') { + ContactsDetail({ + currentContactUserName: this.currentContactUserName, + currentContactUserIcon: this.currentContactUserIcon + }); + } else { + ConversationDetailNone(); + } + } + + build() { + Column() { + /** + * Home and contacts page + */ + Flex() { + HomeTab({ currentPageIndex: $currentPageIndex }) + .width(Adaptive.HomeTabWidth(this.currentBreakpoint)) + .backgroundColor($r('app.color.background_color_grey_two')) + .padding({ + top: $r('app.float.home_tab_padding_top'), + bottom: $r('app.float.home_tab_padding_bottom'), + left: $r('app.float.home_tab_padding_left') + }) + .visibility(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? Visibility.Visible : Visibility.None) + Navigation(this.pageInfo) { + if (this.currentPageIndex === 0) { + Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center }) { + ConversationList({ + currentConversationUserName: $currentConversationUserName, + currentContactUserName: $currentContactUserName + }) + .flexGrow(BaseConstants.FLEX_GROW_ONE) + .width(BaseConstants.FULL_WIDTH) + HomeTab({ currentPageIndex: $currentPageIndex }) + .width(Adaptive.HomeTabWidth(this.currentBreakpoint)) + .height(Adaptive.HomeTabHeight(this.currentBreakpoint)) + .visibility(this.currentBreakpoint !== BreakpointConstants.BREAKPOINT_LG ? Visibility.Visible : Visibility.None) + } + .padding({ + bottom: deviceInfo.deviceType !== BaseConstants.DEVICE_2IN1 + && this.currentBreakpoint !== BreakpointConstants.BREAKPOINT_LG ? + $r('app.float.tab_content_pb') : $r('app.float.zero') + }) + .height(BaseConstants.FULL_HEIGHT) + + } else if (this.currentPageIndex === 1) { + Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center }) { + ContactsList({ + currentContactUserName: $currentContactUserName, + currentConversationUserName: $currentConversationUserName, + currentContactUserIcon: $currentContactUserIcon + }) + .flexGrow(BaseConstants.FLEX_GROW_ONE) + .width(BaseConstants.FULL_WIDTH) + HomeTab({ currentPageIndex: $currentPageIndex }) + .width(Adaptive.HomeTabWidth(this.currentBreakpoint)) + .height(Adaptive.HomeTabHeight(this.currentBreakpoint)) + .visibility(this.currentBreakpoint !== BreakpointConstants.BREAKPOINT_LG ? Visibility.Visible : Visibility.None) + } + .height(BaseConstants.FULL_HEIGHT) + .padding({ + bottom: deviceInfo.deviceType !== BaseConstants.DEVICE_2IN1 + && this.currentBreakpoint !== BreakpointConstants.BREAKPOINT_LG ? + $r('app.float.tab_content_pb') : $r('app.float.zero') + }) + } + } + .hideTitleBar(true) + .hideToolBar(true) + .navBarWidth(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? HomeConstants.NAVIGATION_NAV_BAR_WIDTH_LG : + HomeConstants.NAVIGATION_NAV_BAR_WIDTH_MD) + .navDestination(this.PageMap) + .mode(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? NavigationMode.Stack : NavigationMode.Split) + .width(BaseConstants.FULL_WIDTH) + } + .visibility(this.currentPageIndex === CurrentPage.HOME || this.currentPageIndex === CurrentPage.CONVERSATION ? + Visibility.Visible : Visibility.None) + + /** + * SocialCircle page + */ + Flex({ direction: FlexDirection.Column }) { + SocialCircle() + .flexGrow(BaseConstants.FLEX_GROW_ONE) + HomeTab({ currentPageIndex: $currentPageIndex }) + .width(Adaptive.HomeTabWidth(this.currentBreakpoint)) + .height(Adaptive.HomeTabHeight(this.currentBreakpoint)) + } + .width(BaseConstants.FULL_WIDTH) + .height(BaseConstants.FULL_HEIGHT) + .visibility(this.currentPageIndex === CurrentPage.SOCIAL_CIRCLE && this.currentBreakpoint !== + BreakpointConstants.BREAKPOINT_LG ? Visibility.Visible : Visibility.None) + .padding({ + bottom: $r('app.float.tab_content_pb') + }) + + + Row() { + HomeTab({ currentPageIndex: $currentPageIndex }) + .width(Adaptive.HomeTabWidth(this.currentBreakpoint)) + .backgroundColor($r('app.color.background_color_grey_two')) + .padding({ + top: $r('app.float.home_tab_padding_top'), + bottom: $r('app.float.home_tab_padding_bottom'), + left: $r('app.float.home_tab_padding_left') + }) + SocialCircle() + .width(BaseConstants.NINETY_WIDTH_PERCENT) + } + .width(BaseConstants.FULL_WIDTH) + .visibility(this.currentPageIndex === CurrentPage.SOCIAL_CIRCLE && this.currentBreakpoint === + BreakpointConstants.BREAKPOINT_LG ? Visibility.Visible : Visibility.None) + + /** + * Me page + */ + Flex({ direction: FlexDirection.Column }) { + Column() + .flexGrow(BaseConstants.FLEX_GROW_ONE) + HomeTab({ currentPageIndex: $currentPageIndex }) + .width(Adaptive.HomeTabWidth(this.currentBreakpoint)) + .height(Adaptive.HomeTabHeight(this.currentBreakpoint)) + } + .width(BaseConstants.FULL_WIDTH) + .height(BaseConstants.FULL_HEIGHT) + .visibility(this.currentPageIndex === CurrentPage.ME && this.currentBreakpoint !== + BreakpointConstants.BREAKPOINT_LG ? Visibility.Visible : Visibility.None) + .padding({ + top: deviceInfo.deviceType === BaseConstants.DEVICE_2IN1 ? $r('app.float.zero') : $r('app.float.device_padding_top'), + bottom: deviceInfo.deviceType !== BaseConstants.DEVICE_2IN1 + && this.currentBreakpoint !== BreakpointConstants.BREAKPOINT_LG ? + $r('app.float.tab_content_pb') : $r('app.float.zero') + }) + + + Row() { + HomeTab({ currentPageIndex: $currentPageIndex }) + .width(Adaptive.HomeTabWidth(this.currentBreakpoint)) + .backgroundColor($r('app.color.background_color_grey_two')) + .padding({ + top: $r('app.float.home_tab_padding_top'), + bottom: $r('app.float.home_tab_padding_bottom'), + left: $r('app.float.home_tab_padding_left') + }) + Column() + .width(BaseConstants.NINETY_WIDTH_PERCENT) + .height(BaseConstants.FULL_HEIGHT) + } + .width(BaseConstants.FULL_WIDTH) + .visibility(this.currentPageIndex === CurrentPage.ME && this.currentBreakpoint === + BreakpointConstants.BREAKPOINT_LG ? Visibility.Visible : Visibility.None) + } + .height(BaseConstants.FULL_HEIGHT) + .width(BaseConstants.FULL_WIDTH) + .backgroundColor($r('app.color.background_color_grey_two')) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/viewmodel/BottomTabViewModel.ets b/features/home/src/main/ets/viewmodel/BottomTabViewModel.ets new file mode 100755 index 0000000000000000000000000000000000000000..f415b66eedaa86352a563ef7b47a65f79852b19c --- /dev/null +++ b/features/home/src/main/ets/viewmodel/BottomTabViewModel.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 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 { TabInfoModel } from '@ohos/base'; + +const ButtonInfo: TabInfoModel[] = [ + { + index: 0, + img: $r('app.media.icon_message'), + selectImg: $r('app.media.icon_message_selected'), + title: $r('app.string.Message') + }, + { + index: 1, + img: $r('app.media.icon_contacts'), + selectImg: $r('app.media.icon_contacts_selected'), + title: $r('app.string.Contacts') + }, + { + index: 2, + img: $r("app.media.icon_social_circle"), + selectImg: $r("app.media.icon_social_circle_selected"), + title: $r('app.string.SocialCircle') + }, + { + index: 3, + img: $r('app.media.icon_me'), + selectImg: $r('app.media.icon_me'), + title: $r('app.string.Me') + } +]; + +export { ButtonInfo }; \ No newline at end of file diff --git a/features/home/src/main/ets/viewmodel/ConstactsViewModel.ets b/features/home/src/main/ets/viewmodel/ConstactsViewModel.ets new file mode 100755 index 0000000000000000000000000000000000000000..10297bd4142a4aa51a08ea8f8431f37de360ec0f --- /dev/null +++ b/features/home/src/main/ets/viewmodel/ConstactsViewModel.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 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. + */ + +interface ContactsDataInterface { + name: string; + en_name: string; + icon: Resource; +} + +const ContactsListData: ContactsDataInterface[] = [ + { name: '阿兰', en_name: '#Alan', icon: $r('app.media.avatar1') }, + { name: '阿琴', en_name: 'AQin', icon: $r('app.media.avatar1') }, + { name: '菜篮', en_name: 'CaiLan', icon: $r('app.media.avatar2') }, + { name: '邓双双', en_name: 'Deng', icon: $r('app.media.avatar3') }, + { name: 'excel教程', en_name: 'excel', icon: $r('app.media.avatar2') }, + { name: '翻译', en_name: 'FanYi', icon: $r('app.media.avatar2') }, + { name: '芬芬', en_name: 'FenFen', icon: $r('app.media.avatar2') }, + { name: '哥白尼', en_name: 'ge', icon: $r('app.media.avatar4') }, + { name: 'Idea', en_name: 'Idea', icon: $r('app.media.avatar4') }, + { name: 'Jack', en_name: 'jack', icon: $r('app.media.avatar1') }, + { name: 'Kat', en_name: 'kat', icon: $r('app.media.avatar1') }, + { name: 'Lily', en_name: 'lily', icon: $r('app.media.avatar11') }, + { name: '李小二', en_name: 'LiX', icon: $r('app.media.avatar8') }, + { name: '马老师', en_name: 'Ma', icon: $r('app.media.avatar11') }, + { name: '聂聂', en_name: 'nie', icon: $r('app.media.avatar5') }, + { name: 'Tom', en_name: 'tom', icon: $r('app.media.avatar10') }, + { name: '张小萌', en_name: 'Zhang', icon: $r('app.media.avatar6') }, + { name: '王小菊', en_name: 'Wang', icon: $r('app.media.avatar7') }, + { name: '足球协会', en_name: 'Zo', icon: $r('app.media.avatar9') }, +]; + +const Alphabets: string[] = ['#', '☆', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', + 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; + +export { ContactsDataInterface, ContactsListData, Alphabets }; \ No newline at end of file diff --git a/features/home/src/main/ets/viewmodel/ConversationViewModel.ets b/features/home/src/main/ets/viewmodel/ConversationViewModel.ets new file mode 100755 index 0000000000000000000000000000000000000000..e893c2297f376310f61e29b196f10dc3fbd8eb85 --- /dev/null +++ b/features/home/src/main/ets/viewmodel/ConversationViewModel.ets @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2023 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 { Want, common } from '@kit.AbilityKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { Logger } from '@ohos/base'; + +interface ConversationDataInterface { + name: string + msg: string + time: string + icon: Resource +}; + +const ConversationListData: ConversationDataInterface[] = [ + { name: '张小萌', msg: '好的,我明天过去', time: '13:55', icon: $r('app.media.avatar1') }, + { name: '刘信玄', msg: '你撤回了一条信息', time: '13:55', icon: $r('app.media.avatar2') }, + { name: '邓霜霜', msg: '请你喝奶茶,快点单吧,速度马上要被抢没了', time: '12:00', icon: $r('app.media.avatar11') }, + { name: '芬芬', msg: 'Ok', time: '08:00', icon: $r('app.media.avatar4') }, + { name: 'Jack', msg: '好的,我明天过去', time: '昨天', icon: $r('app.media.avatar5') }, + { name: '自由的彤彤', msg: '好的,我明天过去', time: '昨天', icon: $r('app.media.avatar6') }, + { name: 'Tom', msg: '好的,我明天过去', time: '昨天', icon: $r('app.media.avatar7') }, + { name: '足球协会', msg: '好的,我明天过去', time: '昨天', icon: $r('app.media.avatar8') }, + { name: 'Lily', msg: '好的,我明天过去', time: '昨天', icon: $r('app.media.avatar9') }, + { name: 'Jack2', msg: '好的,我明天过去', time: '昨天', icon: $r('app.media.avatar10') }, + { name: '张晓彤', msg: '好的,我明天过去', time: '昨天', icon: $r('app.media.avatar11') }, + { name: '运动俱乐部', msg: '好的,我明天过去', time: '昨天', icon: $r('app.media.avatar1') }, +]; + +class ConversationViewModel { + public startAppletAbility(context: common.UIAbilityContext, index: number): void { + const want: Want = { + bundleName: getContext(context).applicationInfo.name, + abilityName: 'AppletAbility', + parameters: { + position: index + } + }; + try { + context.startAbility(want, (err: BusinessError) => { + if (err.code) { + Logger.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); + } + }); + } catch (error) { + hilog.error(0x00004, 'ConversationViewModel', '%{public}s', error); + } + } + + public startDocumentAbility(context: common.UIAbilityContext, index: number): void { + const want: Want = { + bundleName: getContext(context).applicationInfo.name, + abilityName: 'DocumentAbility', + parameters: { + position: index + } + }; + try { + context.startAbility(want, (err: BusinessError) => { + if (err.code) { + Logger.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); + } + }); + } catch (error) { + Logger.error(`startAbility failed, message is ${error}`); + } + } +} + +export { ConversationDataInterface, ConversationListData, ConversationViewModel }; \ No newline at end of file diff --git a/features/home/src/main/ets/viewmodel/SocialCircleViewModel.ets b/features/home/src/main/ets/viewmodel/SocialCircleViewModel.ets new file mode 100755 index 0000000000000000000000000000000000000000..3e4a0e87bcf33c7c01a9c71b01deebe8db9b5fc2 --- /dev/null +++ b/features/home/src/main/ets/viewmodel/SocialCircleViewModel.ets @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 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. + */ + +const SocialCirclePictures: Resource[] = [ + $r('app.media.social_circle1'), + $r('app.media.social_circle2'), + $r('app.media.social_circle3'), + $r('app.media.social_circle4'), + $r('app.media.social_circle5'), + $r('app.media.social_circle6'), + $r('app.media.social_circle7'), + $r('app.media.social_circle8'), + $r('app.media.social_circle9'), +]; + +export { SocialCirclePictures }; \ No newline at end of file diff --git a/features/home/src/main/ets/views/Contacts/ContactsItem.ets b/features/home/src/main/ets/views/Contacts/ContactsItem.ets new file mode 100755 index 0000000000000000000000000000000000000000..cf52cf27e27f3c01001180fcbbbc075ca330ef60 --- /dev/null +++ b/features/home/src/main/ets/views/Contacts/ContactsItem.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 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 { BaseConstants, BreakpointConstants } from '@ohos/base'; + +@Component +export struct ContactsItem { + @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + private name?: string; + private icon?: Resource; + + build() { + Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Image(this.icon) + .height($r('app.float.avatar_image_size')) + .width($r('app.float.avatar_image_size')) + } + .width($r('app.float.avatar_image_size')) + .margin({ left: $r('app.float.icon_margin_two'), right: $r('app.float.icon_margin_one') }) + + Column() { + Text(this.name) + .fontSize(BaseConstants.FONT_SIZE_SIXTEEN) + .fontWeight(BaseConstants.FONT_WEIGHT_FIVE) + .lineHeight($r('app.float.text_line_height_two')) + .fontFamily(BaseConstants.FONT_FAMILY_MEDIUM) + } + .flexShrink(BaseConstants.FLEX_SHRINK_ONE) + .margin({ left: $r('app.float.icon_margin_one') }) + + Blank() + } + .height(BaseConstants.FULL_HEIGHT) + .width(BaseConstants.FULL_WIDTH) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/views/Conversation/ConversationDetailBottom.ets b/features/home/src/main/ets/views/Conversation/ConversationDetailBottom.ets new file mode 100755 index 0000000000000000000000000000000000000000..0ba5dc1173d3afedd9199ae51df37ae2468ddb53 --- /dev/null +++ b/features/home/src/main/ets/views/Conversation/ConversationDetailBottom.ets @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023 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 { BaseConstants } from '@ohos/base/src/main/ets/constants/BaseConstants'; +import { StandardIcon } from '@ohos/base/src/main/ets/views/image/StandardIcon'; +import { HomeConstants } from '../../constants/HomeConstants'; + +@Component +export struct ConversationDetailBottom { + @Builder CustomKeyboardBuilder(){} + build() { + Flex({ alignItems: ItemAlign.Center }) { + Column() { + StandardIcon({ icon: $r('app.media.ic_public_emoji') }) + } + .flexBasis(HomeConstants.FLEX_BASIS_AUTO) + .padding({ + right: $r('app.float.conversation_detail_bottom_padding'), + left: $r('app.float.conversation_detail_bottom_padding'), + }) + + Blank() + Column() { + TextArea() + .placeholderColor($r('app.color.text_input_default_color')) + .caretColor($r('app.color.text_input_default_care_color')) + .backgroundColor($r('app.color.text_input_default_background_color')) + .borderRadius(HomeConstants.CONVERSATION_DETAIL_BOTTOM_TEXT_RADIUS) + .flexGrow(BaseConstants.FLEX_GROW_ONE) + .padding({ right: $r('app.float.conversation_detail_bottom_text_padding') }) + .backgroundColor(Color.White) + .enableKeyboardOnFocus(false) + .customKeyboard(this.CustomKeyboardBuilder()) + } + + Column() { + StandardIcon({ icon: $r('app.media.ic_public_add_norm') }) + } + .padding({ + right: $r('app.float.conversation_detail_bottom_padding'), + left: $r('app.float.conversation_detail_bottom_padding'), + }) + } + .width(BaseConstants.FULL_WIDTH) + .height($r('app.float.conversation_detail_bottom_height')) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/views/Conversation/ConversationDetailItem.ets b/features/home/src/main/ets/views/Conversation/ConversationDetailItem.ets new file mode 100755 index 0000000000000000000000000000000000000000..b6ed3705e6cefa01b276aa29ce4d4403bec44f11 --- /dev/null +++ b/features/home/src/main/ets/views/Conversation/ConversationDetailItem.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 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 { MessageBubble } from '../MessageBubble'; + +@Component +export default struct ConversationDetailItem { + @Link currentFeatureIndex: number; + @Link receivedName: string; + private isReceived: boolean = !HomeConstants.IS_RECEIVED; + private content: string = ''; + private isAppletMsg?: boolean; + private isDocumentMsg?: boolean; + + build() { + Flex({ justifyContent: FlexAlign.End, alignItems: ItemAlign.End }) { + MessageBubble({ + receivedName: $receivedName, + currentFeatureIndex: $currentFeatureIndex, + isReceived: this.isReceived, + content: this.content, + isAppletMsg: this.isAppletMsg, + isDocumentMsg: this.isDocumentMsg + }) + } + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/views/Conversation/ConversationDetailNone.ets b/features/home/src/main/ets/views/Conversation/ConversationDetailNone.ets new file mode 100755 index 0000000000000000000000000000000000000000..975034bb043ee8e323d7259bc13472162468b3d5 --- /dev/null +++ b/features/home/src/main/ets/views/Conversation/ConversationDetailNone.ets @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 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 { BaseConstants } from '@ohos/base/src/main/ets/constants/BaseConstants'; +import { deviceInfo } from '@kit.BasicServicesKit'; + +@Component +export default struct ConversationDetailNone { + build() { + NavDestination() { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Image($r('app.media.ic_none_message')) + .width($r('app.float.conversation_none_icon_width')) + .height($r('app.float.conversation_none_icon_height')) + } + .backgroundColor($r('app.color.conversation_none_icon_bg_color')) + .height(BaseConstants.FULL_HEIGHT) + } + .padding({ + top: deviceInfo.deviceType === BaseConstants.DEVICE_2IN1 ? $r('app.float.zero') : $r('app.float.device_padding_top') + }) + .hideTitleBar(true) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/views/Conversation/ConversationDetailTopSearch.ets b/features/home/src/main/ets/views/Conversation/ConversationDetailTopSearch.ets new file mode 100755 index 0000000000000000000000000000000000000000..ad3d72a2fb74080cfd71691577b5a973a102e729 --- /dev/null +++ b/features/home/src/main/ets/views/Conversation/ConversationDetailTopSearch.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 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 { BaseConstants, BreakpointConstants, StandardIcon } from '@ohos/base'; +import { HomeConstants } from '../../constants/HomeConstants'; +import { deviceInfo } from '@kit.BasicServicesKit'; + +@Component +export struct ConversationDetailTopSearch { + @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + @Link currentConversationUserName: string; + @Consume('pageInfo') pageInfo: NavPathStack; + + build() { + Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + StandardIcon({ icon: $r('app.media.ic_public_back') }) + .onClick(() => { + if (this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM) { + this.pageInfo.clear(); + } else if (this.pageInfo.size() === 1) { + this.pageInfo.clear(); + this.pageInfo.pushPath({ name: 'ConversationDetailNone' }); + } else { + this.pageInfo.clear(); + this.pageInfo.pushPath({ name: 'ConversationDetailNone' }); + } + }) + Text(this.currentConversationUserName || HomeConstants.CONVERSATION_DETAIL_TOP_TITLE) + .fontWeight(BaseConstants.FONT_WEIGHT_FIVE) + .fontSize(BaseConstants.FONT_SIZE_EIGHTEEN) + .fontFamily(BaseConstants.FONT_FAMILY_MEDIUM) + .fontColor($r('app.color.conversation_default_text_color')) + StandardIcon({ icon: $r('app.media.ic_public_more') }) + } + .width(BaseConstants.FULL_WIDTH) + .height(BaseConstants.FULL_HEIGHT) + .padding({ left: $r('app.float.icon_margin_two'), right: $r('app.float.icon_margin_two'),top: deviceInfo.deviceType === BaseConstants.DEVICE_2IN1 ? $r('app.float.zero') : $r('app.float.device_padding_top') }) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/views/Conversation/ConversationItem.ets b/features/home/src/main/ets/views/Conversation/ConversationItem.ets new file mode 100755 index 0000000000000000000000000000000000000000..08c818396ac23e5f24a4bb9490ccad12089b8b54 --- /dev/null +++ b/features/home/src/main/ets/views/Conversation/ConversationItem.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 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 { BaseConstants, BreakpointConstants } from '@ohos/base'; +import { HomeConstants } from '../../constants/HomeConstants'; + +@Component +export struct ConversationItem { + @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + private name?: string; + private msg?: string; + private time?: string; + private icon?: Resource; + + build() { + Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Image(this.icon) + .height($r('app.float.avatar_image_size')) + .width($r('app.float.avatar_image_size')) + } + .width($r('app.float.avatar_image_size')) + .margin({ left: $r('app.float.icon_margin_two'), right: $r('app.float.icon_margin_one') }) + + Flex({ direction: FlexDirection.Column,justifyContent:FlexAlign.Center }) { + Text(this.name) + .fontSize(BaseConstants.FONT_SIZE_SIXTEEN) + .fontWeight(BaseConstants.FONT_WEIGHT_FIVE) + .lineHeight($r('app.float.text_line_height_two')) + .fontFamily(BaseConstants.FONT_FAMILY_MEDIUM) + Text(this.msg) + .maxLines(HomeConstants.CONVERSATION_DETAIL_MAX_LINE) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .fontSize(BaseConstants.FONT_SIZE_FOURTEEN) + .fontWeight(BaseConstants.FONT_WEIGHT_FOUR) + .lineHeight($r('app.float.text_line_height_one')) + .fontFamily(BaseConstants.FONT_FAMILY_NORMAL) + .fontColor(Color.Grey) + .width(BaseConstants.FULL_WIDTH) + } + .flexShrink(BaseConstants.FLEX_SHRINK_ONE) + .margin({ left: $r('app.float.icon_margin_one') }) + + Blank() + Column() { + Text(this.time) + .fontWeight(BaseConstants.FONT_WEIGHT_FOUR) + .fontSize(BaseConstants.FONT_SIZE_TEN) + .fontColor(Color.Grey) + .fontFamily(BaseConstants.FONT_FAMILY_NORMAL) + .width($r('app.float.conversation_list_time_width')) + } + .flexBasis(HomeConstants.FLEX_BASIS_AUTO) + .margin({ left: $r('app.float.icon_margin_two'), right: $r('app.float.icon_margin_one') }) + } + .width(BaseConstants.FULL_WIDTH) + .padding($r('app.float.conversation_list_time_padding')) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/views/HomeTab.ets b/features/home/src/main/ets/views/HomeTab.ets new file mode 100755 index 0000000000000000000000000000000000000000..2a94b776dc3e0baad1368ac08b56cc9582b22b2c --- /dev/null +++ b/features/home/src/main/ets/views/HomeTab.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 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 { BaseConstants, BreakpointConstants } from '@ohos/base'; +import { ButtonInfo } from '../viewmodel/BottomTabViewModel'; +import { TabInfoModel } from '@ohos/base'; +import { HomeConstants } from '../constants/HomeConstants'; + +@Component +export struct HomeTab { + @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + @Link currentPageIndex: number; + + build() { + Column() { + Tabs({ + barPosition: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? BarPosition.Start : BarPosition.End + }) { + TabContent() + .tabBar(this.BottomNavigation(ButtonInfo[HomeConstants.TAB_MESSAGE_INDEX])) + TabContent() + .tabBar(this.BottomNavigation(ButtonInfo[HomeConstants.TAB_CONTACTS_INDEX])) + TabContent() + .tabBar(this.BottomNavigation(ButtonInfo[HomeConstants.TAB_SOCIAL_CIRCLE_INDEX])) + TabContent() + .tabBar(this.BottomNavigation(ButtonInfo[HomeConstants.TAB_ME_INDEX])) + } + .vertical(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG) + .height(BaseConstants.FULL_HEIGHT) + .margin({ + top: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? '' : $r('app.float.home_tab_top_lg'), + bottom: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? '' : $r('app.float.home_tab_bottom_lg') + }) + } + .backgroundColor($r('app.color.background_color_grey_two')) + .expandSafeArea([], [SafeAreaEdge.BOTTOM]) + } + + @Builder + BottomNavigation(button: TabInfoModel) { + Column() { + Image(this.currentPageIndex === button.index ? button.selectImg : button.img) + .objectFit(ImageFit.Contain) + .width(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? $r('app.float.main_image_size_lg') : $r('app.float.main_image_size')) + .height(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? $r('app.float.main_image_size_lg') : $r('app.float.main_image_size')) + Text(button.title) + .fontColor(this.currentPageIndex === button.index ? $r('app.color.focus_color') : Color.Black) + .opacity(this.currentPageIndex === button.index ? BaseConstants.FULL_OPACITY : BaseConstants.SIXTY_OPACITY) + .fontWeight(BaseConstants.FONT_WEIGHT_FIVE) + .textAlign(TextAlign.Center) + .fontSize($r('app.float.micro_font_size')) + .lineHeight($r('app.float.text_line_height_three')) + .fontFamily(BaseConstants.FONT_FAMILY_MEDIUM) + .margin({ top: $r('app.float.document_text_top') }) + } + + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .onClick(() => { + this.currentPageIndex = button.index; + }) + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/views/MessageBubble.ets b/features/home/src/main/ets/views/MessageBubble.ets new file mode 100755 index 0000000000000000000000000000000000000000..1e4607dcb4e1bcb4151553d98a6a27c4b0e44d36 --- /dev/null +++ b/features/home/src/main/ets/views/MessageBubble.ets @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2023 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 { BaseConstants, BreakpointConstants, IntroduceText, NormalText } from '@ohos/base' +import { HomeConstants } from '../constants/HomeConstants'; +import { ConversationDataInterface, ConversationListData } from '../viewmodel/ConversationViewModel'; + +@Component +export struct MessageBubble { + @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + @Link receivedName: string; + @Link currentFeatureIndex: number; + private isReceived: boolean = !HomeConstants.IS_RECEIVED; + private content: string = ""; + private isAppletMsg?: boolean; + private isDocumentMsg?: boolean; + avatar1: Resource = $r('app.media.avatar1'); + avatar2: Resource = $r('app.media.avatar7'); + + build() { + Column() { + Flex({ justifyContent: this.isReceived ? FlexAlign.Start : FlexAlign.End, direction: FlexDirection.Row }) { + if (this.isReceived) { + Image(ConversationListData.find((item) => item.name === this.receivedName)?.icon || this.avatar1) + .width($r('app.float.avatar_image_size')) + .height($r('app.float.avatar_image_size')) + .flexShrink(BaseConstants.FLEX_SHRINK_ZERO) + } + Column() { + Stack({ alignContent: this.isReceived ? Alignment.TopStart : Alignment.TopEnd }) { + Path() + .commands('M-10 1 L0 18 L32 1 Z') + .fillOpacity(HomeConstants.CONVERSATION_DETAIL_FILL_OPACITY) + .stroke(Color.White) + .strokeWidth(HomeConstants.CONVERSATION_DETAIL_STROKE_WIDTH) + .fill(Color.White) + .visibility(this.isReceived ? Visibility.Visible : Visibility.None) + Path() + .commands('M23 1 L0 28 L-10 1 Z') + .fillOpacity(HomeConstants.CONVERSATION_DETAIL_FILL_OPACITY) + .stroke(Color.White) + .strokeWidth(HomeConstants.CONVERSATION_DETAIL_STROKE_WIDTH) + .fill(Color.White) + .visibility(this.isReceived ? Visibility.None : Visibility.Visible) + .zIndex(HomeConstants.CONTACTS_DETAIL_AVATAR_Z_INDEX) + .margin({ right: $r('app.float.conversation_detail_path_right') }) + Column() { + this.MessageContent() + } + .padding({ + left: $r('app.float.path_column_left'), + right: $r('app.float.path_column_right'), + top: $r('app.float.path_column_top'), + bottom: $r('app.float.path_column_bottom') + }) + .backgroundColor(Color.White) + .borderRadius(HomeConstants.PATH_BORDER_RADIUS) + } + .padding({ + top: $r('app.float.path_top'), + left: $r('app.float.path_left'), + right: $r('app.float.path_right'), + bottom: $r('app.float.path_bottom') + }) + .width(BaseConstants.FULL_WIDTH) + } + .width(BaseConstants.FULL_WIDTH) + + if (!this.isReceived) { + Image(this.avatar2) + .width($r('app.float.icon_width')) + .height($r('app.float.icon_height')) + .flexShrink(BaseConstants.FLEX_SHRINK_ZERO) + } + } + } + .margin({ left: $r('app.float.message_bubble_left'), right: $r('app.float.message_bubble_right') }) + } + + @Builder + MessageContent() { + if (this.isAppletMsg) { + Column() { + Row() { + Image($r('app.media.ic_tea')) + .height($r('app.float.applet_icon_size')) + .width($r('app.float.applet_icon_size')) + .margin({ right: $r('app.float.applet_icon_right') }) + Text(HomeConstants.APPLET_TITLE) + .fontFamily(BaseConstants.FONT_FAMILY_NORMAL) + .fontSize(BaseConstants.FONT_SIZE_TWELVE) + .fontColor($r('app.color.conversation_default_text_color')) + .textAlign(TextAlign.Start) + .fontWeight(BaseConstants.FONT_WEIGHT_FOUR) + } + .margin({ bottom: $r('app.float.applet_title_bottom') }) + + Text(this.content) + .fontFamily(BaseConstants.FONT_FAMILY_NORMAL) + .fontSize(BaseConstants.FONT_SIZE_TWELVE) + .fontColor($r('app.color.conversation_default_text_color')) + .textAlign(TextAlign.Start) + .fontWeight(BaseConstants.FONT_WEIGHT_FOUR) + .margin({ bottom: $r('app.float.applet_introduce_bottom') }) + .copyOption(CopyOptions.LocalDevice) + Flex() { + } + .height($r('app.float.applet_image_height')) + .width($r('app.float.applet_image_width')) + .backgroundImage($r('app.media.picture_applet_link')) + .backgroundImageSize({ width: $r('app.float.applet_image_width'), height: $r('app.float.applet_image_height') }) + .constraintSize({ maxWidth: BaseConstants.FULL_WIDTH }) + .margin({ bottom: $r('app.float.applet_image_bottom') }) + + Text(HomeConstants.APPLET_DESCRIBE) + .fontFamily(BaseConstants.FONT_FAMILY_NORMAL) + .fontSize(BaseConstants.FONT_SIZE_TEN) + .fontColor($r('app.color.background_color_grey_three')) + .textAlign(TextAlign.Start) + .fontWeight(BaseConstants.FONT_WEIGHT_FOUR) + } + .alignItems(HorizontalAlign.Start) + } else if (this.isDocumentMsg) { + Column() { + Row() { + NormalText({ data: this.content }) + .margin({ right: $r('app.float.applet_icon_right') }) + .width($r('app.float.document_text_width')) + Image($r('app.media.ic_PDF')) + .height($r('app.float.document_icon_size')) + .width($r('app.float.document_icon_size')) + .margin({ right: $r('app.float.document_icon_right') }) + } + .margin({ bottom: $r('app.float.document_icon_bottom') }) + + IntroduceText({ data: HomeConstants.DOCUMENT_SIZE, fontColor: $r('app.color.background_color_grey_three') }) + .margin({ bottom: $r('app.float.document_text_bottom') }) + Divider() + .color($r('app.color.divider_background_color')) + .strokeWidth(HomeConstants.DOCUMENT_DIVIDER_WIDTH).margin({ bottom: $r('app.float.divider_bottom') }) + Row() { + Image($r('app.media.ic_file')) + .width($r('app.float.document_small_icon_size')) + .height($r('app.float.document_small_icon_size')) + .margin({ right: $r('app.float.document_small_icon_right') }) + IntroduceText({ + data: HomeConstants.DOCUMENT_INTRODUCE, + fontColor: $r('app.color.background_color_grey_three') + }) + .margin({ top: $r('app.float.document_introduce_top') }) + } + } + .alignItems(HorizontalAlign.Start) + .width($r('app.float.document_width')) + .margin({ bottom: $r('app.float.document_bottom') }) + } else { + Text(this.content) + .fontSize(BaseConstants.FONT_SIZE_TWELVE) + .fontFamily(BaseConstants.FONT_FAMILY_NORMAL) + .fontWeight(BaseConstants.FONT_WEIGHT_FOUR) + .lineHeight($r('app.float.conversation_default_text_line')) + .fontColor($r('app.color.conversation_default_text_color')) + .copyOption(CopyOptions.LocalDevice) + } + } +} \ No newline at end of file diff --git a/features/home/src/main/ets/views/common/HomeTopSearch.ets b/features/home/src/main/ets/views/common/HomeTopSearch.ets new file mode 100755 index 0000000000000000000000000000000000000000..90c8889355b4c87ca4bd651168532bd3d82b3952 --- /dev/null +++ b/features/home/src/main/ets/views/common/HomeTopSearch.ets @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 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 { BaseConstants, BreakpointConstants, StandardIcon } from '@ohos/base'; +import { HomeConstants } from '../../constants/HomeConstants'; +import { deviceInfo } from '@kit.BasicServicesKit'; + +@Component +export struct HomeTopSearch { + @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + @Prop title: string; + + build() { + Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { + Column() { + Text(this.title) + .fontWeight(BaseConstants.FONT_WEIGHT_FIVE) + .fontSize(BaseConstants.FONT_SIZE_TWENTY_FOUR) + .fontFamily(BaseConstants.FONT_FAMILY_MEDIUM) + .width(BaseConstants.FULL_WIDTH) + } + .flexBasis(HomeConstants.SEARCH_TEXT_FLEX_BASIS) + + if (this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG) { + Column() { + this.searchBar() + } + .flexBasis(HomeConstants.FLEX_BASIS_AUTO) + .margin({ right: $r('app.float.icon_margin_two') }) + } else { + Blank() + StandardIcon({ icon: $r('app.media.ic_public_search') }) + .margin({ right: $r('app.float.phone_icon_right') }) + } + Column() { + StandardIcon({ icon: $r('app.media.ic_public_add_norm') }) + .flexBasis(HomeConstants.FLEX_BASIS_AUTO) + } + .margin({ right: $r('app.float.phone_icon_right') }) + } + .width(BaseConstants.FULL_WIDTH) + .height(BaseConstants.FULL_HEIGHT) + .backgroundColor(Color.White) + .padding({ left: $r('app.float.phone_icon_left'),top: deviceInfo.deviceType === BaseConstants.DEVICE_2IN1 ? $r('app.float.zero') : $r('app.float.device_padding_top') }) + } + + @Builder + searchBar() { + Row() { + Stack({ alignContent: Alignment.Start }) { + TextInput({ placeholder: HomeConstants.SEARCH_TEXT_INPUT }) + .placeholderFont({ + size: $r('app.float.text_input_default_font'), + weight: FontWeight.Normal + }) + .placeholderColor($r('app.color.text_input_default_color')) + .height($r('app.float.text_input_height')) + .fontSize(BaseConstants.FONT_SIZE_SIXTEEN) + .padding({ + left: $r('app.float.text_input_left'), + right: $r('app.float.text_input_right') + }) + .width(BaseConstants.FULL_WIDTH) + .enableKeyboardOnFocus(HomeConstants.ENABLE_KEY_BOARD_ON_FOCUS) + .backgroundColor($r('app.color.text_input_default_background_color')) + .caretColor($r('app.color.text_input_default_care_color')) + + Image($r('app.media.ic_public_search')) + .width($r('app.float.small_icon_width')) + .height($r('app.float.small_icon_height')) + .margin({ left: $r('app.float.add_icon_left') }) + } + .alignSelf(ItemAlign.Center) + .layoutWeight(BaseConstants.LAYOUT_WEIGHT_ONE) + } + .justifyContent(FlexAlign.Center) + .width(BaseConstants.FULL_WIDTH) + .height(BaseConstants.FULL_HEIGHT) + } +} \ 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 100755 index 0000000000000000000000000000000000000000..9e3688bd043d7756651a6f367c9a5c6ddfa4e0ec --- /dev/null +++ b/features/home/src/main/module.json5 @@ -0,0 +1,14 @@ +{ + "module": { + "name": "home", + "type": "shared", + "description": "$string:shared_desc", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "pages": "$profile:main_pages" + } +} \ No newline at end of file diff --git a/features/home/src/main/resources/base/element/color.json b/features/home/src/main/resources/base/element/color.json new file mode 100755 index 0000000000000000000000000000000000000000..2923b618493ab53b5dfd53f0dd3c8dd468bfe231 --- /dev/null +++ b/features/home/src/main/resources/base/element/color.json @@ -0,0 +1,80 @@ +{ + "color": [ + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "focus_color", + "value": "#0A59F7" + }, + { + "name": "background_color_grey", + "value": "#F6F6F6" + }, + { + "name": "background_color_grey_two", + "value": "#F1F3F5" + }, + { + "name": "background_color_grey_three", + "value": "#8A9097" + }, + { + "name": "divider_background_color", + "value": "#E6E6E6" + }, + { + "name": "background_color_pink", + "value": "#FCF7F6" + }, + { + "name": "background_color_icon", + "value": "#F0A6C3" + }, + { + "name": "font_color_one", + "value": "#000000" + }, + { + "name": "font_color_black_two", + "value": "#182431" + }, + { + "name": "line_color", + "value": "#E7E7E7" + }, + { + "name": "tab_clicked_color", + "value": "#1698CE" + }, + { + "name": "tab_unclicked_color", + "value": "#6B6B6B" + }, + { + "name": "text_input_default_color", + "value": "#99000000" + }, + { + "name": "text_input_default_background_color", + "value": "#F1F3F5" + }, + { + "name": "text_input_default_care_color", + "value": "#007DFF" + }, + { + "name": "conversation_none_icon_bg_color", + "value": "#F6F6F6" + }, + { + "name": "conversation_default_text_color", + "value": "#182431" + }, + { + "name": "conversation_clicked_bg_color", + "value": "#33D8D8D8" + } + ] +} \ No newline at end of file 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 100755 index 0000000000000000000000000000000000000000..4406cdf7081898b18296986e5a0aaf7bcfee02ec --- /dev/null +++ b/features/home/src/main/resources/base/element/float.json @@ -0,0 +1,488 @@ +{ + "float": [ + { + "name": "micro_font_size", + "value": "10fp" + }, + { + "name": "icon_height_one", + "value": "24vp" + }, + { + "name": "icon_width_one", + "value": "24vp" + }, + { + "name": "icon_margin_one", + "value": "12vp" + }, + { + "name": "icon_margin_two", + "value": "24vp" + }, + { + "name": "main_image_size", + "value": "22vp" + }, + { + "name": "main_image_size_lg", + "value": "24vp" + }, + { + "name": "avatar_image_size", + "value": "40vp" + }, + { + "name": "bar_width", + "value": "96vp" + }, + { + "name": "text_line_height_one", + "value": "19fp" + }, + { + "name": "text_line_height_three", + "value": "14fp" + }, + { + "name": "text_line_height_two", + "value": "22fp" + }, + { + "name": "background_color_grey", + "value": "#111111" + }, + { + "name": "input_radius_one", + "value": "20vp" + }, + { + "name": "text_line_height_five", + "value": "21fp" + }, + { + "name": "smaller_mini_font_size", + "value": "11fp" + }, + { + "name": "picture_gap", + "value": "2vp" + }, + { + "name": "home_tab_width", + "value": "96vp" + }, + { + "name": "home_tab_height", + "value": "56vp" + }, + { + "name": "home_tab_padding_left", + "value": "22vp" + }, + { + "name": "home_tab_padding_top", + "value": "180vp" + }, + { + "name": "home_tab_padding_bottom", + "value": "180vp" + }, + { + "name": "home_list_width", + "value": "22vp" + }, + { + "name": "home_tab_font_size", + "value": "20fp" + }, + { + "name": "font_family_normal", + "value": "HarmonyHeiTi" + }, + { + "name": "font_family_medium", + "value": "HarmonyHeiTi-Medium" + }, + { + "name": "font_family_bold", + "value": "HarmonyHeiTi-Bold" + }, + { + "name": "font_family_semi_bold", + "value": "HarmonyHeiTi-SemiBold" + }, + { + "name": "font_size_ten", + "value": "10fp" + }, + { + "name": "font_size_eleven", + "value": "11fp" + }, + { + "name": "font_size_twelve", + "value": "12fp" + }, + { + "name": "font_size_fourteen", + "value": "14fp" + }, + { + "name": "font_size_sixteen", + "value": "16fp" + }, + { + "name": "font_size_eighteen", + "value": "18fp" + }, + { + "name": "font_size_twenty", + "value": "20fp" + }, + { + "name": "font_size_twenty_four", + "value": "24fp" + }, + { + "name": "font_size_thirty_two", + "value": "32fp" + }, + { + "name": "icon_height", + "value": "40vp" + }, + { + "name": "icon_width", + "value": "40vp" + }, + { + "name": "icon_right", + "value": "8vp" + }, + { + "name": "user_name_bottom", + "value": "6vp" + }, + { + "name": "user_message_bottom", + "value": "8vp" + }, + { + "name": "header_top", + "value": "16vp" + }, + { + "name": "header_right", + "value": "20vp" + }, + { + "name": "header_bottom", + "value": "16vp" + }, + { + "name": "header_left", + "value": "24vp" + }, + { + "name": "back_icon_top", + "value": "19vp" + }, + { + "name": "back_icon_left", + "value": "26vp" + }, + { + "name": "contacts_detail_avatar_height", + "value": "124vp" + }, + { + "name": "contacts_detail_avatar_top", + "value": "84vp" + }, + { + "name": "contacts_detail_avatar_border_width", + "value": "5vp" + }, + { + "name": "contacts_detail_avatar_border_radius", + "value": "100" + }, + { + "name": "contacts_detail_user_top", + "value": "82vp" + }, + { + "name": "phone_left", + "value": "24vp" + }, + { + "name": "phone_icon_right", + "value": "24pv" + }, + { + "name": "phone_icon_left", + "value": "24pv" + }, + { + "name": "phone_column_top", + "value": "45vp" + }, + { + "name": "phone_divider_left", + "value": "24vp" + }, + { + "name": "phone_divider_right", + "value": "24vp" + }, + { + "name": "phone_divider_top", + "value": "20vp" + }, + { + "name": "last_post_left", + "value": "24vp" + }, + { + "name": "last_post_top", + "value": "17vp" + }, + { + "name": "images_left", + "value": "24vp" + }, + { + "name": "images_top", + "value": "2vp" + }, + { + "name": "images_column_left", + "value": "5vp" + }, + { + "name": "images_column_right", + "value": "5vp" + }, + { + "name": "contacts_detail_left", + "value": "31vp" + }, + { + "name": "contacts_detail_right", + "value": "31vp" + }, + { + "name": "contacts_detail_column_top", + "value": "146vp" + }, + { + "name": "alphabet_indexer_right", + "value": "16vp" + }, + { + "name": "text_input_default_font", + "value": "16vp" + }, + { + "name": "text_input_height", + "value": "40vp" + }, + { + "name": "text_input_left", + "value": "36vp" + }, + { + "name": "text_input_right", + "value": "12vp" + }, + { + "name": "small_icon_height", + "value": "16vp" + }, + { + "name": "small_icon_width", + "value": "16vp" + }, + { + "name": "add_icon_left", + "value": "12vp" + }, + { + "name": "contacts_item_padding", + "value": "3vp" + }, + { + "name": "conversation_detail_bottom_padding", + "value": "24vp" + }, + { + "name": "conversation_detail_bottom_text_padding", + "value": "3vp" + }, + { + "name": "conversation_detail_bottom_height", + "value": "56vp" + }, + { + "name": "conversation_none_icon_height", + "value": "46vp" + }, + { + "name": "conversation_none_icon_width", + "value": "50vp" + }, + { + "name": "conversation_list_time_padding", + "value": "3vp" + }, + { + "name": "conversation_list_time_width", + "value": "40vp" + }, + { + "name": "home_tab_top_lg", + "value": "6.5vp" + }, + { + "name": "home_tab_bottom_lg", + "value": "7.5vp" + }, + { + "name": "conversation_detail_path_right", + "value": "-10vp" + }, + { + "name": "path_column_top", + "value": "10vp" + }, + { + "name": "path_column_right", + "value": "12vp" + }, + { + "name": "path_column_bottom", + "value": "10vp" + }, + { + "name": "path_column_left", + "value": "12vp" + }, + { + "name": "path_top", + "value": "1vp" + }, + { + "name": "path_right", + "value": "20vp" + }, + { + "name": "path_bottom", + "value": "22vp" + }, + { + "name": "path_left", + "value": "20vp" + }, + { + "name": "message_bubble_left", + "value": "15vp" + }, + { + "name": "message_bubble_right", + "value": "16vp" + }, + { + "name": "applet_icon_size", + "value": "16vp" + }, + { + "name": "applet_icon_right", + "value": "10vp" + }, + { + "name": "applet_title_bottom", + "value": "7vp" + }, + { + "name": "applet_introduce_bottom", + "value": "8vp" + }, + { + "name": "applet_image_height", + "value": "138vp" + }, + { + "name": "applet_image_width", + "value": "186vp" + }, + { + "name": "applet_image_bottom", + "value": "6vp" + }, + { + "name": "document_text_width", + "value": "132vp" + }, + { + "name": "document_icon_size", + "value": "36vp" + }, + { + "name": "document_icon_right", + "value": "11vp" + }, + { + "name": "document_icon_bottom", + "value": "4vp" + }, + { + "name": "document_text_top", + "value": "4vp" + }, + { + "name": "document_text_bottom", + "value": "10vp" + }, + { + "name": "divider_bottom", + "value": "1vp" + }, + { + "name": "document_small_icon_size", + "value": "12vp" + }, + { + "name": "document_small_icon_right", + "value": "6vp" + }, + { + "name": "document_introduce_top", + "value": "-2vp" + }, + { + "name": "document_width", + "value": "180vp" + }, + { + "name": "document_bottom", + "value": "-7vp" + }, + { + "name": "conversation_default_text_line", + "value": "21vp" + }, + { + "name": "zero", + "value": "0vp" + }, + { + "name": "tab_content_pb", + "value": "28vp" + }, + { + "name": "device_padding_top", + "value": "36vp" + } + ] +} \ 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 100755 index 0000000000000000000000000000000000000000..213dde4b7ab3c66ba2af34622453e47d1bd60844 --- /dev/null +++ b/features/home/src/main/resources/base/element/string.json @@ -0,0 +1,24 @@ +{ + "string": [ + { + "name": "shared_desc", + "value": "description" + }, + { + "name": "Message", + "value": "消息" + }, + { + "name": "Contacts", + "value": "通讯录" + }, + { + "name": "SocialCircle", + "value": "朋友圈" + }, + { + "name": "Me", + "value": "我的" + } + ] +} \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/avatar1.png b/features/home/src/main/resources/base/media/avatar1.png new file mode 100755 index 0000000000000000000000000000000000000000..efa57aa81eac396dcbbd45e959c09c3b3974c0d1 Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar1.png differ diff --git a/features/home/src/main/resources/base/media/avatar10.png b/features/home/src/main/resources/base/media/avatar10.png new file mode 100755 index 0000000000000000000000000000000000000000..da9def68fd71a5279da359b8e4745df83f16b47c Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar10.png differ diff --git a/features/home/src/main/resources/base/media/avatar11.png b/features/home/src/main/resources/base/media/avatar11.png new file mode 100755 index 0000000000000000000000000000000000000000..7228b12dda3f4c692a7d277e8d5dbff210b2df3e Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar11.png differ diff --git a/features/home/src/main/resources/base/media/avatar2.png b/features/home/src/main/resources/base/media/avatar2.png new file mode 100755 index 0000000000000000000000000000000000000000..3129969b1f6ee82a44e9e1704d78f42a08f13055 Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar2.png differ diff --git a/features/home/src/main/resources/base/media/avatar3.png b/features/home/src/main/resources/base/media/avatar3.png new file mode 100755 index 0000000000000000000000000000000000000000..ff61ad5ff633a05e8afdcf3d05278225019c1f02 Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar3.png differ diff --git a/features/home/src/main/resources/base/media/avatar4.png b/features/home/src/main/resources/base/media/avatar4.png new file mode 100755 index 0000000000000000000000000000000000000000..fc0ce9b330540a4e28c57a93ee206787e1684607 Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar4.png differ diff --git a/features/home/src/main/resources/base/media/avatar5.png b/features/home/src/main/resources/base/media/avatar5.png new file mode 100755 index 0000000000000000000000000000000000000000..6a9b663f3e42a8cede4a97083bcf5d42c76e473d Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar5.png differ diff --git a/features/home/src/main/resources/base/media/avatar6.png b/features/home/src/main/resources/base/media/avatar6.png new file mode 100755 index 0000000000000000000000000000000000000000..7228b12dda3f4c692a7d277e8d5dbff210b2df3e Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar6.png differ diff --git a/features/home/src/main/resources/base/media/avatar7.png b/features/home/src/main/resources/base/media/avatar7.png new file mode 100755 index 0000000000000000000000000000000000000000..d2c38a5575ee3a1bcaaca76a6320860436849fba Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar7.png differ diff --git a/features/home/src/main/resources/base/media/avatar8.png b/features/home/src/main/resources/base/media/avatar8.png new file mode 100755 index 0000000000000000000000000000000000000000..da9def68fd71a5279da359b8e4745df83f16b47c Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar8.png differ diff --git a/features/home/src/main/resources/base/media/avatar9.png b/features/home/src/main/resources/base/media/avatar9.png new file mode 100755 index 0000000000000000000000000000000000000000..d2c38a5575ee3a1bcaaca76a6320860436849fba Binary files /dev/null and b/features/home/src/main/resources/base/media/avatar9.png differ diff --git a/features/home/src/main/resources/base/media/ic_PDF.png b/features/home/src/main/resources/base/media/ic_PDF.png new file mode 100755 index 0000000000000000000000000000000000000000..467d75e0178f4471001675c8c3e9bee9efe303e9 Binary files /dev/null and b/features/home/src/main/resources/base/media/ic_PDF.png differ diff --git a/features/home/src/main/resources/base/media/ic_file.png b/features/home/src/main/resources/base/media/ic_file.png new file mode 100755 index 0000000000000000000000000000000000000000..3f04ffe25852a3a3097329e6f1ab595bfd582fc7 Binary files /dev/null and b/features/home/src/main/resources/base/media/ic_file.png differ diff --git a/features/home/src/main/resources/base/media/ic_none_message.svg b/features/home/src/main/resources/base/media/ic_none_message.svg new file mode 100755 index 0000000000000000000000000000000000000000..c137ffb2136d1c4d6c89e48dd66eaa0f15fd619b --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_none_message.svg @@ -0,0 +1,9 @@ + + + ic_空状态 + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_add_norm.svg b/features/home/src/main/resources/base/media/ic_public_add_norm.svg new file mode 100755 index 0000000000000000000000000000000000000000..2c8ce30dd941362f1e9d10edda6d5f545c670f04 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_add_norm.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_add_norm + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_app.svg b/features/home/src/main/resources/base/media/ic_public_app.svg new file mode 100755 index 0000000000000000000000000000000000000000..355f0edcede8b23d3a469e4d5c3ca85a98bc02d4 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_app.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_app + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_back.svg b/features/home/src/main/resources/base/media/ic_public_back.svg new file mode 100755 index 0000000000000000000000000000000000000000..466903b263bebc25ae9b2e40098b30b6c12f1653 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_back.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_back + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_cancel.svg b/features/home/src/main/resources/base/media/ic_public_cancel.svg new file mode 100755 index 0000000000000000000000000000000000000000..7b28516dd6b5f732144bedb427e87f0dbce34482 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_cancel.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_cancel + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_cloud_upload.svg b/features/home/src/main/resources/base/media/ic_public_cloud_upload.svg new file mode 100755 index 0000000000000000000000000000000000000000..4f542b6d81b729cdcee77914047318dc31910147 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_cloud_upload.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_cloud_upload + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_comments.svg b/features/home/src/main/resources/base/media/ic_public_comments.svg new file mode 100755 index 0000000000000000000000000000000000000000..0904f453278ee1efccc8904e842e22ea04db2ba9 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_comments.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_comments + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_connection.svg b/features/home/src/main/resources/base/media/ic_public_connection.svg new file mode 100755 index 0000000000000000000000000000000000000000..d86ef457ba9a559209bb6f2e4433074bd1416bfb --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_connection.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_connection + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_contacts_group_filled.svg b/features/home/src/main/resources/base/media/ic_public_contacts_group_filled.svg new file mode 100755 index 0000000000000000000000000000000000000000..c2ae3acc50569f3a7c79c66146e1cd58fb3e9d8b --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_contacts_group_filled.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_contacts_group_filled + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_email_send.svg b/features/home/src/main/resources/base/media/ic_public_email_send.svg new file mode 100755 index 0000000000000000000000000000000000000000..68a40c712991510a4c5ba305e44b199a01948a2f --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_email_send.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_email_send + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_emoji.svg b/features/home/src/main/resources/base/media/ic_public_emoji.svg new file mode 100755 index 0000000000000000000000000000000000000000..b276f2290843e5f2d9b87edce36d6efee0a8c93d --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_emoji.svg @@ -0,0 +1,9 @@ + + + ic/ic_public_emoji + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_groups.png b/features/home/src/main/resources/base/media/ic_public_groups.png new file mode 100755 index 0000000000000000000000000000000000000000..654a7872c23165d039797a973f7152837326e005 Binary files /dev/null and b/features/home/src/main/resources/base/media/ic_public_groups.png differ diff --git a/features/home/src/main/resources/base/media/ic_public_more.svg b/features/home/src/main/resources/base/media/ic_public_more.svg new file mode 100755 index 0000000000000000000000000000000000000000..2c4f6192ffddb951114eddab041bb77ffd106094 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_more.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_more + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_multiscreen.svg b/features/home/src/main/resources/base/media/ic_public_multiscreen.svg new file mode 100755 index 0000000000000000000000000000000000000000..b9f1e2c2c5e1fd3bf060543f8b753896e485818f --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_multiscreen.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_multiscreen + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_names.png b/features/home/src/main/resources/base/media/ic_public_names.png new file mode 100755 index 0000000000000000000000000000000000000000..2b202769eb20cd57b9a5e232e23857fccb932ece Binary files /dev/null and b/features/home/src/main/resources/base/media/ic_public_names.png differ diff --git a/features/home/src/main/resources/base/media/ic_public_phone.svg b/features/home/src/main/resources/base/media/ic_public_phone.svg new file mode 100755 index 0000000000000000000000000000000000000000..3ff72ba0375545b07e0c72e31608b44975ec530b --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_phone.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_phone + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_play_norm.svg b/features/home/src/main/resources/base/media/ic_public_play_norm.svg new file mode 100755 index 0000000000000000000000000000000000000000..c170095f7d66527d07c1d0b2ae693eeb3fd3ce8a --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_play_norm.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_play_norm + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_refresh.svg b/features/home/src/main/resources/base/media/ic_public_refresh.svg new file mode 100755 index 0000000000000000000000000000000000000000..7f654264bbde7b08df28f4abef9e883f5d9cf994 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_refresh.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_refresh + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_search.svg b/features/home/src/main/resources/base/media/ic_public_search.svg new file mode 100755 index 0000000000000000000000000000000000000000..33fba7490cf0ec1e6943d00ba443db93eb6fb2db --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_search.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_search + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_search_white.svg b/features/home/src/main/resources/base/media/ic_public_search_white.svg new file mode 100755 index 0000000000000000000000000000000000000000..70e76d381f213869bda9caee8331a7b183440e0d --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_search_white.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_search + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_share.svg b/features/home/src/main/resources/base/media/ic_public_share.svg new file mode 100755 index 0000000000000000000000000000000000000000..3681ddda632ae1218b39698a65082fb56900b594 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_share.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_share + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_sound.svg b/features/home/src/main/resources/base/media/ic_public_sound.svg new file mode 100755 index 0000000000000000000000000000000000000000..fefd96c6a7b943886ae4ee47fe2b1cb414dd7288 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_sound.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_sound + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_switch_camera.svg b/features/home/src/main/resources/base/media/ic_public_switch_camera.svg new file mode 100755 index 0000000000000000000000000000000000000000..dbdc890a7e51b1a852bc9bf8f3d19611a42d18f1 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_switch_camera.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_switch_camera + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_video.svg b/features/home/src/main/resources/base/media/ic_public_video.svg new file mode 100755 index 0000000000000000000000000000000000000000..04b43b9a667d2217be581450063ef114eadd9b2a --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_video.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_video + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_video_filled.svg b/features/home/src/main/resources/base/media/ic_public_video_filled.svg new file mode 100755 index 0000000000000000000000000000000000000000..1c7fd5ad1774c44d5073350887b5b79503dc5e08 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_video_filled.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_video_filled + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_voice_filled.svg b/features/home/src/main/resources/base/media/ic_public_voice_filled.svg new file mode 100755 index 0000000000000000000000000000000000000000..e17a73ca7bed4724295c1d12b20f0b716550ca8f --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_voice_filled.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_voice_filled + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_public_wlan.svg b/features/home/src/main/resources/base/media/ic_public_wlan.svg new file mode 100755 index 0000000000000000000000000000000000000000..bb0271d9336e2167fb2e43ee3817402526bbd489 --- /dev/null +++ b/features/home/src/main/resources/base/media/ic_public_wlan.svg @@ -0,0 +1,18 @@ + + + Public/ic_public_wlan + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/ic_tea.png b/features/home/src/main/resources/base/media/ic_tea.png new file mode 100755 index 0000000000000000000000000000000000000000..87fb43a2bf3509f7e5c0ade005adabb5dc39ab5b Binary files /dev/null and b/features/home/src/main/resources/base/media/ic_tea.png differ diff --git a/features/home/src/main/resources/base/media/icon.png b/features/home/src/main/resources/base/media/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/features/home/src/main/resources/base/media/icon.png differ diff --git a/features/home/src/main/resources/base/media/icon_avatar.png b/features/home/src/main/resources/base/media/icon_avatar.png new file mode 100755 index 0000000000000000000000000000000000000000..cb8baf21230593fececd3074f6fd4d4e96ee9f1c Binary files /dev/null and b/features/home/src/main/resources/base/media/icon_avatar.png differ diff --git a/features/home/src/main/resources/base/media/icon_contacts.svg b/features/home/src/main/resources/base/media/icon_contacts.svg new file mode 100755 index 0000000000000000000000000000000000000000..de1e328ee86373611460ff2be613ee3df72b9ca6 --- /dev/null +++ b/features/home/src/main/resources/base/media/icon_contacts.svg @@ -0,0 +1,9 @@ + + + Bottom bar/icon_通讯录 + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/icon_contacts_selected.svg b/features/home/src/main/resources/base/media/icon_contacts_selected.svg new file mode 100755 index 0000000000000000000000000000000000000000..83bec3feb7b6cbc6cd508d6c22138f9d45c1aa53 --- /dev/null +++ b/features/home/src/main/resources/base/media/icon_contacts_selected.svg @@ -0,0 +1,12 @@ + + + 通讯录 + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/icon_me.svg b/features/home/src/main/resources/base/media/icon_me.svg new file mode 100755 index 0000000000000000000000000000000000000000..0a06260a9c866fa0ff4b8f2c4c9cbad55f805fb4 --- /dev/null +++ b/features/home/src/main/resources/base/media/icon_me.svg @@ -0,0 +1,14 @@ + + + BottomNavigationBar/item/normal/icon + + + + + + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/icon_message.svg b/features/home/src/main/resources/base/media/icon_message.svg new file mode 100755 index 0000000000000000000000000000000000000000..bef75b566fafc5eea462d8f8cf564cd5d3e54c2a --- /dev/null +++ b/features/home/src/main/resources/base/media/icon_message.svg @@ -0,0 +1,9 @@ + + + Bottom bar/icon_消息_G + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/icon_message_selected.svg b/features/home/src/main/resources/base/media/icon_message_selected.svg new file mode 100755 index 0000000000000000000000000000000000000000..05b26b608b39bb82a8960ee5ef8efc6bc54e2c4c --- /dev/null +++ b/features/home/src/main/resources/base/media/icon_message_selected.svg @@ -0,0 +1,9 @@ + + + Bottom bar/icon_消息_B + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/icon_social_circle.svg b/features/home/src/main/resources/base/media/icon_social_circle.svg new file mode 100755 index 0000000000000000000000000000000000000000..aead8990a5bc499a260521111fd7d53e2a38e1ee --- /dev/null +++ b/features/home/src/main/resources/base/media/icon_social_circle.svg @@ -0,0 +1,9 @@ + + + Bottom bar/icon_社交圈_G + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/icon_social_circle_selected.svg b/features/home/src/main/resources/base/media/icon_social_circle_selected.svg new file mode 100755 index 0000000000000000000000000000000000000000..3d9c431833dd8f84811109e4b0f39b133901c899 --- /dev/null +++ b/features/home/src/main/resources/base/media/icon_social_circle_selected.svg @@ -0,0 +1,9 @@ + + + Bottom bar/icon_社交圈_B + + + + + + \ No newline at end of file diff --git a/features/home/src/main/resources/base/media/img.png b/features/home/src/main/resources/base/media/img.png new file mode 100755 index 0000000000000000000000000000000000000000..720a01aabcc02091c26734f02e4962814c62e504 Binary files /dev/null and b/features/home/src/main/resources/base/media/img.png differ diff --git a/features/home/src/main/resources/base/media/picture_applet_link.png b/features/home/src/main/resources/base/media/picture_applet_link.png new file mode 100755 index 0000000000000000000000000000000000000000..f5331685059a1672760726791d3b455a1ccfd3d1 Binary files /dev/null and b/features/home/src/main/resources/base/media/picture_applet_link.png differ diff --git a/features/home/src/main/resources/base/media/setting.jpeg b/features/home/src/main/resources/base/media/setting.jpeg new file mode 100755 index 0000000000000000000000000000000000000000..57e67dd49d39ad64ef090f59db3db9dfe6632106 Binary files /dev/null and b/features/home/src/main/resources/base/media/setting.jpeg differ diff --git a/features/home/src/main/resources/base/media/social_circle1.png b/features/home/src/main/resources/base/media/social_circle1.png new file mode 100755 index 0000000000000000000000000000000000000000..c154bf4ce1ede2b1ab76d94a388748add9621005 Binary files /dev/null and b/features/home/src/main/resources/base/media/social_circle1.png differ diff --git a/features/home/src/main/resources/base/media/social_circle2.jpg b/features/home/src/main/resources/base/media/social_circle2.jpg new file mode 100755 index 0000000000000000000000000000000000000000..1f48c2abb9c15499951edb75092ec61bd92042a7 Binary files /dev/null and b/features/home/src/main/resources/base/media/social_circle2.jpg differ diff --git a/features/home/src/main/resources/base/media/social_circle3.jpg b/features/home/src/main/resources/base/media/social_circle3.jpg new file mode 100755 index 0000000000000000000000000000000000000000..c743fffbde638107707801fb7740c530c4f6cdd2 Binary files /dev/null and b/features/home/src/main/resources/base/media/social_circle3.jpg differ diff --git a/features/home/src/main/resources/base/media/social_circle4.jpg b/features/home/src/main/resources/base/media/social_circle4.jpg new file mode 100755 index 0000000000000000000000000000000000000000..dfb5b410f8ee457c63b3367b9391f27e4524d956 Binary files /dev/null and b/features/home/src/main/resources/base/media/social_circle4.jpg differ diff --git a/features/home/src/main/resources/base/media/social_circle5.jpg b/features/home/src/main/resources/base/media/social_circle5.jpg new file mode 100755 index 0000000000000000000000000000000000000000..eaa682880b28b9a834d1ddb9e97344adc6ff13a2 Binary files /dev/null and b/features/home/src/main/resources/base/media/social_circle5.jpg differ diff --git a/features/home/src/main/resources/base/media/social_circle6.jpg b/features/home/src/main/resources/base/media/social_circle6.jpg new file mode 100755 index 0000000000000000000000000000000000000000..9e7ffcdb5f5058f36e56f66c305df951769b83da Binary files /dev/null and b/features/home/src/main/resources/base/media/social_circle6.jpg differ diff --git a/features/home/src/main/resources/base/media/social_circle7.jpg b/features/home/src/main/resources/base/media/social_circle7.jpg new file mode 100755 index 0000000000000000000000000000000000000000..48b12f781efaa4838b7396eb1455771a85f93b05 Binary files /dev/null and b/features/home/src/main/resources/base/media/social_circle7.jpg differ diff --git a/features/home/src/main/resources/base/media/social_circle8.jpg b/features/home/src/main/resources/base/media/social_circle8.jpg new file mode 100755 index 0000000000000000000000000000000000000000..a8f2ac8fed4d716a09ec3216bb8610efbdc2a911 Binary files /dev/null and b/features/home/src/main/resources/base/media/social_circle8.jpg differ diff --git a/features/home/src/main/resources/base/media/social_circle9.jpg b/features/home/src/main/resources/base/media/social_circle9.jpg new file mode 100755 index 0000000000000000000000000000000000000000..e3be34e2bdc99d1e90d5878624c3c05f4f715102 Binary files /dev/null and b/features/home/src/main/resources/base/media/social_circle9.jpg differ diff --git a/features/home/src/main/resources/base/profile/main_pages.json b/features/home/src/main/resources/base/profile/main_pages.json new file mode 100755 index 0000000000000000000000000000000000000000..14bbd62cb9de385b1f5551945d749bb5e0e5fc2c --- /dev/null +++ b/features/home/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/features/socialCircle/Index.ets b/features/socialCircle/Index.ets new file mode 100755 index 0000000000000000000000000000000000000000..6d1fe2d1b6c2fa9b2f9783f91ff7c4b79bb73c68 --- /dev/null +++ b/features/socialCircle/Index.ets @@ -0,0 +1 @@ +export { SocialCircle } from "./src/main/ets/pages/Index"; \ No newline at end of file diff --git a/features/socialCircle/build-profile.json5 b/features/socialCircle/build-profile.json5 new file mode 100755 index 0000000000000000000000000000000000000000..78a5a3f1f587ddd84cd8f23ea0f6a818d6d25676 --- /dev/null +++ b/features/socialCircle/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + "arkOptions": { + // "apPath": "./modules.ap" /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */ + } + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + } + ] +} \ No newline at end of file diff --git a/features/socialCircle/hvigorfile.ts b/features/socialCircle/hvigorfile.ts new file mode 100755 index 0000000000000000000000000000000000000000..64fa6f97b15f9d477f14026c181352882b94a21b --- /dev/null +++ b/features/socialCircle/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hspTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hspTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/features/socialCircle/obfuscation-rules.txt b/features/socialCircle/obfuscation-rules.txt new file mode 100755 index 0000000000000000000000000000000000000000..3ae3d22892781d9b4f8833eb1b19d819c3032d58 --- /dev/null +++ b/features/socialCircle/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/features/socialCircle/oh-package.json5 b/features/socialCircle/oh-package.json5 new file mode 100755 index 0000000000000000000000000000000000000000..1f9349c7376462d959d34b59b14dc2f010077be9 --- /dev/null +++ b/features/socialCircle/oh-package.json5 @@ -0,0 +1,13 @@ +{ + "license": "Apache-2.0", + "devDependencies": {}, + "author": "", + "name": "socialcircle", + "description": "Please describe the basic information.", + "main": "Index.ets", + "version": "1.0.0", + "dynamicDependencies": {}, + "dependencies": { + "@ohos/base": "file:../../common/base" + } +} diff --git a/features/socialCircle/src/main/ets/constants/PictureConstants.ets b/features/socialCircle/src/main/ets/constants/PictureConstants.ets new file mode 100755 index 0000000000000000000000000000000000000000..84a04f8f37b20872a834ce1b90a5bc375c5f1c9a --- /dev/null +++ b/features/socialCircle/src/main/ets/constants/PictureConstants.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 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 { PictureArrayInterface } from '../viewmodel/CommonViewModel'; + +export class PictureConstants { + static readonly ICON_BORDER_RADIUS = 6; + static readonly USER_NAME = '晓乐'; + static readonly USER_MESSAGE = '挺有意思的,大家都来看看吧!挺有意思的,大家都来看看吧!'; + static readonly COLUMNS_TEMPLATE = '1fr 1fr 1fr'; + static readonly TEMPLATE_BUSINESS = '1fr'; + static readonly MAX_COLUMN_NUM = 3; +} + +function getSocialCircleList(): PictureArrayInterface[] { + const pictures: Resource[] = [ + $r('app.media.social_circle1'), + $r('app.media.social_circle2'), + $r('app.media.social_circle3'), + $r('app.media.social_circle4'), + $r('app.media.social_circle5'), + $r('app.media.social_circle6'), + $r('app.media.social_circle7'), + $r('app.media.social_circle8'), + $r('app.media.social_circle9')]; + const socialCircleList: PictureArrayInterface[] = new Array(9).fill(1) + .map((item: number, index: number): PictureArrayInterface => { + return new PictureArrayInterface(pictures.slice(0, index + 1)) + }); + return socialCircleList; +} + +export default getSocialCircleList; \ No newline at end of file diff --git a/features/socialCircle/src/main/ets/pages/Index.ets b/features/socialCircle/src/main/ets/pages/Index.ets new file mode 100755 index 0000000000000000000000000000000000000000..d09626b1b4d683b69bc83d66c61922530d50a2ac --- /dev/null +++ b/features/socialCircle/src/main/ets/pages/Index.ets @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2023 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 { BreakpointConstants, BaseConstants } from '@ohos/base'; +import getSocialCircleList, { PictureConstants } from '../constants/PictureConstants'; +import { PictureArrayInterface, PictureInterface } from '../viewmodel/CommonViewModel'; +import { deviceInfo } from '@kit.BasicServicesKit'; + +@Entry +@Component +export struct SocialCircle { + @StorageLink('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + private socialCircleList: PictureArrayInterface[] = getSocialCircleList(); + + getRowsTemplate(length: number): string { + let rowNumber: number = length % PictureConstants.MAX_COLUMN_NUM === 0 ? length / PictureConstants.MAX_COLUMN_NUM : + (Math.floor(length / PictureConstants.MAX_COLUMN_NUM) + 1) + return new Array(rowNumber).fill(PictureConstants.TEMPLATE_BUSINESS).join(' '); + } + + /** + * get picture aspect ratio + */ + getAspectRatio(length: number): number { + let rowNumber: number = length % PictureConstants.MAX_COLUMN_NUM === 0 ? length / PictureConstants.MAX_COLUMN_NUM : + (Math.floor(length / PictureConstants.MAX_COLUMN_NUM) + 1) + + return PictureConstants.MAX_COLUMN_NUM / rowNumber + } + + build() { + Flex({ direction: FlexDirection.Column }) { + List() { + ForEach(this.socialCircleList, (item: PictureArrayInterface) => { + ListItem() { + this.CircleItem(item) + } + }, (item: PictureArrayInterface, index: number) => index + JSON.stringify(item)) + } + .width(BaseConstants.FULL_WIDTH) + .height(BaseConstants.FULL_HEIGHT) + } + .backgroundColor(Color.White) + .height(BaseConstants.FULL_HEIGHT) + .width(BaseConstants.FULL_WIDTH) + .padding({ + top: deviceInfo.deviceType === BaseConstants.DEVICE_2IN1 ? $r('app.float.zero') : $r('app.float.device_padding_top') + }) + } + + @Builder + CircleItem(pictureArray: PictureArrayInterface) { + Flex() { + Image($r('app.media.icon_avatar')) + .height($r('app.float.icon_height')) + .width($r('app.float.icon_width')) + .margin({ right: $r('app.float.icon_right') }) + .borderRadius(PictureConstants.ICON_BORDER_RADIUS) + .objectFit(ImageFit.Auto) + Column() { + Text(PictureConstants.USER_NAME) + .fontFamily(BaseConstants.FONT_FAMILY_MEDIUM) + .fontSize(BaseConstants.FONT_SIZE_FOURTEEN) + .fontColor(Color.Black) + .fontWeight(BaseConstants.FONT_WEIGHT_FIVE) + .margin({ bottom: $r('app.float.user_name_bottom') }) + Text(PictureConstants.USER_MESSAGE) + .fontFamily(BaseConstants.FONT_FAMILY_NORMAL) + .fontSize(BaseConstants.FONT_SIZE_TWELVE) + .fontColor(Color.Black) + .fontWeight(BaseConstants.FONT_WEIGHT_FOUR) + .margin({ bottom: $r('app.float.user_message_bottom') }) + + Grid() { + ForEach(pictureArray.pictures, (picture: PictureInterface) => { + GridItem() { + Image(picture.src) + .height(BaseConstants.FULL_HEIGHT) + .width(BaseConstants.FULL_WIDTH) + .autoResize(true) + + } + }, (picture: PictureInterface, index: number) => index + JSON.stringify(picture)) + } + .rowsTemplate(this.getRowsTemplate(pictureArray.pictures.length)) + .columnsTemplate(PictureConstants.COLUMNS_TEMPLATE) + .columnsGap($r('app.float.picture_gap')) + .rowsGap($r('app.float.picture_gap')) + .aspectRatio(this.getAspectRatio(pictureArray.pictures.length)) + .width(BaseConstants.FULL_WIDTH) + } + .alignItems(HorizontalAlign.Start) + .flexShrink(BaseConstants.FLEX_SHRINK_ONE) + .width(BaseConstants.FULL_WIDTH) + } + .padding({ + left: $r('app.float.header_left'), + right: $r('app.float.header_right'), + top: $r('app.float.header_top'), + bottom: $r('app.float.header_bottom') + }) + .width(BaseConstants.FULL_WIDTH) + } +} \ No newline at end of file diff --git a/features/socialCircle/src/main/ets/viewmodel/CommonViewModel.ets b/features/socialCircle/src/main/ets/viewmodel/CommonViewModel.ets new file mode 100755 index 0000000000000000000000000000000000000000..90b00182ffe06203109901d533d3a507a8b8baed --- /dev/null +++ b/features/socialCircle/src/main/ets/viewmodel/CommonViewModel.ets @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2023 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. +*/ + + +interface SocialCircleItemInterface { + icon: Resource; + name: string; + msg: string; + pictureList: PictureInterface[]; +}; + +/** + * Picture array interface + */ +class PictureArrayInterface { + pictures: PictureInterface[] = []; + + constructor(pictureSource: Resource[]) { + pictureSource.forEach(item => { + this.pictures.push(new PictureInterface(item)); + }) + } +} + +/** + * Picture interface + */ +class PictureInterface { + src: Resource; + + constructor(src: Resource) { + this.src = src; + } +} + +export { SocialCircleItemInterface, PictureArrayInterface, PictureInterface }; \ No newline at end of file diff --git a/features/socialCircle/src/main/module.json5 b/features/socialCircle/src/main/module.json5 new file mode 100755 index 0000000000000000000000000000000000000000..b60959b06fbdff16c3a46d9d71cb6cc5e5725d72 --- /dev/null +++ b/features/socialCircle/src/main/module.json5 @@ -0,0 +1,14 @@ +{ + "module": { + "name": "socialCircle", + "type": "shared", + "description": "$string:shared_desc", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "pages": "$profile:main_pages" + } +} \ No newline at end of file diff --git a/features/socialCircle/src/main/resources/base/element/color.json b/features/socialCircle/src/main/resources/base/element/color.json new file mode 100755 index 0000000000000000000000000000000000000000..62a137a61b90c14f109ed8c81d9d551ea0a5888a --- /dev/null +++ b/features/socialCircle/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "white", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/features/socialCircle/src/main/resources/base/element/float.json b/features/socialCircle/src/main/resources/base/element/float.json new file mode 100755 index 0000000000000000000000000000000000000000..6029872df5c74922d0246a047922dc68d29a4eee --- /dev/null +++ b/features/socialCircle/src/main/resources/base/element/float.json @@ -0,0 +1,52 @@ +{ + "float": [ + { + "name": "icon_height", + "value": "40vp" + }, + { + "name": "icon_width", + "value": "40vp" + }, + { + "name": "icon_right", + "value": "8vp" + }, + { + "name": "user_name_bottom", + "value": "6vp" + }, + { + "name": "user_message_bottom", + "value": "8vp" + }, + { + "name": "header_top", + "value": "16vp" + }, + { + "name": "header_right", + "value": "20vp" + }, + { + "name": "header_bottom", + "value": "16vp" + }, + { + "name": "header_left", + "value": "24vp" + }, + { + "name": "picture_gap", + "value": "2vp" + }, + { + "name": "zero", + "value": "0vp" + }, + { + "name": "device_padding_top", + "value": "36vp" + } + ] +} \ No newline at end of file diff --git a/features/socialCircle/src/main/resources/base/element/string.json b/features/socialCircle/src/main/resources/base/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..95ba6cbabb98622d7723dcd5f616d3326345eb95 --- /dev/null +++ b/features/socialCircle/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "shared_desc", + "value": "description" + } + ] +} \ No newline at end of file diff --git a/features/socialCircle/src/main/resources/base/media/icon.png b/features/socialCircle/src/main/resources/base/media/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/icon.png differ diff --git a/features/socialCircle/src/main/resources/base/media/icon_avatar.png b/features/socialCircle/src/main/resources/base/media/icon_avatar.png new file mode 100755 index 0000000000000000000000000000000000000000..cb8baf21230593fececd3074f6fd4d4e96ee9f1c Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/icon_avatar.png differ diff --git a/features/socialCircle/src/main/resources/base/media/setting.jpeg b/features/socialCircle/src/main/resources/base/media/setting.jpeg new file mode 100755 index 0000000000000000000000000000000000000000..57e67dd49d39ad64ef090f59db3db9dfe6632106 Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/setting.jpeg differ diff --git a/features/socialCircle/src/main/resources/base/media/social_circle1.png b/features/socialCircle/src/main/resources/base/media/social_circle1.png new file mode 100755 index 0000000000000000000000000000000000000000..c154bf4ce1ede2b1ab76d94a388748add9621005 Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/social_circle1.png differ diff --git a/features/socialCircle/src/main/resources/base/media/social_circle2.jpg b/features/socialCircle/src/main/resources/base/media/social_circle2.jpg new file mode 100755 index 0000000000000000000000000000000000000000..1f48c2abb9c15499951edb75092ec61bd92042a7 Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/social_circle2.jpg differ diff --git a/features/socialCircle/src/main/resources/base/media/social_circle3.jpg b/features/socialCircle/src/main/resources/base/media/social_circle3.jpg new file mode 100755 index 0000000000000000000000000000000000000000..c743fffbde638107707801fb7740c530c4f6cdd2 Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/social_circle3.jpg differ diff --git a/features/socialCircle/src/main/resources/base/media/social_circle4.jpg b/features/socialCircle/src/main/resources/base/media/social_circle4.jpg new file mode 100755 index 0000000000000000000000000000000000000000..dfb5b410f8ee457c63b3367b9391f27e4524d956 Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/social_circle4.jpg differ diff --git a/features/socialCircle/src/main/resources/base/media/social_circle5.jpg b/features/socialCircle/src/main/resources/base/media/social_circle5.jpg new file mode 100755 index 0000000000000000000000000000000000000000..eaa682880b28b9a834d1ddb9e97344adc6ff13a2 Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/social_circle5.jpg differ diff --git a/features/socialCircle/src/main/resources/base/media/social_circle6.jpg b/features/socialCircle/src/main/resources/base/media/social_circle6.jpg new file mode 100755 index 0000000000000000000000000000000000000000..9e7ffcdb5f5058f36e56f66c305df951769b83da Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/social_circle6.jpg differ diff --git a/features/socialCircle/src/main/resources/base/media/social_circle7.jpg b/features/socialCircle/src/main/resources/base/media/social_circle7.jpg new file mode 100755 index 0000000000000000000000000000000000000000..48b12f781efaa4838b7396eb1455771a85f93b05 Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/social_circle7.jpg differ diff --git a/features/socialCircle/src/main/resources/base/media/social_circle8.jpg b/features/socialCircle/src/main/resources/base/media/social_circle8.jpg new file mode 100755 index 0000000000000000000000000000000000000000..a8f2ac8fed4d716a09ec3216bb8610efbdc2a911 Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/social_circle8.jpg differ diff --git a/features/socialCircle/src/main/resources/base/media/social_circle9.jpg b/features/socialCircle/src/main/resources/base/media/social_circle9.jpg new file mode 100755 index 0000000000000000000000000000000000000000..e3be34e2bdc99d1e90d5878624c3c05f4f715102 Binary files /dev/null and b/features/socialCircle/src/main/resources/base/media/social_circle9.jpg differ diff --git a/features/socialCircle/src/main/resources/base/profile/main_pages.json b/features/socialCircle/src/main/resources/base/profile/main_pages.json new file mode 100755 index 0000000000000000000000000000000000000000..14bbd62cb9de385b1f5551945d749bb5e0e5fc2c --- /dev/null +++ b/features/socialCircle/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 new file mode 100755 index 0000000000000000000000000000000000000000..c4d8a333ee188fca3ce774c95da6a48bcebac0cd --- /dev/null +++ b/hvigor/hvigor-config.json5 @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 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. + */ + +{ + "modelVersion": "5.0.0", + "dependencies": { + } +} \ No newline at end of file diff --git a/hvigorfile.ts b/hvigorfile.ts new file mode 100755 index 0000000000000000000000000000000000000000..159890e9ee8c4dc8cfff2a03e6207edb86abb0b5 --- /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 100755 index 0000000000000000000000000000000000000000..c7a24fcb22e9c1b06848280f83b74b5e95c156c3 --- /dev/null +++ b/oh-package.json5 @@ -0,0 +1,14 @@ +{ + "modelVersion": "5.0.0", + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.15" + }, + "author": "", + "name": "MultiDeviceCommunication", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dynamicDependencies": {}, + "dependencies": {} +} diff --git a/products/phone/build-profile.json5 b/products/phone/build-profile.json5 new file mode 100755 index 0000000000000000000000000000000000000000..49ebe7ab944255c4c36956313f168bd3f52fb06e --- /dev/null +++ b/products/phone/build-profile.json5 @@ -0,0 +1,41 @@ +{ + "apiType": "stageMode", + "buildOption": { + "arkOptions": { + // "apPath": "./modules.ap" /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */ + } + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS", + "config": { + "deviceType": [ + "phone", + "tablet", + "2in1" + ] + }, + "source": { + "pages": [ + "pages/Index", + ] + } + } + ] +} \ No newline at end of file diff --git a/products/phone/hvigorfile.ts b/products/phone/hvigorfile.ts new file mode 100755 index 0000000000000000000000000000000000000000..ba9480d0a9291ab74ff5856e77634a1c05d027a9 --- /dev/null +++ b/products/phone/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/phone/obfuscation-rules.txt b/products/phone/obfuscation-rules.txt new file mode 100755 index 0000000000000000000000000000000000000000..3ae3d22892781d9b4f8833eb1b19d819c3032d58 --- /dev/null +++ b/products/phone/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# 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://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# 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 \ No newline at end of file diff --git a/products/phone/oh-package.json5 b/products/phone/oh-package.json5 new file mode 100755 index 0000000000000000000000000000000000000000..9a65aaf201b4c5bea6567737c5ed9654dd1dd63c --- /dev/null +++ b/products/phone/oh-package.json5 @@ -0,0 +1,14 @@ +{ + "license": "", + "devDependencies": {}, + "author": "", + "name": "phone", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dynamicDependencies": {}, + "dependencies": { + "@ohos/base": "file:../../common/base", + "@ohos/home": "file:../../features/home" + } +} diff --git a/products/phone/src/main/ets/entryability/EntryAbility.ets b/products/phone/src/main/ets/entryability/EntryAbility.ets new file mode 100755 index 0000000000000000000000000000000000000000..6a215df5421f63729e6c34e120fa5a251cfd88c5 --- /dev/null +++ b/products/phone/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2022 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 '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { KeyboardAvoidMode, window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { BaseConstants } from '@ohos/base/Index'; +import { deviceInfo } from '@kit.BasicServicesKit'; + +export default class EntryAbility extends UIAbility { + onCreate(): 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'); + windowStage.getMainWindow((err: BusinessError, data) => { + if (err.code) { + hilog.info(0x0000, 'testTag', '%{public}s', 'getMainWindow failed'); + return; + } + if (deviceInfo.deviceType !== BaseConstants.DEVICE_2IN1) { + data.setWindowLayoutFullScreen(true); + } + }) + + windowStage.loadContent('pages/Index', (err, data) => { + let a = windowStage.getMainWindowSync().getUIContext().getKeyboardAvoidMode(); + windowStage.getMainWindowSync().getUIContext().setKeyboardAvoidMode(KeyboardAvoidMode.OFFSET); + 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. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + 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/phone/src/main/ets/pages/Index.ets b/products/phone/src/main/ets/pages/Index.ets new file mode 100755 index 0000000000000000000000000000000000000000..bc56001f2e22f490d472d06a26ace93ac873afc7 --- /dev/null +++ b/products/phone/src/main/ets/pages/Index.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 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 '@ohos/home'; +import { BaseConstants, BreakpointConstants } from '@ohos/base'; + +@Entry +@Component +struct Index { + @StorageLink('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_SM; + + build() { + GridRow({ + columns: { + sm: BreakpointConstants.GRID_ROW_COLUMNS[2], + md: BreakpointConstants.GRID_ROW_COLUMNS[0], + lg: BreakpointConstants.GRID_ROW_COLUMNS[0] + } + }) { + GridCol({ span: { + sm: BreakpointConstants.GRID_COLUMN_SPANS[5], + md: BreakpointConstants.GRID_COLUMN_SPANS[0], + lg: BreakpointConstants.GRID_COLUMN_SPANS[0] + } }) { + Column() { + Home() + } + .width(BaseConstants.FULL_HEIGHT) + .height(BaseConstants.FULL_HEIGHT) + + } + .height(BaseConstants.FULL_PERCENT) + .width(BaseConstants.FULL_PERCENT) + } + .onBreakpointChange((breakPoints) => { + this.currentBreakpoint = breakPoints; + }) + } +} \ No newline at end of file diff --git a/products/phone/src/main/module.json5 b/products/phone/src/main/module.json5 new file mode 100755 index 0000000000000000000000000000000000000000..8e3d8876cef7886c8fabea3b30f49dd44c6d709a --- /dev/null +++ b/products/phone/src/main/module.json5 @@ -0,0 +1,40 @@ +{ + "module": { + "name": "phone", + "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:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "minWindowWidth": 360, + "minWindowHeight": 600, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/products/phone/src/main/resources/base/element/color.json b/products/phone/src/main/resources/base/element/color.json new file mode 100755 index 0000000000000000000000000000000000000000..d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33 --- /dev/null +++ b/products/phone/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/phone/src/main/resources/base/element/string.json b/products/phone/src/main/resources/base/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..cde98f575a3693ec335f2155f88a86e03341565a --- /dev/null +++ b/products/phone/src/main/resources/base/element/string.json @@ -0,0 +1,33 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "AppletAbility_desc", + "value": "description" + }, + { + "name": "DocumentAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "一多即时通讯" + }, + { + "name": "AppletAbility_label", + "value": "一多即时通讯" + }, + { + "name": "DocumentAbility_label", + "value": "一多即时通讯" + } + + ] +} \ No newline at end of file diff --git a/products/phone/src/main/resources/base/media/PC_WPS.png b/products/phone/src/main/resources/base/media/PC_WPS.png new file mode 100755 index 0000000000000000000000000000000000000000..1145dc4dc0ec223e012b3afbe7221594e028ddf8 Binary files /dev/null and b/products/phone/src/main/resources/base/media/PC_WPS.png differ diff --git a/products/phone/src/main/resources/base/media/icon.png b/products/phone/src/main/resources/base/media/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..cd45accb1dfd2fd0da16c732c72faa6e46b26521 Binary files /dev/null and b/products/phone/src/main/resources/base/media/icon.png differ diff --git a/products/phone/src/main/resources/base/media/startIcon.png b/products/phone/src/main/resources/base/media/startIcon.png new file mode 100755 index 0000000000000000000000000000000000000000..366f76459ffd4494ec40d0ddd5c59385b9c5da11 Binary files /dev/null and b/products/phone/src/main/resources/base/media/startIcon.png differ diff --git a/products/phone/src/main/resources/base/profile/main_pages.json b/products/phone/src/main/resources/base/profile/main_pages.json new file mode 100755 index 0000000000000000000000000000000000000000..14bbd62cb9de385b1f5551945d749bb5e0e5fc2c --- /dev/null +++ b/products/phone/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/products/phone/src/main/resources/en_US/element/string.json b/products/phone/src/main/resources/en_US/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..0ef87a4d3a65defe5589f3c4ca675eaea6872d60 --- /dev/null +++ b/products/phone/src/main/resources/en_US/element/string.json @@ -0,0 +1,31 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "AppletAbility_desc", + "value": "description" + },{ + "name": "DocumentAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "MultiDeviceCommunication" + }, + { + "name": "AppletAbility_label", + "value": "MultiDeviceCommunication" + }, + { + "name": "DocumentAbility_label", + "value": "MultiDeviceCommunication" + } + ] +} \ No newline at end of file diff --git a/products/phone/src/main/resources/zh_CN/element/string.json b/products/phone/src/main/resources/zh_CN/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..3d24381e51cf295906d8c5dcb2c673109ec3c67b --- /dev/null +++ b/products/phone/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "AppletAbility_desc", + "value": "description" + }, + { + "name": "DocumentAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "一多即时通讯" + }, + { + "name": "AppletAbility_label", + "value": "一多即时通讯" + }, + { + "name": "DocumentAbility_label", + "value": "一多即时通讯" + } + ] +} \ No newline at end of file diff --git a/screenshots/device/config.PNG b/screenshots/device/config.PNG new file mode 100755 index 0000000000000000000000000000000000000000..a9512a8ea67f0fba8704a86ad743b6fdd635355b Binary files /dev/null and b/screenshots/device/config.PNG differ diff --git a/screenshots/device/foldable.png b/screenshots/device/foldable.png new file mode 100755 index 0000000000000000000000000000000000000000..6ffefcd480fd274c3aca01af8984578fe4356bca Binary files /dev/null and b/screenshots/device/foldable.png differ diff --git a/screenshots/device/pad.png b/screenshots/device/pad.png new file mode 100755 index 0000000000000000000000000000000000000000..200887d5948ace1d39c31c41c5d01a97aa8abbd0 Binary files /dev/null and b/screenshots/device/pad.png differ diff --git a/screenshots/device/phone.png b/screenshots/device/phone.png new file mode 100755 index 0000000000000000000000000000000000000000..9e8f7e56d51596613586832aff0888489068eb33 Binary files /dev/null and b/screenshots/device/phone.png differ diff --git a/screenshots/device/run.png b/screenshots/device/run.png new file mode 100755 index 0000000000000000000000000000000000000000..7655fa7e041bb067e028029d820bd2d320e2cd83 Binary files /dev/null and b/screenshots/device/run.png differ