From 5332f36966a683e7a919c9cd5bec077545166f85 Mon Sep 17 00:00:00 2001 From: WX1377357 Date: Tue, 27 May 2025 15:26:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=B8=BF=E8=92=99=E4=B8=96=E7=95=8C=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-profile.json5 | 8 +- customdialoggatherslibrary/.gitignore | 6 + customdialoggatherslibrary/Index.ets | 2 + .../build-profile.json5 | 31 +++ customdialoggatherslibrary/consumer-rules.txt | 0 customdialoggatherslibrary/hvigorfile.ts | 6 + .../obfuscation-rules.txt | 23 +++ .../oh-package.json5 | 7 +- .../ets/common/constants/CommonConstants.ets | 0 .../main/ets/pages/BindContentCoverDemo.ets | 148 ++++++++++++++ .../src/main/ets/pages/BindSheet.ets | 123 ++++++------ .../src/main/ets/pages/CustomCalendar.ets | 37 ++-- .../ets/pages/CustomDialogGathersPage.ets | 25 ++- .../src/main/ets/pages/Details.ets | 73 ++++--- .../src/main/ets/pages/FullScreen.ets | 175 ++++++++++++++++ .../src/main/ets/pages/Privacy.ets | 188 +++++++++--------- .../src/main/ets/pages/ScrollOption.ets | 157 ++++----------- .../src/main/ets/pages/Toast.ets | 79 ++++---- .../src/main/ets/pages/TwoLevelPageSheet.ets | 83 ++++---- .../src/main/ets/utils/BreakpointSystem.ets | 118 +++++++++++ .../src/main/ets/utils/WindowUtil.ets | 80 ++++++++ .../src/main/ets/view/AddPassengers.ets | 0 .../ets/view/CustomCalendarPickerDialog.ets | 0 .../src/main/ets/view/DefaultList.ets | 0 .../main/ets/viewmodel/BindContentModel.ets | 0 .../src/main/ets/viewmodel/DataManager.ets | 0 .../src/main/ets/viewmodel/DateModel.ets | 0 .../src/main/ets/viewmodel/GetDate.ets | 0 .../main/ets/viewmodel/MonthDataSource.ets | 0 .../src/main/module.json5 | 12 ++ .../main/resources/base/element/color.json | 0 .../main/resources/base/element/float.json | 0 .../main/resources/base/element/integer.json | 0 .../main/resources/base/element/string.json | 0 .../main/resources/base/media/background.png | Bin .../resources/base/media/background_guide.png | Bin .../main/resources/base/media/foreground.png | Bin .../resources/base/media/layered_image.json | 0 .../main/resources/base/media/startIcon.png | Bin .../resources/base/profile/router_map.json | 59 ++++++ .../main/resources/en_US/element/string.json | 0 .../main/resources/zh_CN/element/string.json | 0 .../build-profile.json5 | 0 .../hvigorfile.ts | 0 .../obfuscation-rules.txt | 0 customdialoggatherssample/oh-package.json5 | 11 + .../main/ets/entryability/EntryAbility.ets | 67 +------ .../src/main/ets/pages/Index.ets | 27 +-- .../src/main/module.json5 | 7 +- .../resources/base/profile/main_pages.json | 5 + .../main/ets/pages/BindContentCoverDemo.ets | 139 ------------- entry/src/main/ets/pages/ScrollOption.ets | 88 -------- .../resources/base/profile/main_pages.json | 14 -- .../resources/base/profile/router_map.json | 14 -- 54 files changed, 1076 insertions(+), 736 deletions(-) create mode 100644 customdialoggatherslibrary/.gitignore create mode 100644 customdialoggatherslibrary/Index.ets create mode 100644 customdialoggatherslibrary/build-profile.json5 create mode 100644 customdialoggatherslibrary/consumer-rules.txt create mode 100644 customdialoggatherslibrary/hvigorfile.ts create mode 100644 customdialoggatherslibrary/obfuscation-rules.txt rename {entry => customdialoggatherslibrary}/oh-package.json5 (57%) rename {entry => customdialoggatherslibrary}/src/main/ets/common/constants/CommonConstants.ets (100%) create mode 100644 customdialoggatherslibrary/src/main/ets/pages/BindContentCoverDemo.ets rename {entry => customdialoggatherslibrary}/src/main/ets/pages/BindSheet.ets (54%) rename {entry => customdialoggatherslibrary}/src/main/ets/pages/CustomCalendar.ets (85%) rename entry/src/main/ets/pages/Index.ets => customdialoggatherslibrary/src/main/ets/pages/CustomDialogGathersPage.ets (85%) rename {entry => customdialoggatherslibrary}/src/main/ets/pages/Details.ets (40%) create mode 100644 customdialoggatherslibrary/src/main/ets/pages/FullScreen.ets rename {entry => customdialoggatherslibrary}/src/main/ets/pages/Privacy.ets (41%) rename entry/src/main/ets/pages/FullScreen.ets => customdialoggatherslibrary/src/main/ets/pages/ScrollOption.ets (38%) rename {entry => customdialoggatherslibrary}/src/main/ets/pages/Toast.ets (57%) rename {entry => customdialoggatherslibrary}/src/main/ets/pages/TwoLevelPageSheet.ets (68%) create mode 100644 customdialoggatherslibrary/src/main/ets/utils/BreakpointSystem.ets create mode 100644 customdialoggatherslibrary/src/main/ets/utils/WindowUtil.ets rename {entry => customdialoggatherslibrary}/src/main/ets/view/AddPassengers.ets (100%) rename {entry => customdialoggatherslibrary}/src/main/ets/view/CustomCalendarPickerDialog.ets (100%) rename {entry => customdialoggatherslibrary}/src/main/ets/view/DefaultList.ets (100%) rename {entry => customdialoggatherslibrary}/src/main/ets/viewmodel/BindContentModel.ets (100%) rename {entry => customdialoggatherslibrary}/src/main/ets/viewmodel/DataManager.ets (100%) rename {entry => customdialoggatherslibrary}/src/main/ets/viewmodel/DateModel.ets (100%) rename {entry => customdialoggatherslibrary}/src/main/ets/viewmodel/GetDate.ets (100%) rename {entry => customdialoggatherslibrary}/src/main/ets/viewmodel/MonthDataSource.ets (100%) create mode 100644 customdialoggatherslibrary/src/main/module.json5 rename {entry => customdialoggatherslibrary}/src/main/resources/base/element/color.json (100%) rename {entry => customdialoggatherslibrary}/src/main/resources/base/element/float.json (100%) rename {entry => customdialoggatherslibrary}/src/main/resources/base/element/integer.json (100%) rename {entry => customdialoggatherslibrary}/src/main/resources/base/element/string.json (100%) rename {entry => customdialoggatherslibrary}/src/main/resources/base/media/background.png (100%) rename {entry => customdialoggatherslibrary}/src/main/resources/base/media/background_guide.png (100%) rename {entry => customdialoggatherslibrary}/src/main/resources/base/media/foreground.png (100%) rename {entry => customdialoggatherslibrary}/src/main/resources/base/media/layered_image.json (100%) rename {entry => customdialoggatherslibrary}/src/main/resources/base/media/startIcon.png (100%) create mode 100644 customdialoggatherslibrary/src/main/resources/base/profile/router_map.json rename {entry => customdialoggatherslibrary}/src/main/resources/en_US/element/string.json (100%) rename {entry => customdialoggatherslibrary}/src/main/resources/zh_CN/element/string.json (100%) rename {entry => customdialoggatherssample}/build-profile.json5 (100%) rename {entry => customdialoggatherssample}/hvigorfile.ts (100%) rename {entry => customdialoggatherssample}/obfuscation-rules.txt (100%) create mode 100644 customdialoggatherssample/oh-package.json5 rename {entry => customdialoggatherssample}/src/main/ets/entryability/EntryAbility.ets (48%) rename entry/src/main/ets/common/constants/BreakpointSystem.ets => customdialoggatherssample/src/main/ets/pages/Index.ets (59%) rename {entry => customdialoggatherssample}/src/main/module.json5 (87%) create mode 100644 customdialoggatherssample/src/main/resources/base/profile/main_pages.json delete mode 100644 entry/src/main/ets/pages/BindContentCoverDemo.ets delete mode 100644 entry/src/main/ets/pages/ScrollOption.ets delete mode 100644 entry/src/main/resources/base/profile/main_pages.json delete mode 100644 entry/src/main/resources/base/profile/router_map.json diff --git a/build-profile.json5 b/build-profile.json5 index c033ce4..554ed06 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -20,8 +20,8 @@ }, "modules": [ { - "name": "entry", - "srcPath": "./entry", + "name": "customdialoggatherssample", + "srcPath": "./customdialoggatherssample", "targets": [ { "name": "default", @@ -30,6 +30,10 @@ ] } ] + }, + { + "name": "customdialoggatherslibrary", + "srcPath": "./customdialoggatherslibrary", } ] } \ No newline at end of file diff --git a/customdialoggatherslibrary/.gitignore b/customdialoggatherslibrary/.gitignore new file mode 100644 index 0000000..e2713a2 --- /dev/null +++ b/customdialoggatherslibrary/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/customdialoggatherslibrary/Index.ets b/customdialoggatherslibrary/Index.ets new file mode 100644 index 0000000..0151ff7 --- /dev/null +++ b/customdialoggatherslibrary/Index.ets @@ -0,0 +1,2 @@ +export { CustomDialogGathersPage} from './src/main/ets/pages/CustomDialogGathersPage' +export { WindowUtil } from './src/main/ets/utils/WindowUtil'; \ No newline at end of file diff --git a/customdialoggatherslibrary/build-profile.json5 b/customdialoggatherslibrary/build-profile.json5 new file mode 100644 index 0000000..e6773f9 --- /dev/null +++ b/customdialoggatherslibrary/build-profile.json5 @@ -0,0 +1,31 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest" + } + ] +} diff --git a/customdialoggatherslibrary/consumer-rules.txt b/customdialoggatherslibrary/consumer-rules.txt new file mode 100644 index 0000000..e69de29 diff --git a/customdialoggatherslibrary/hvigorfile.ts b/customdialoggatherslibrary/hvigorfile.ts new file mode 100644 index 0000000..4218707 --- /dev/null +++ b/customdialoggatherslibrary/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/customdialoggatherslibrary/obfuscation-rules.txt b/customdialoggatherslibrary/obfuscation-rules.txt new file mode 100644 index 0000000..272efb6 --- /dev/null +++ b/customdialoggatherslibrary/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/entry/oh-package.json5 b/customdialoggatherslibrary/oh-package.json5 similarity index 57% rename from entry/oh-package.json5 rename to customdialoggatherslibrary/oh-package.json5 index 248c3b7..3545cea 100644 --- a/entry/oh-package.json5 +++ b/customdialoggatherslibrary/oh-package.json5 @@ -1,10 +1,9 @@ { - "name": "entry", + "name": "customdialoggatherslibrary", "version": "1.0.0", "description": "Please describe the basic information.", - "main": "", + "main": "Index.ets", "author": "", - "license": "", + "license": "Apache-2.0", "dependencies": {} } - diff --git a/entry/src/main/ets/common/constants/CommonConstants.ets b/customdialoggatherslibrary/src/main/ets/common/constants/CommonConstants.ets similarity index 100% rename from entry/src/main/ets/common/constants/CommonConstants.ets rename to customdialoggatherslibrary/src/main/ets/common/constants/CommonConstants.ets diff --git a/customdialoggatherslibrary/src/main/ets/pages/BindContentCoverDemo.ets b/customdialoggatherslibrary/src/main/ets/pages/BindContentCoverDemo.ets new file mode 100644 index 0000000..52b46de --- /dev/null +++ b/customdialoggatherslibrary/src/main/ets/pages/BindContentCoverDemo.ets @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonConstants } from '../common/constants/CommonConstants'; + +@Builder +export function BindContentCoverDemoBuilder() { + BindContentCoverDemo(); +} + +@Entry +@Component +struct BindContentCoverDemo { + @StorageLink('topRectHeight') topRectHeight: number = 0; + @StorageLink('bottomRectHeight') bottomRectHeight: number = 0; + @StorageLink('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; + pageInfos: NavPathStack = new NavPathStack(); + + build() { + NavDestination() { + Navigation(this.pageInfos) { + Column() { + Row() { + Text($r('app.string.confirm_order')) + .fontSize($r('sys.float.Subtitle_L')) + .fontColor($r('sys.color.font_primary')) + .width(CommonConstants.FULL_PERCENT) + .textAlign(TextAlign.Start) + .fontWeight(FontWeight.Bold) + .padding({ top: $r('sys.float.padding_level5') }) + } + .height(50) + + Row() { + Column() { + Text($r('app.string.start_time')) + .fontSize($r('sys.float.Title_S')) + .fontColor($r('sys.color.font_primary')) + .fontWeight(FontWeight.Medium) + .margin({ + bottom: $r('sys.float.padding_level2') + }) + Text($r('app.string.start_string')) + .fontSize($r('sys.float.Subtitle_S')) + .fontColor($r('sys.color.font_primary')) + } + + Column() { + Text($r('app.string.car_name')) + .fontSize($r('sys.float.Subtitle_L')) + .fontColor($r('sys.color.font_primary')) + .margin({ + bottom: $r('sys.float.padding_level2') + }) + Text($r('app.string.car_time')) + .fontSize($r('sys.float.Body_S')) + .fontColor($r('sys.color.font_tertiary')) + } + + Column() { + Text($r('app.string.end_time')) + .fontSize($r('sys.float.Title_S')) + .fontColor($r('sys.color.font_primary')) + .fontWeight(FontWeight.Medium) + .margin({ + bottom: $r('sys.float.padding_level2') + }) + Text($r('app.string.end_name')) + .fontSize($r('sys.float.Subtitle_S')) + .fontColor($r('sys.color.font_primary')) + } + } + .width(CommonConstants.FULL_PERCENT) + .height(97) + .backgroundColor($r('sys.color.comp_background_primary')) + .borderRadius($r('sys.float.corner_radius_level6')) + .justifyContent(FlexAlign.SpaceBetween) + .padding({ + right: this.curBp === 'sm' ? $r('sys.float.padding_level6') : $r('sys.float.padding_level12'), + left: this.curBp === 'sm' ? $r('sys.float.padding_level6') : $r('sys.float.padding_level12') + }) + .margin({ + bottom: $r('sys.float.padding_level6') + }) + + + Row() { + Button({ type: ButtonType.Circle }) { + SymbolGlyph($r('sys.symbol.plus')) + .fontColor([$r('sys.color.comp_background_primary')]) + .fontSize($r('sys.float.Subtitle_L')) + } + .backgroundColor($r('sys.color.brand')) + .height($r('sys.float.Title_M')) + .aspectRatio(1) + .margin({ right: $r('sys.float.padding_level4') }) + + Text($r('app.string.button_select')) + .fontColor($r('sys.color.brand')) + .fontSize($r('sys.float.Body_L')) + .fontWeight(FontWeight.Medium) + } + .onClick(() => { + this.pageInfos.replacePath({ name: 'addPassengers' }); + }) + .width(CommonConstants.FULL_PERCENT) + .height($r('app.integer.button_height')) + .alignItems(VerticalAlign.Center) + .justifyContent(FlexAlign.Center) + .backgroundColor($r('sys.color.comp_background_primary')) + .borderRadius($r('sys.float.corner_radius_level6')) + + } + .padding({ + right: this.curBp === 'lg' ? $r('sys.float.padding_level16') : $r('sys.float.padding_level8'), + left: $r('sys.float.padding_level8') + }) + } + .title($r('app.string.dialog_name')) + .mode(this.curBp === 'lg' ? NavigationMode.Split : NavigationMode.Stack) + .navBarWidth($r('app.integer.nav_bar_width')) + .titleMode(NavigationTitleMode.Mini) + .backgroundColor($r('sys.color.background_secondary')) + .padding({ + top: px2vp(this.topRectHeight), + right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), + bottom: px2vp(this.bottomRectHeight), + left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') + }) + } + .hideTitleBar(true) + .padding({top: px2vp(this.topRectHeight)}) + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/BindSheet.ets b/customdialoggatherslibrary/src/main/ets/pages/BindSheet.ets similarity index 54% rename from entry/src/main/ets/pages/BindSheet.ets rename to customdialoggatherslibrary/src/main/ets/pages/BindSheet.ets index 46ba0ca..bde530d 100644 --- a/entry/src/main/ets/pages/BindSheet.ets +++ b/customdialoggatherslibrary/src/main/ets/pages/BindSheet.ets @@ -14,9 +14,14 @@ */ import { ConfigurationConstant } from '@kit.AbilityKit'; -import { BreakpointType } from '../common/constants/BreakpointSystem'; +import { BreakpointType } from '../utils/BreakpointSystem'; import { CommonConstants } from '../common/constants/CommonConstants'; +@Builder +export function BindSheetDemoBuilder() { + BindSheetDemo(); +} + @Entry @Component struct BindSheetDemo { @@ -75,71 +80,75 @@ struct BindSheetDemo { } build() { - Navigation() { - Column() { - Text($r('app.string.tastes')) - .fontSize($r('sys.float.Subtitle_L')) - .fontColor($r('sys.color.font_primary')) - .width(CommonConstants.FULL_PERCENT) - .textAlign(TextAlign.Start) - .fontWeight(FontWeight.Bold) - .padding({ - top: $r('sys.float.padding_level16'), - bottom: $r('sys.float.padding_level4') - }) + NavDestination() { + Navigation() { Column() { - Row() { - Text($r('app.string.choose_flavors')) - .fontColor($r('sys.color.font_primary')) - .fontSize($r('sys.float.Subtitle_M')) - .fontWeight(FontWeight.Medium) - SymbolGlyph($r('sys.symbol.chevron_right')) - .fontColor([$r('sys.color.font_primary')]) - .fontSize($r('sys.float.Title_L')) + Text($r('app.string.tastes')) + .fontSize($r('sys.float.Subtitle_L')) + .fontColor($r('sys.color.font_primary')) + .width(CommonConstants.FULL_PERCENT) + .textAlign(TextAlign.Start) + .fontWeight(FontWeight.Bold) + .padding({ + top: $r('sys.float.padding_level16'), + bottom: $r('sys.float.padding_level4') + }) + Column() { + Row() { + Text($r('app.string.choose_flavors')) + .fontColor($r('sys.color.font_primary')) + .fontSize($r('sys.float.Subtitle_M')) + .fontWeight(FontWeight.Medium) + SymbolGlyph($r('sys.symbol.chevron_right')) + .fontColor([$r('sys.color.font_primary')]) + .fontSize($r('sys.float.Title_L')) + } + .alignItems(VerticalAlign.Center) + .justifyContent(FlexAlign.SpaceBetween) + .width(CommonConstants.FULL_PERCENT) + .borderRadius($r('sys.float.corner_radius_level6')) + .width(CommonConstants.FULL_PERCENT) + .padding($r('sys.float.padding_level8')) + .backgroundColor($r('sys.color.comp_background_primary')) + .bindSheet(this.isShowSheet, this.mySheet(), { + title: { title: $r('app.string.select') }, + scrollSizeMode: ScrollSizeMode.FOLLOW_DETENT, + height: new BreakpointType({sm:320,md: 560,lg: 560}).getValue(this.curBp), + width: this.curBp === 'sm' ? '100%' : $r('app.integer.bind_sheet_width'), + preferType: SheetType.CENTER, + backgroundColor: this.currentMode === ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT ? + $r('sys.color.background_secondary') : $r('sys.color.background_tertiary'), + onWillDisappear: () => { + this.isShowSheet = !this.isShowSheet; + } + }) + .onClick(() => { + this.isShowSheet = !this.isShowSheet; + }) } - .alignItems(VerticalAlign.Center) - .justifyContent(FlexAlign.SpaceBetween) .width(CommonConstants.FULL_PERCENT) - .borderRadius($r('sys.float.corner_radius_level6')) - .width(CommonConstants.FULL_PERCENT) - .padding($r('sys.float.padding_level8')) - .backgroundColor($r('sys.color.comp_background_primary')) - .bindSheet(this.isShowSheet, this.mySheet(), { - title: { title: $r('app.string.select') }, - scrollSizeMode: ScrollSizeMode.FOLLOW_DETENT, - height: new BreakpointType(320, 560, 560).GetValue(this.curBp), - width: this.curBp === 'sm' ? '100%' : $r('app.integer.bind_sheet_width'), - preferType: SheetType.CENTER, - backgroundColor: this.currentMode === ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT ? - $r('sys.color.background_secondary') : $r('sys.color.background_tertiary'), - onWillDisappear: () => { - this.isShowSheet = !this.isShowSheet; - } - }) - .onClick(() => { - this.isShowSheet = !this.isShowSheet; - }) } .width(CommonConstants.FULL_PERCENT) + .backgroundColor($r('sys.color.background_secondary')) + .padding({ + right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : + this.curBp === 'md' ? $r('sys.float.padding_level12') : $r('sys.float.padding_level16'), + left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : + this.curBp === 'md' ? $r('sys.float.padding_level12') : $r('sys.float.padding_level16') + }) } - .width(CommonConstants.FULL_PERCENT) + .title($r('app.string.bind_sheet_dialog')) + .titleMode(NavigationTitleMode.Mini) + .mode(NavigationMode.Stack) .backgroundColor($r('sys.color.background_secondary')) .padding({ - right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : - this.curBp === 'md' ? $r('sys.float.padding_level12') : $r('sys.float.padding_level16'), - left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : - this.curBp === 'md' ? $r('sys.float.padding_level12') : $r('sys.float.padding_level16') + top: px2vp(this.topRectHeight), + bottom: px2vp(this.bottomRectHeight), + left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') }) } - .title($r('app.string.bind_sheet_dialog')) - .titleMode(NavigationTitleMode.Mini) - .mode(NavigationMode.Stack) - .backgroundColor($r('sys.color.background_secondary')) - .padding({ - top: px2vp(this.topRectHeight), - bottom: px2vp(this.bottomRectHeight), - left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') - }) + .hideTitleBar(true) + .padding({top: px2vp(this.topRectHeight)}) } } diff --git a/entry/src/main/ets/pages/CustomCalendar.ets b/customdialoggatherslibrary/src/main/ets/pages/CustomCalendar.ets similarity index 85% rename from entry/src/main/ets/pages/CustomCalendar.ets rename to customdialoggatherslibrary/src/main/ets/pages/CustomCalendar.ets index 6fdad84..c673b2e 100644 --- a/entry/src/main/ets/pages/CustomCalendar.ets +++ b/customdialoggatherslibrary/src/main/ets/pages/CustomCalendar.ets @@ -18,6 +18,11 @@ import { CommonConstants } from '../common/constants/CommonConstants'; import { getRealTimeDate } from '../viewmodel/GetDate'; import { DateModel } from '../viewmodel/DateModel'; +@Builder +export function CalendarViewBuilder() { + CalendarView(); +} + @Entry @Component export struct CalendarView { @@ -115,21 +120,25 @@ export struct CalendarView { } build() { - Navigation(this.pageInfos) { - Column() { - this.calendarMainView() + NavDestination() { + Navigation(this.pageInfos) { + Column() { + this.calendarMainView() + } + .width(CommonConstants.FULL_PERCENT) + .padding($r('sys.float.padding_level8')) } - .width(CommonConstants.FULL_PERCENT) - .padding($r('sys.float.padding_level8')) + .mode(this.curBp === 'lg' ? NavigationMode.Split : NavigationMode.Stack) + .title($r('app.string.calendar_dialog')) + .titleMode(NavigationTitleMode.Mini) + .navBarWidth($r('app.integer.nav_bar_width')) + .backgroundColor($r('sys.color.background_secondary')) + .padding({ + top: px2vp(this.topRectHeight), + bottom: px2vp(this.bottomRectHeight) + }) } - .mode(this.curBp === 'lg' ? NavigationMode.Split : NavigationMode.Stack) - .title($r('app.string.calendar_dialog')) - .titleMode(NavigationTitleMode.Mini) - .navBarWidth($r('app.integer.nav_bar_width')) - .backgroundColor($r('sys.color.background_secondary')) - .padding({ - top: px2vp(this.topRectHeight), - bottom: px2vp(this.bottomRectHeight) - }) + .hideTitleBar(true) + .padding({top: px2vp(this.topRectHeight)}) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/Index.ets b/customdialoggatherslibrary/src/main/ets/pages/CustomDialogGathersPage.ets similarity index 85% rename from entry/src/main/ets/pages/Index.ets rename to customdialoggatherslibrary/src/main/ets/pages/CustomDialogGathersPage.ets index 3e5b342..c113764 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/customdialoggatherslibrary/src/main/ets/pages/CustomDialogGathersPage.ets @@ -13,26 +13,25 @@ * limitations under the License. */ -import { router } from '@kit.ArkUI'; import { CommonConstants } from '../common/constants/CommonConstants'; import { TitleModel } from '../viewmodel/DateModel'; -@Entry @Component -struct Index { +export struct CustomDialogGathersPage { @StorageLink('topRectHeight') topRectHeight: number = 0; @StorageLink('bottomRectHeight') bottomRectHeight: number = 0; @StorageLink('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; scroller: Scroller = new Scroller(); + pathStack: NavPathStack = new NavPathStack(); titleList: Array = [ - new TitleModel($r('app.string.scroll_option'), 'pages/ScrollOption'), - new TitleModel($r('app.string.dialog_name'), 'pages/BindContentCoverDemo'), - new TitleModel($r('app.string.bind_sheet_dialog'), 'pages/BindSheet'), - new TitleModel($r('app.string.toast_dialog'), 'pages/Toast'), - new TitleModel($r('app.string.toast_private_dialog'), 'pages/Privacy'), - new TitleModel($r('app.string.full_screen'), 'pages/FullScreen'), - new TitleModel($r('app.string.calendar_dialog'), 'pages/CustomCalendar'), - new TitleModel($r('app.string.two_level_dialog'), 'pages/TwoLevelPageSheet') + new TitleModel($r('app.string.scroll_option'), 'ScrollOption'), + new TitleModel($r('app.string.dialog_name'), 'BindContentCoverDemo'), + new TitleModel($r('app.string.bind_sheet_dialog'), 'BindSheet'), + new TitleModel($r('app.string.toast_dialog'), 'Toast'), + new TitleModel($r('app.string.toast_private_dialog'), 'Privacy'), + new TitleModel($r('app.string.full_screen'), 'FullScreen'), + new TitleModel($r('app.string.calendar_dialog'), 'CustomCalendar'), + new TitleModel($r('app.string.two_level_dialog'), 'TwoLevelPageSheet') ]; @Builder @@ -77,12 +76,12 @@ struct Index { left: $r('sys.float.padding_level6') }) .onClick(() => { - router.pushUrl({ url }); + this.pathStack.pushPathByName(url,null) }) } build() { - Navigation() { + Navigation(this.pathStack) { Column() { Grid() { ForEach(this.titleList, (item: TitleModel, index: number) => { diff --git a/entry/src/main/ets/pages/Details.ets b/customdialoggatherslibrary/src/main/ets/pages/Details.ets similarity index 40% rename from entry/src/main/ets/pages/Details.ets rename to customdialoggatherslibrary/src/main/ets/pages/Details.ets index 16cbd09..d290cc8 100644 --- a/entry/src/main/ets/pages/Details.ets +++ b/customdialoggatherslibrary/src/main/ets/pages/Details.ets @@ -13,53 +13,62 @@ * limitations under the License. */ -import { router } from '@kit.ArkUI'; import { CommonConstants } from '../common/constants/CommonConstants'; +@Builder +export function DetailsBuilder() { + Details(); +} + @Entry @Component struct Details { @StorageLink('topRectHeight') topRectHeight: number = 0; @StorageLink('bottomRectHeight') bottomRectHeight: number = 0; @StorageLink('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; + pathStack: NavPathStack = new NavPathStack(); build() { - Navigation() { - Column() { - Button($r('app.string.back')) - .fontSize($r('sys.float.Subtitle_M')) - .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) - .height($r('app.integer.button_height_small')) - .margin({ - bottom: $r('sys.float.padding_level6') - }) - .backgroundColor($r('sys.color.brand')) - .onClick(() => { - router.back(); - }) + NavDestination() { + Navigation(this.pathStack) { + Column() { + Button($r('app.string.back')) + .fontSize($r('sys.float.Subtitle_M')) + .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) + .height($r('app.integer.button_height_small')) + .margin({ + bottom: $r('sys.float.padding_level6') + }) + .backgroundColor($r('sys.color.brand')) + .onClick(() => { + this.pathStack.pop() + }) + } + .width(CommonConstants.FULL_PERCENT) + .height(CommonConstants.FULL_PERCENT) + .justifyContent(FlexAlign.End) + .padding({ + right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), + left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') + }) } .width(CommonConstants.FULL_PERCENT) .height(CommonConstants.FULL_PERCENT) - .justifyContent(FlexAlign.End) + .title($r('app.string.privacy_details')) + .titleMode(NavigationTitleMode.Mini) + .mode(NavigationMode.Stack) + .hideBackButton(true) + .backgroundColor($r('sys.color.background_secondary')) .padding({ - right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), - left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') + top: px2vp(this.topRectHeight), + right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), + bottom: px2vp(this.bottomRectHeight), + left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') }) } - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .title($r('app.string.privacy_details')) - .titleMode(NavigationTitleMode.Mini) - .mode(NavigationMode.Stack) - .hideBackButton(true) - .backgroundColor($r('sys.color.background_secondary')) - .padding({ - top: px2vp(this.topRectHeight), - right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), - bottom: px2vp(this.bottomRectHeight), - left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') - }) + .hideTitleBar(true) + .padding({top: px2vp(this.topRectHeight)}) } } \ No newline at end of file diff --git a/customdialoggatherslibrary/src/main/ets/pages/FullScreen.ets b/customdialoggatherslibrary/src/main/ets/pages/FullScreen.ets new file mode 100644 index 0000000..0aa3120 --- /dev/null +++ b/customdialoggatherslibrary/src/main/ets/pages/FullScreen.ets @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { curves } from '@kit.ArkUI'; +import { CommonConstants } from '../common/constants/CommonConstants'; + +@Builder +export function FullScreenBuilder() { + FullScreen(); +} + +@Entry +@Component +struct FullScreen { + private positionY: number = 0; + @State translateY: string | number = '110%'; + @StorageLink('topRectHeight') topRectHeight: number = 0; + @StorageLink('bottomRectHeight') bottomRectHeight: number = 0; + @StorageLink('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; + + build() { + NavDestination() { + Stack() { + Navigation() { + Column() { + Button($r('app.string.full_screen')) + .fontSize($r('sys.float.Subtitle_M')) + .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) + .height($r('app.integer.button_height_small')) + .margin({ bottom: $r('sys.float.padding_level6') }) + .backgroundColor($r('sys.color.brand')) + .onClick(() => { + animateTo({ + duration: CommonConstants.DURATION, + curve: Curve.Sharp + }, () => { + this.translateY = '0%'; + }); + }) + } + .height(CommonConstants.FULL_PERCENT) + .justifyContent(FlexAlign.End) + .padding({ + right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), + left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') + }) + } + .width(CommonConstants.FULL_PERCENT) + .height(CommonConstants.FULL_PERCENT) + .title($r('app.string.full_screen')) + .titleMode(NavigationTitleMode.Mini) + .mode(NavigationMode.Stack) + .backgroundColor($r('sys.color.background_secondary')) + .padding({ + top: px2vp(this.topRectHeight), + right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), + bottom: px2vp(this.bottomRectHeight), + left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') + }) + + RelativeContainer() { + Column() { + Image($r('app.media.background_guide')) + .width(this.curBp === 'sm' ? $r('app.integer.full_screen_icon_width') : + $r('app.integer.full_screen_icon_height')) + .height(this.curBp === 'sm' ? $r('app.integer.full_screen_icon_width') : + $r('app.integer.full_screen_icon_height')) + Row() { + Text($r('app.string.full_screen')) + .backgroundColor($r('sys.color.multi_color_aux_02')) + .fontColor($r('sys.color.font_on_primary')) + .fontSize($r('sys.float.Body_L')) + } + .height(21) + } + .width(CommonConstants.FULL_PERCENT) + .height(CommonConstants.FULL_PERCENT) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + + Button({ type: ButtonType.Circle }) { + SymbolGlyph($r('sys.symbol.xmark')) + .fontColor([$r('sys.color.icon_primary')]) + .fontSize($r('sys.float.Subtitle_L')) + } + .backgroundColor($r('sys.color.comp_background_tertiary')) + .height($r('app.integer.button_height_small')) + .aspectRatio(1) + .margin({ + top: px2vp(this.topRectHeight), + right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : + this.curBp === 'md' ? $r('sys.float.padding_level12') : $r('sys.float.padding_level16'), + }) + .alignRules({ + top: { anchor: '__container__', align: VerticalAlign.Top }, + right: { anchor: '__container__', align: HorizontalAlign.End } + }) + .onClick(() => { + this.closeSelf(); + }) + .id('button') + } + .width(CommonConstants.FULL_PERCENT) + .height(CommonConstants.FULL_PERCENT) + .backgroundColor($r('sys.color.multi_color_aux_02')) + .translate({ x: CommonConstants.ZERO, y: this.translateY }) + .gesture( + PanGesture({ direction: PanDirection.Vertical, distance: CommonConstants.JANUARY }) + .onActionUpdate((event?: GestureEvent) => { + this.handlePanGestureUpdate(event?.offsetY); + }) + .onActionEnd((event?: GestureEvent) => { + this.handlePanGestureEnd(event?.offsetY); + }) + ) + } + } + .hideTitleBar(true) + .padding({top: px2vp(this.topRectHeight)}) + } + + private closeSelf() { + animateTo({ + duration: CommonConstants.GRID_HEIGHT_M, + curve: Curve.Sharp, + }, () => { + this.translateY = '110%'; + }); + } + + private reset() { + animateTo({ + curve: curves.responsiveSpringMotion() + }, () => { + this.translateY = '0%'; + this.positionY = 0; + }); + } + + handlePanGestureUpdate(offsetY?: number): void { + if (!offsetY || offsetY < 0) { + return; + } + animateTo({ + curve: curves.responsiveSpringMotion() + }, () => { + this.translateY = this.positionY + offsetY; + }); + } + + handlePanGestureEnd(offsetY?: number): void { + if (!offsetY) { + return; + } + if (offsetY > 300) { + this.closeSelf(); + } else { + this.reset(); + } + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/Privacy.ets b/customdialoggatherslibrary/src/main/ets/pages/Privacy.ets similarity index 41% rename from entry/src/main/ets/pages/Privacy.ets rename to customdialoggatherslibrary/src/main/ets/pages/Privacy.ets index 4194654..01db877 100644 --- a/entry/src/main/ets/pages/Privacy.ets +++ b/customdialoggatherslibrary/src/main/ets/pages/Privacy.ets @@ -13,16 +13,21 @@ * limitations under the License. */ -import { router } from '@kit.ArkUI'; import { CommonConstants } from '../common/constants/CommonConstants'; import { hilog } from '@kit.PerformanceAnalysisKit'; +@Builder +export function PrivacyBuilder() { + Privacy(); +} + @Entry @Component struct Privacy { @StorageLink('topRectHeight') topRectHeight: number = 0; @StorageLink('bottomRectHeight') bottomRectHeight: number = 0; @StorageLink('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; + pathStack: NavPathStack = new NavPathStack(); dialogController: CustomDialogController | null = new CustomDialogController({ builder: PrivacyDialog({ cancel: () => { @@ -52,46 +57,50 @@ struct Privacy { } build() { - Navigation() { - Stack() { - Row() { - Column() { - Button($r('app.string.button_name1')) - .fontSize($r('sys.float.Subtitle_M')) - .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) - .height($r('app.integer.button_height_small')) - .margin({ - bottom: $r('sys.float.padding_level6') - }) - .backgroundColor($r('sys.color.brand')) - .onClick(() => { - if (this.dialogController !== null) { - this.dialogController.open(); - } - }) + NavDestination() { + Navigation(this.pathStack) { + Stack() { + Row() { + Column() { + Button($r('app.string.button_name1')) + .fontSize($r('sys.float.Subtitle_M')) + .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) + .height($r('app.integer.button_height_small')) + .margin({ + bottom: $r('sys.float.padding_level6') + }) + .backgroundColor($r('sys.color.brand')) + .onClick(() => { + if (this.dialogController !== null) { + this.dialogController.open(); + } + }) + } + .width(CommonConstants.FULL_PERCENT) } - .width(CommonConstants.FULL_PERCENT) + .alignItems(VerticalAlign.Bottom) + .height(CommonConstants.FULL_PERCENT) } - .alignItems(VerticalAlign.Bottom) - .height(CommonConstants.FULL_PERCENT) + .padding({ + right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), + left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') + }) } + .title($r('app.string.toast_private_dialog')) + .titleMode(NavigationTitleMode.Mini) + .mode(NavigationMode.Stack) + .backgroundColor($r('sys.color.background_secondary')) .padding({ - right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), - left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') + top: px2vp(this.topRectHeight), + right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), + bottom: px2vp(this.bottomRectHeight), + left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') }) } - .title($r('app.string.toast_private_dialog')) - .titleMode(NavigationTitleMode.Mini) - .mode(NavigationMode.Stack) - .backgroundColor($r('sys.color.background_secondary')) - .padding({ - top: px2vp(this.topRectHeight), - right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), - bottom: px2vp(this.bottomRectHeight), - left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') - }) + .hideTitleBar(true) + .padding({top: px2vp(this.topRectHeight)}) } } @@ -105,73 +114,74 @@ struct PrivacyDialog { } confirm: () => void = () => { } + pathStack: NavPathStack = new NavPathStack(); build() { - Column() { - Text($r('app.string.button_name2')) - .fontSize($r('sys.float.Subtitle_M')) - .fontWeight(FontWeight.Bold) - .padding({ - bottom: $r('sys.float.corner_radius_level8') - }) + Navigation(this.pathStack) { Column() { - Text() { - Span($r('app.string.word1')) - Span($r('app.string.toast_text')) - .fontColor($r('sys.color.font_emphasize')) - .fontWeight(FontWeight.Bold) - .decoration({ - type: TextDecorationType.Underline, - color: $r('sys.color.font_emphasize') - }) + Text($r('app.string.button_name2')) + .fontSize($r('sys.float.Subtitle_M')) + .fontWeight(FontWeight.Bold) + .padding({ + bottom: $r('sys.float.corner_radius_level8') + }) + Column() { + Text() { + Span($r('app.string.word1')) + Span($r('app.string.toast_text')) + .fontColor($r('sys.color.font_emphasize')) + .fontWeight(FontWeight.Bold) + .decoration({ + type: TextDecorationType.Underline, + color: $r('sys.color.font_emphasize') + }) + .onClick(() => { + if (this.dialogController != undefined) { + this.dialogController.close() + } + this.pathStack.pushPathByName('Details',null) + }) + Span($r('app.string.word2')) + } + .fontSize($r('sys.float.Body_L')) + } + + Row({ space: CommonConstants.SPACE_ONE }) { + Button($r('app.string.disagree'), { + stateEffect: true, + buttonStyle: ButtonStyleMode.TEXTUAL + }) + .width(CommonConstants.FORTY_PERCENT) .onClick(() => { if (this.dialogController != undefined) { this.dialogController.close() } - router.pushUrl({ - url: 'pages/Details' - }) }) - Span($r('app.string.word2')) - } - .fontSize($r('sys.float.Body_L')) - } - - Row({ space: CommonConstants.SPACE_ONE }) { - Button($r('app.string.disagree'), { - stateEffect: true, - buttonStyle: ButtonStyleMode.TEXTUAL - }) - .width(CommonConstants.FORTY_PERCENT) - .onClick(() => { - if (this.dialogController != undefined) { - this.dialogController.close() - } - }) - Divider() - .vertical(true) - .height($r('sys.float.Title_S')) - .color($r('sys.color.icon_fourth')) + Divider() + .vertical(true) + .height($r('sys.float.Title_S')) + .color($r('sys.color.icon_fourth')) - Button($r('app.string.agreed'), { - stateEffect: true, - buttonStyle: ButtonStyleMode.TEXTUAL - }) - .onClick(() => { - if (this.dialogController != undefined) { - this.dialogController.close() - } + Button($r('app.string.agreed'), { + stateEffect: true, + buttonStyle: ButtonStyleMode.TEXTUAL }) - .width(CommonConstants.FORTY_PERCENT) + .onClick(() => { + if (this.dialogController != undefined) { + this.dialogController.close() + } + }) + .width(CommonConstants.FORTY_PERCENT) + } + .justifyContent(FlexAlign.SpaceBetween) + .width(CommonConstants.FULL_PERCENT) + .margin({ top: $r('sys.float.corner_radius_level8') }) + .height($r('app.integer.button_height_small')) } - .justifyContent(FlexAlign.SpaceBetween) .width(CommonConstants.FULL_PERCENT) - .margin({ top: $r('sys.float.corner_radius_level8') }) - .height($r('app.integer.button_height_small')) + .backgroundColor($r('sys.color.comp_background_primary')) + .padding(this.curBp === 'sm' ? $r('sys.float.corner_radius_level8') : $r('sys.float.padding_level12')) } - .width(CommonConstants.FULL_PERCENT) - .backgroundColor($r('sys.color.comp_background_primary')) - .padding(this.curBp === 'sm' ? $r('sys.float.corner_radius_level8') : $r('sys.float.padding_level12')) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/FullScreen.ets b/customdialoggatherslibrary/src/main/ets/pages/ScrollOption.ets similarity index 38% rename from entry/src/main/ets/pages/FullScreen.ets rename to customdialoggatherslibrary/src/main/ets/pages/ScrollOption.ets index fd1928b..1948c90 100644 --- a/entry/src/main/ets/pages/FullScreen.ets +++ b/customdialoggatherslibrary/src/main/ets/pages/ScrollOption.ets @@ -13,47 +13,72 @@ * limitations under the License. */ -import { curves } from '@kit.ArkUI'; import { CommonConstants } from '../common/constants/CommonConstants'; +@Builder +export function ScrollOptionBuilder() { + ScrollOption(); +} + @Entry @Component -struct FullScreen { - private positionY: number = 0; - @State translateY: string | number = '110%'; +struct ScrollOption { @StorageLink('topRectHeight') topRectHeight: number = 0; @StorageLink('bottomRectHeight') bottomRectHeight: number = 0; @StorageLink('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; + private selectTime: Date = new Date('2024-4-17T18:30:00'); + @State select: number = 2; + private fruits: string[] = ['apple1', 'orange2', 'peach3', 'grape4', 'banana5']; build() { - Stack() { + NavDestination() { Navigation() { Column() { - Button($r('app.string.full_screen')) + Button($r('app.string.button_scroll_option1')) + .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) + .height($r('app.integer.button_height_small')) .fontSize($r('sys.float.Subtitle_M')) + .backgroundColor($r('sys.color.brand')) + .margin({ + bottom: $r('sys.float.padding_level6') + }) + .onClick(() => { + TimePickerDialog.show({ + selected: this.selectTime, + backgroundColor: $r('sys.color.background_primary'), + onAccept: (value: TimePickerResult) => { + this.selectTime.setHours(value.hour, value.minute); + } + }) + }) + Button($r('app.string.button_scroll_option2')) .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) .height($r('app.integer.button_height_small')) - .margin({ bottom: $r('sys.float.padding_level6') }) + .fontSize($r('sys.float.Subtitle_M')) .backgroundColor($r('sys.color.brand')) + .margin({ + bottom: $r('sys.float.padding_level6') + }) .onClick(() => { - animateTo({ - duration: CommonConstants.DURATION, - curve: Curve.Sharp - }, () => { - this.translateY = '0%'; - }); + TextPickerDialog.show({ + range: this.fruits, + selected: this.select, + backgroundColor: $r('sys.color.background_primary'), + onAccept: (value: TextPickerResult) => { + this.select = value.index as number; + } + }) }) } - .height(CommonConstants.FULL_PERCENT) .justifyContent(FlexAlign.End) + .width(CommonConstants.FULL_PERCENT) + .height(CommonConstants.FULL_PERCENT) .padding({ right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') }) } - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .title($r('app.string.full_screen')) + .title($r('app.string.scroll_option')) .titleMode(NavigationTitleMode.Mini) .mode(NavigationMode.Stack) .backgroundColor($r('sys.color.background_secondary')) @@ -65,102 +90,8 @@ struct FullScreen { left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') }) - - RelativeContainer() { - Column() { - Image($r('app.media.background_guide')) - .width(this.curBp === 'sm' ? $r('app.integer.full_screen_icon_width') : - $r('app.integer.full_screen_icon_height')) - .height(this.curBp === 'sm' ? $r('app.integer.full_screen_icon_width') : - $r('app.integer.full_screen_icon_height')) - Row() { - Text($r('app.string.full_screen')) - .backgroundColor($r('sys.color.multi_color_aux_02')) - .fontColor($r('sys.color.font_on_primary')) - .fontSize($r('sys.float.Body_L')) - } - .height(21) - } - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .alignItems(HorizontalAlign.Center) - .justifyContent(FlexAlign.Center) - - Button({ type: ButtonType.Circle }) { - SymbolGlyph($r('sys.symbol.xmark')) - .fontColor([$r('sys.color.icon_primary')]) - .fontSize($r('sys.float.Subtitle_L')) - } - .backgroundColor($r('sys.color.comp_background_tertiary')) - .height($r('app.integer.button_height_small')) - .aspectRatio(1) - .margin({ - top: px2vp(this.topRectHeight), - right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : - this.curBp === 'md' ? $r('sys.float.padding_level12') : $r('sys.float.padding_level16'), - }) - .alignRules({ - top: { anchor: '__container__', align: VerticalAlign.Top }, - right: { anchor: '__container__', align: HorizontalAlign.End } - }) - .onClick(() => { - this.closeSelf(); - }) - .id('button') - } - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .backgroundColor($r('sys.color.multi_color_aux_02')) - .translate({ x: CommonConstants.ZERO, y: this.translateY }) - .gesture( - PanGesture({ direction: PanDirection.Vertical, distance: CommonConstants.JANUARY }) - .onActionUpdate((event?: GestureEvent) => { - this.handlePanGestureUpdate(event?.offsetY); - }) - .onActionEnd((event?: GestureEvent) => { - this.handlePanGestureEnd(event?.offsetY); - }) - ) - } - } - - private closeSelf() { - animateTo({ - duration: CommonConstants.GRID_HEIGHT_M, - curve: Curve.Sharp, - }, () => { - this.translateY = '110%'; - }); - } - - private reset() { - animateTo({ - curve: curves.responsiveSpringMotion() - }, () => { - this.translateY = '0%'; - this.positionY = 0; - }); - } - - handlePanGestureUpdate(offsetY?: number): void { - if (!offsetY || offsetY < 0) { - return; - } - animateTo({ - curve: curves.responsiveSpringMotion() - }, () => { - this.translateY = this.positionY + offsetY; - }); - } - - handlePanGestureEnd(offsetY?: number): void { - if (!offsetY) { - return; - } - if (offsetY > 300) { - this.closeSelf(); - } else { - this.reset(); } + .hideTitleBar(true) + .padding({top: px2vp(this.topRectHeight)}) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/Toast.ets b/customdialoggatherslibrary/src/main/ets/pages/Toast.ets similarity index 57% rename from entry/src/main/ets/pages/Toast.ets rename to customdialoggatherslibrary/src/main/ets/pages/Toast.ets index 7a8b021..1dd4a28 100644 --- a/entry/src/main/ets/pages/Toast.ets +++ b/customdialoggatherslibrary/src/main/ets/pages/Toast.ets @@ -15,6 +15,11 @@ import { CommonConstants } from '../common/constants/CommonConstants'; +@Builder +export function CustomDialogUserBuilder() { + CustomDialogUser(); +} + @CustomDialog struct CustomDialogExample { controller?: CustomDialogController; @@ -68,44 +73,48 @@ struct CustomDialogUser { } build() { - Navigation() { - Column() { - Button(this.inputValue) - .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) - .height($r('app.integer.button_height_small')) - .fontSize($r('sys.float.Subtitle_M')) - .backgroundColor($r('sys.color.brand')) - .margin({ - bottom: $r('sys.float.padding_level6') - }) - .onClick(() => { - if (this.dialogController != null) { - this.dialogController.open(); - setTimeout(() => { - this.dialogController?.close(); - }, 3000) - } - }) + NavDestination() { + Navigation() { + Column() { + Button(this.inputValue) + .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) + .height($r('app.integer.button_height_small')) + .fontSize($r('sys.float.Subtitle_M')) + .backgroundColor($r('sys.color.brand')) + .margin({ + bottom: $r('sys.float.padding_level6') + }) + .onClick(() => { + if (this.dialogController != null) { + this.dialogController.open(); + setTimeout(() => { + this.dialogController?.close(); + }, 3000) + } + }) + } + .height(CommonConstants.FULL_PERCENT) + .width(CommonConstants.FULL_PERCENT) + .justifyContent(FlexAlign.End) + .padding({ + right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), + left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') + }) } - .height(CommonConstants.FULL_PERCENT) - .width(CommonConstants.FULL_PERCENT) - .justifyContent(FlexAlign.End) + .title($r('app.string.toast_dialog')) + .titleMode(NavigationTitleMode.Mini) + .mode(NavigationMode.Stack) + .backgroundColor($r('sys.color.background_secondary')) .padding({ - right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), - left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') + top: px2vp(this.topRectHeight), + right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), + bottom: px2vp(this.bottomRectHeight), + left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') }) } - .title($r('app.string.toast_dialog')) - .titleMode(NavigationTitleMode.Mini) - .mode(NavigationMode.Stack) - .backgroundColor($r('sys.color.background_secondary')) - .padding({ - top: px2vp(this.topRectHeight), - right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), - bottom: px2vp(this.bottomRectHeight), - left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') - }) + .hideTitleBar(true) + .padding({top: px2vp(this.topRectHeight)}) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/TwoLevelPageSheet.ets b/customdialoggatherslibrary/src/main/ets/pages/TwoLevelPageSheet.ets similarity index 68% rename from entry/src/main/ets/pages/TwoLevelPageSheet.ets rename to customdialoggatherslibrary/src/main/ets/pages/TwoLevelPageSheet.ets index af113b2..ab9f7c9 100644 --- a/entry/src/main/ets/pages/TwoLevelPageSheet.ets +++ b/customdialoggatherslibrary/src/main/ets/pages/TwoLevelPageSheet.ets @@ -15,6 +15,11 @@ import { CommonConstants } from '../common/constants/CommonConstants'; +@Builder +export function TwoLevelPageSheetBuilder() { + TwoLevelPageSheet(); +} + @Entry @Component struct TwoLevelPageSheet { @@ -111,46 +116,50 @@ struct TwoLevelPageSheet { } build() { - Navigation() { - Column() { - Button($r('app.string.button_one')) - .onClick(() => { - this.isShow = true; - }) - .fontSize($r('sys.float.Subtitle_M')) - .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) - .height($r('app.integer.button_height_small')) - .margin({ bottom: $r('sys.float.padding_level6') }) - .backgroundColor($r('sys.color.brand')) - .bindSheet(this.isShow, this.bindSheetBuilder(), { - height: this.sheetHeight, - dragBar: this.showDragBar, - preferType: SheetType.CENTER, - backgroundColor: $r('sys.color.comp_background_primary'), - onWillDisappear: () => { - this.isShow = false; - } - }) + NavDestination() { + Navigation() { + Column() { + Button($r('app.string.button_one')) + .onClick(() => { + this.isShow = true; + }) + .fontSize($r('sys.float.Subtitle_M')) + .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) + .height($r('app.integer.button_height_small')) + .margin({ bottom: $r('sys.float.padding_level6') }) + .backgroundColor($r('sys.color.brand')) + .bindSheet(this.isShow, this.bindSheetBuilder(), { + height: this.sheetHeight, + dragBar: this.showDragBar, + preferType: SheetType.CENTER, + backgroundColor: $r('sys.color.comp_background_primary'), + onWillDisappear: () => { + this.isShow = false; + } + }) + } + .width(CommonConstants.FULL_PERCENT) + .height(CommonConstants.FULL_PERCENT) + .justifyContent(FlexAlign.End) + .padding({ + right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), + left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') + }) } - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .justifyContent(FlexAlign.End) + .title($r('app.string.two_level_dialog')) + .titleMode(NavigationTitleMode.Mini) + .mode(NavigationMode.Stack) + .backgroundColor($r('sys.color.background_secondary')) .padding({ - right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), - left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') + top: px2vp(this.topRectHeight), + right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), + bottom: px2vp(this.bottomRectHeight), + left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : + this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') }) } - .title($r('app.string.two_level_dialog')) - .titleMode(NavigationTitleMode.Mini) - .mode(NavigationMode.Stack) - .backgroundColor($r('sys.color.background_secondary')) - .padding({ - top: px2vp(this.topRectHeight), - right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), - bottom: px2vp(this.bottomRectHeight), - left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') - }) + .hideTitleBar(true) + .padding({top: px2vp(this.topRectHeight)}) } } \ No newline at end of file diff --git a/customdialoggatherslibrary/src/main/ets/utils/BreakpointSystem.ets b/customdialoggatherslibrary/src/main/ets/utils/BreakpointSystem.ets new file mode 100644 index 0000000..aa7581b --- /dev/null +++ b/customdialoggatherslibrary/src/main/ets/utils/BreakpointSystem.ets @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { window } from '@kit.ArkUI'; +import type { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const TAG: string = '[BreakpointSystem]'; + +export enum BreakpointTypeEnum { + XS = 'xs', + SM = 'sm', + MD = 'md', + LG = 'lg', + XL = 'xl', +} + +export interface BreakpointTypes { + xs?: T; + sm: T; + md: T; + lg: T; + xl?: T; +} + +export class BreakpointType { + private xs: T; + private sm: T; + private md: T; + private lg: T; + private xl: T; + + public constructor(param: BreakpointTypes) { + this.xs = param.xs || param.sm; + this.sm = param.sm; + this.md = param.md; + this.lg = param.lg; + this.xl = param.xl || param.lg; + } + + public getValue(currentBreakpoint: string): T { + if (currentBreakpoint === BreakpointTypeEnum.XS) { + return this.xs; + } + if (currentBreakpoint === BreakpointTypeEnum.SM) { + return this.sm; + } + if (currentBreakpoint === BreakpointTypeEnum.MD) { + return this.md; + } + if (currentBreakpoint === BreakpointTypeEnum.XL) { + return this.xl; + } + return this.lg; + } +} + +export class BreakpointSystem { + private static instance: BreakpointSystem; + private currentBreakpoint: BreakpointTypeEnum = BreakpointTypeEnum.MD; + + private constructor() { + } + + public static getInstance(): BreakpointSystem { + if (!BreakpointSystem.instance) { + BreakpointSystem.instance = new BreakpointSystem(); + } + return BreakpointSystem.instance; + } + + public updateCurrentBreakpoint(breakpoint: BreakpointTypeEnum): void { + if (this.currentBreakpoint !== breakpoint) { + this.currentBreakpoint = breakpoint; + AppStorage.setOrCreate('currentBreakpoint', this.currentBreakpoint); + } + } + + public onWindowSizeChange(window: window.Window): void { + this.updateWidthBp(window); + } + + public updateWidthBp(window: window.Window): void { + try { + const mainWindow: window.WindowProperties = window.getWindowProperties(); + const windowWidth: number = mainWindow.windowRect.width; + const windowWidthVp = px2vp(windowWidth); + let widthBp: BreakpointTypeEnum = BreakpointTypeEnum.MD; + if (windowWidthVp < 320) { + widthBp = BreakpointTypeEnum.XS; + } else if (windowWidthVp >= 320 && windowWidthVp < 600) { + widthBp = BreakpointTypeEnum.SM; + } else if (windowWidthVp >= 600 && windowWidthVp < 840) { + widthBp = BreakpointTypeEnum.MD; + } else if (windowWidthVp >= 840 && windowWidthVp < 1440) { + widthBp = BreakpointTypeEnum.LG; + } else { + widthBp = BreakpointTypeEnum.XL; + } + this.updateCurrentBreakpoint(widthBp); + } catch (error) { + const err: BusinessError = error as BusinessError; + hilog.error(0x0000, TAG, `UpdateBreakpoint fail, error code: ${err.code}, message: ${err.message}`); + } + } +} \ No newline at end of file diff --git a/customdialoggatherslibrary/src/main/ets/utils/WindowUtil.ets b/customdialoggatherslibrary/src/main/ets/utils/WindowUtil.ets new file mode 100644 index 0000000..615138a --- /dev/null +++ b/customdialoggatherslibrary/src/main/ets/utils/WindowUtil.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { window } from '@kit.ArkUI'; +import type { BusinessError } from '@kit.BasicServicesKit'; +import { BreakpointSystem } from './BreakpointSystem'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { ConfigurationConstant ,Configuration} from '@kit.AbilityKit'; + +const TAG: string = '[WindowUtil]'; + +export class WindowUtil { + public static requestFullScreen(windowStage: window.WindowStage): void { + windowStage.getMainWindow((err: BusinessError, data: window.Window) => { + if (err.code) { + return; + } + const windowClass: window.Window = data; + // Realize the immersive effect. + try { + const promise: Promise = windowClass.setWindowLayoutFullScreen(true); + promise.then(() => { + hilog.info(0x0000, TAG, 'Succeeded in setting the window layout to full-screen mode.'); + }).catch((err: BusinessError) => { + hilog.info(0x0000, TAG, + `Failed to set the window layout to full-screen mode. Cause: ${err.code}, ${err.message}`); + }); + } catch { + hilog.error(0x0000, TAG, 'Failed to set the window layout to full-screen mode. '); + } + }); + } + + public static registerBreakPoint(windowStage: window.WindowStage) { + windowStage.getMainWindow((err: BusinessError, data: window.Window) => { + if (err.code) { + hilog.error(0x0000, TAG, `Failed to get main window: ${err.message}`); + return; + } + BreakpointSystem.getInstance().updateWidthBp(data); + data.on('windowSizeChange', () => BreakpointSystem.getInstance().onWindowSizeChange(data)); + data.on('avoidAreaChange', (avoidAreaOption) => { + if (avoidAreaOption.type === window.AvoidAreaType.TYPE_SYSTEM || + avoidAreaOption.type === window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR) { + WindowUtil.setAvoidArea(avoidAreaOption.type, avoidAreaOption.area); + } + }); + }) + } + + // Get status bar height and indicator height. + public static setAvoidArea(type: window.AvoidAreaType, area: window.AvoidArea) { + if (type === window.AvoidAreaType.TYPE_SYSTEM) { + AppStorage.setOrCreate('topRectHeight', px2vp(area.topRect.height)); + } else { + AppStorage.setOrCreate('bottomRectHeight', px2vp(area.bottomRect.height)); + } + } + + public static updatedColorMode(newConfig: Configuration): void { + let newColorMode: ConfigurationConstant.ColorMode = + newConfig.colorMode || ConfigurationConstant.ColorMode.COLOR_MODE_DARK; + let currentColorMode = AppStorage.get('systemColorMode'); + if (newColorMode !== currentColorMode) { + AppStorage.setOrCreate('systemColorMode', newColorMode); + } + } +} \ No newline at end of file diff --git a/entry/src/main/ets/view/AddPassengers.ets b/customdialoggatherslibrary/src/main/ets/view/AddPassengers.ets similarity index 100% rename from entry/src/main/ets/view/AddPassengers.ets rename to customdialoggatherslibrary/src/main/ets/view/AddPassengers.ets diff --git a/entry/src/main/ets/view/CustomCalendarPickerDialog.ets b/customdialoggatherslibrary/src/main/ets/view/CustomCalendarPickerDialog.ets similarity index 100% rename from entry/src/main/ets/view/CustomCalendarPickerDialog.ets rename to customdialoggatherslibrary/src/main/ets/view/CustomCalendarPickerDialog.ets diff --git a/entry/src/main/ets/view/DefaultList.ets b/customdialoggatherslibrary/src/main/ets/view/DefaultList.ets similarity index 100% rename from entry/src/main/ets/view/DefaultList.ets rename to customdialoggatherslibrary/src/main/ets/view/DefaultList.ets diff --git a/entry/src/main/ets/viewmodel/BindContentModel.ets b/customdialoggatherslibrary/src/main/ets/viewmodel/BindContentModel.ets similarity index 100% rename from entry/src/main/ets/viewmodel/BindContentModel.ets rename to customdialoggatherslibrary/src/main/ets/viewmodel/BindContentModel.ets diff --git a/entry/src/main/ets/viewmodel/DataManager.ets b/customdialoggatherslibrary/src/main/ets/viewmodel/DataManager.ets similarity index 100% rename from entry/src/main/ets/viewmodel/DataManager.ets rename to customdialoggatherslibrary/src/main/ets/viewmodel/DataManager.ets diff --git a/entry/src/main/ets/viewmodel/DateModel.ets b/customdialoggatherslibrary/src/main/ets/viewmodel/DateModel.ets similarity index 100% rename from entry/src/main/ets/viewmodel/DateModel.ets rename to customdialoggatherslibrary/src/main/ets/viewmodel/DateModel.ets diff --git a/entry/src/main/ets/viewmodel/GetDate.ets b/customdialoggatherslibrary/src/main/ets/viewmodel/GetDate.ets similarity index 100% rename from entry/src/main/ets/viewmodel/GetDate.ets rename to customdialoggatherslibrary/src/main/ets/viewmodel/GetDate.ets diff --git a/entry/src/main/ets/viewmodel/MonthDataSource.ets b/customdialoggatherslibrary/src/main/ets/viewmodel/MonthDataSource.ets similarity index 100% rename from entry/src/main/ets/viewmodel/MonthDataSource.ets rename to customdialoggatherslibrary/src/main/ets/viewmodel/MonthDataSource.ets diff --git a/customdialoggatherslibrary/src/main/module.json5 b/customdialoggatherslibrary/src/main/module.json5 new file mode 100644 index 0000000..8d0a5ec --- /dev/null +++ b/customdialoggatherslibrary/src/main/module.json5 @@ -0,0 +1,12 @@ +{ + "module": { + "name": "customdialoggatherslibrary", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "2in1" + ], + "routerMap": "$profile:router_map" + } +} diff --git a/entry/src/main/resources/base/element/color.json b/customdialoggatherslibrary/src/main/resources/base/element/color.json similarity index 100% rename from entry/src/main/resources/base/element/color.json rename to customdialoggatherslibrary/src/main/resources/base/element/color.json diff --git a/entry/src/main/resources/base/element/float.json b/customdialoggatherslibrary/src/main/resources/base/element/float.json similarity index 100% rename from entry/src/main/resources/base/element/float.json rename to customdialoggatherslibrary/src/main/resources/base/element/float.json diff --git a/entry/src/main/resources/base/element/integer.json b/customdialoggatherslibrary/src/main/resources/base/element/integer.json similarity index 100% rename from entry/src/main/resources/base/element/integer.json rename to customdialoggatherslibrary/src/main/resources/base/element/integer.json diff --git a/entry/src/main/resources/base/element/string.json b/customdialoggatherslibrary/src/main/resources/base/element/string.json similarity index 100% rename from entry/src/main/resources/base/element/string.json rename to customdialoggatherslibrary/src/main/resources/base/element/string.json diff --git a/entry/src/main/resources/base/media/background.png b/customdialoggatherslibrary/src/main/resources/base/media/background.png similarity index 100% rename from entry/src/main/resources/base/media/background.png rename to customdialoggatherslibrary/src/main/resources/base/media/background.png diff --git a/entry/src/main/resources/base/media/background_guide.png b/customdialoggatherslibrary/src/main/resources/base/media/background_guide.png similarity index 100% rename from entry/src/main/resources/base/media/background_guide.png rename to customdialoggatherslibrary/src/main/resources/base/media/background_guide.png diff --git a/entry/src/main/resources/base/media/foreground.png b/customdialoggatherslibrary/src/main/resources/base/media/foreground.png similarity index 100% rename from entry/src/main/resources/base/media/foreground.png rename to customdialoggatherslibrary/src/main/resources/base/media/foreground.png diff --git a/entry/src/main/resources/base/media/layered_image.json b/customdialoggatherslibrary/src/main/resources/base/media/layered_image.json similarity index 100% rename from entry/src/main/resources/base/media/layered_image.json rename to customdialoggatherslibrary/src/main/resources/base/media/layered_image.json diff --git a/entry/src/main/resources/base/media/startIcon.png b/customdialoggatherslibrary/src/main/resources/base/media/startIcon.png similarity index 100% rename from entry/src/main/resources/base/media/startIcon.png rename to customdialoggatherslibrary/src/main/resources/base/media/startIcon.png diff --git a/customdialoggatherslibrary/src/main/resources/base/profile/router_map.json b/customdialoggatherslibrary/src/main/resources/base/profile/router_map.json new file mode 100644 index 0000000..2e0ce77 --- /dev/null +++ b/customdialoggatherslibrary/src/main/resources/base/profile/router_map.json @@ -0,0 +1,59 @@ +{ + "routerMap": [ + { + "name": "BindContentCoverDemo", + "pageSourceFile": "src/main/ets/pages/BindContentCoverDemo.ets", + "buildFunction": "BindContentCoverDemoBuilder" + }, + { + "name": "BindSheet", + "pageSourceFile": "src/main/ets/pages/BindSheet.ets", + "buildFunction": "BindSheetDemoBuilder" + }, + { + "name": "CustomCalendar", + "pageSourceFile": "src/main/ets/pages/CustomCalendar.ets", + "buildFunction": "CalendarViewBuilder" + }, + { + "name": "Details", + "pageSourceFile": "src/main/ets/pages/Details.ets", + "buildFunction": "DetailsBuilder" + }, + { + "name": "FullScreen", + "pageSourceFile": "src/main/ets/pages/FullScreen.ets", + "buildFunction": "FullScreenBuilder" + }, + { + "name": "Privacy", + "pageSourceFile": "src/main/ets/pages/Privacy.ets", + "buildFunction": "PrivacyBuilder" + }, + { + "name": "ScrollOption", + "pageSourceFile": "src/main/ets/pages/ScrollOption.ets", + "buildFunction": "ScrollOptionBuilder" + }, + { + "name": "Toast", + "pageSourceFile": "src/main/ets/pages/Toast.ets", + "buildFunction": "CustomDialogUserBuilder" + }, + { + "name": "TwoLevelPageSheet", + "pageSourceFile": "src/main/ets/pages/TwoLevelPageSheet.ets", + "buildFunction": "TwoLevelPageSheetBuilder" + }, + { + "name": "addPassengers", + "pageSourceFile": "src/main/ets/view/AddPassengers.ets", + "buildFunction": "AddPassengersBuilder" + }, + { + "name": "defaultList", + "pageSourceFile": "src/main/ets/view/DefaultList.ets", + "buildFunction": "DefaultListBuilder" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/customdialoggatherslibrary/src/main/resources/en_US/element/string.json similarity index 100% rename from entry/src/main/resources/en_US/element/string.json rename to customdialoggatherslibrary/src/main/resources/en_US/element/string.json diff --git a/entry/src/main/resources/zh_CN/element/string.json b/customdialoggatherslibrary/src/main/resources/zh_CN/element/string.json similarity index 100% rename from entry/src/main/resources/zh_CN/element/string.json rename to customdialoggatherslibrary/src/main/resources/zh_CN/element/string.json diff --git a/entry/build-profile.json5 b/customdialoggatherssample/build-profile.json5 similarity index 100% rename from entry/build-profile.json5 rename to customdialoggatherssample/build-profile.json5 diff --git a/entry/hvigorfile.ts b/customdialoggatherssample/hvigorfile.ts similarity index 100% rename from entry/hvigorfile.ts rename to customdialoggatherssample/hvigorfile.ts diff --git a/entry/obfuscation-rules.txt b/customdialoggatherssample/obfuscation-rules.txt similarity index 100% rename from entry/obfuscation-rules.txt rename to customdialoggatherssample/obfuscation-rules.txt diff --git a/customdialoggatherssample/oh-package.json5 b/customdialoggatherssample/oh-package.json5 new file mode 100644 index 0000000..b2a3dc0 --- /dev/null +++ b/customdialoggatherssample/oh-package.json5 @@ -0,0 +1,11 @@ +{ + "name": "customdialoggatherssample", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": { + "customdialoggatherslibrary": "file:../customdialoggatherslibrary" + } +} \ No newline at end of file diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/customdialoggatherssample/src/main/ets/entryability/EntryAbility.ets similarity index 48% rename from entry/src/main/ets/entryability/EntryAbility.ets rename to customdialoggatherssample/src/main/ets/entryability/EntryAbility.ets index e8e5d84..96b4490 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/customdialoggatherssample/src/main/ets/entryability/EntryAbility.ets @@ -14,36 +14,13 @@ */ import { Configuration, ConfigurationConstant, UIAbility } from '@kit.AbilityKit'; -import { display, window } from '@kit.ArkUI'; +import { window } from '@kit.ArkUI'; import { hilog } from '@kit.PerformanceAnalysisKit'; -import { BusinessError } from '@kit.BasicServicesKit'; import { resourceManager } from '@kit.LocalizationKit'; +import { WindowUtil } from 'customdialoggatherslibrary/src/main/ets/utils/WindowUtil' -export default class EntryAbility extends UIAbility { - private windowObj?: window.Window; - private curBp: string = ''; - - private updateBreakpoint(windowWidth: number): void { - try { - let windowWidthVp = windowWidth / display.getDefaultDisplaySync().densityPixels; - let newBp: string = ''; - if (windowWidthVp < 600) { - newBp = 'sm'; - } else if (windowWidthVp < 840) { - newBp = 'md'; - } else { - newBp = 'lg'; - } - if (this.curBp !== newBp) { - this.curBp = newBp; - AppStorage.setOrCreate('currentBreakpoint', this.curBp); - } - } catch (error) { - const err = error as BusinessError; - hilog.error(0x0000, 'EntryAbility', `updateBreakpoint catch err, code: ${err.code}, message: ${err.message}`); - } - } +export default class EntryAbility extends UIAbility { onCreate(): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); AppStorage.setOrCreate('systemColorMode', this.context.config.colorMode); @@ -51,12 +28,7 @@ export default class EntryAbility extends UIAbility { } onConfigurationUpdate(newConfig: Configuration): void { - let newColorMode: ConfigurationConstant.ColorMode = - newConfig.colorMode || ConfigurationConstant.ColorMode.COLOR_MODE_DARK; - let currentColorMode = AppStorage.get('systemColorMode'); - if (newColorMode !== currentColorMode) { - AppStorage.setOrCreate('systemColorMode', newColorMode); - } + WindowUtil.updatedColorMode(newConfig) } onDestroy(): void { @@ -64,35 +36,8 @@ export default class EntryAbility extends UIAbility { } onWindowStageCreate(windowStage: window.WindowStage): void { - windowStage.getMainWindow().then((windowObj: window.Window) => { - try { - let avoidArea = windowObj.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR); - let bottomRectHeight = avoidArea.bottomRect.height; - AppStorage.setOrCreate('bottomRectHeight', bottomRectHeight); - avoidArea = windowObj.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM); - let topRectHeight = avoidArea.topRect.height; - AppStorage.setOrCreate('topRectHeight', topRectHeight); - this.windowObj = windowObj; - this.updateBreakpoint(windowObj.getWindowProperties().windowRect.width); - - windowObj.setWindowLayoutFullScreen(true).then(() => { - hilog.info(0x0000, 'testTag', '%{public}s', 'Succeeded in setting the window layout to full-screen mode.'); - }).catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag', - `Failed to set the window layout to full-screen mode, err code: ${err.code}, message: ${err.message}}`); - }); - - windowObj.on('windowSizeChange', (windowSize) => { - this.updateBreakpoint(windowSize.width); - }); - } catch (error) { - const err = error as BusinessError; - hilog.error(0x000, '[EntryAbility]', - `onWindowStageCreate catch err, code: ${err.code}, message:${err.message}`); - } - }).catch((err: BusinessError) => { - hilog.error(0x0000, 'testTag', `Failed to get main window. Cause:`, err.message); - }); + WindowUtil.requestFullScreen(windowStage) + WindowUtil.registerBreakPoint(windowStage) // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); let context = this.context; diff --git a/entry/src/main/ets/common/constants/BreakpointSystem.ets b/customdialoggatherssample/src/main/ets/pages/Index.ets similarity index 59% rename from entry/src/main/ets/common/constants/BreakpointSystem.ets rename to customdialoggatherssample/src/main/ets/pages/Index.ets index fd4b4fc..71f36b3 100644 --- a/entry/src/main/ets/common/constants/BreakpointSystem.ets +++ b/customdialoggatherssample/src/main/ets/pages/Index.ets @@ -13,27 +13,14 @@ * limitations under the License. */ -export class BreakpointType { - public sm: T - public md: T - public lg: T +import { CustomDialogGathersPage } from 'customdialoggatherslibrary' - constructor(sm: T, md: T, lg: T) { - this.sm = sm; - this.md = md; - this.lg = lg; - } - - GetValue(currentBreakpoint: string) { - if (currentBreakpoint === 'sm') { - return this.sm; - } - if (currentBreakpoint === 'md') { - return this.md; - } - if (currentBreakpoint === 'lg') { - return this.lg; +@Entry +@Component +struct Index { + build() { + Stack(){ + CustomDialogGathersPage() } - return undefined; } } \ No newline at end of file diff --git a/entry/src/main/module.json5 b/customdialoggatherssample/src/main/module.json5 similarity index 87% rename from entry/src/main/module.json5 rename to customdialoggatherssample/src/main/module.json5 index dcae23d..d1f3144 100644 --- a/entry/src/main/module.json5 +++ b/customdialoggatherssample/src/main/module.json5 @@ -1,6 +1,6 @@ { "module": { - "name": "entry", + "name": "customdialoggatherssample", "type": "entry", "description": "$string:module_desc", "mainElement": "EntryAbility", @@ -9,20 +9,19 @@ "tablet", "2in1" ], - "routerMap": "$profile:router_map", "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", "abilities": [ { - "name": "EntryAbility", + "name": "CustomDialogGathersSampleAbility", "srcEntry": "./ets/entryability/EntryAbility.ets", "description": "$string:EntryAbility_desc", "icon": "$media:layered_image", "label": "$string:EntryAbility_label", "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", - "exported": false, + "exported": true, "skills": [ { "entities": [ diff --git a/customdialoggatherssample/src/main/resources/base/profile/main_pages.json b/customdialoggatherssample/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000..55c3f00 --- /dev/null +++ b/customdialoggatherssample/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/BindContentCoverDemo.ets b/entry/src/main/ets/pages/BindContentCoverDemo.ets deleted file mode 100644 index 20fba93..0000000 --- a/entry/src/main/ets/pages/BindContentCoverDemo.ets +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { CommonConstants } from '../common/constants/CommonConstants'; - -@Entry -@Component -struct BindContentCoverDemo { - @StorageLink('topRectHeight') topRectHeight: number = 0; - @StorageLink('bottomRectHeight') bottomRectHeight: number = 0; - @StorageLink('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; - pageInfos: NavPathStack = new NavPathStack(); - - build() { - Navigation(this.pageInfos) { - Column() { - Row() { - Text($r('app.string.confirm_order')) - .fontSize($r('sys.float.Subtitle_L')) - .fontColor($r('sys.color.font_primary')) - .width(CommonConstants.FULL_PERCENT) - .textAlign(TextAlign.Start) - .fontWeight(FontWeight.Bold) - .padding({ top: $r('sys.float.padding_level5') }) - } - .height(50) - - Row() { - Column() { - Text($r('app.string.start_time')) - .fontSize($r('sys.float.Title_S')) - .fontColor($r('sys.color.font_primary')) - .fontWeight(FontWeight.Medium) - .margin({ - bottom: $r('sys.float.padding_level2') - }) - Text($r('app.string.start_string')) - .fontSize($r('sys.float.Subtitle_S')) - .fontColor($r('sys.color.font_primary')) - } - - Column() { - Text($r('app.string.car_name')) - .fontSize($r('sys.float.Subtitle_L')) - .fontColor($r('sys.color.font_primary')) - .margin({ - bottom: $r('sys.float.padding_level2') - }) - Text($r('app.string.car_time')) - .fontSize($r('sys.float.Body_S')) - .fontColor($r('sys.color.font_tertiary')) - } - - Column() { - Text($r('app.string.end_time')) - .fontSize($r('sys.float.Title_S')) - .fontColor($r('sys.color.font_primary')) - .fontWeight(FontWeight.Medium) - .margin({ - bottom: $r('sys.float.padding_level2') - }) - Text($r('app.string.end_name')) - .fontSize($r('sys.float.Subtitle_S')) - .fontColor($r('sys.color.font_primary')) - } - } - .width(CommonConstants.FULL_PERCENT) - .height(97) - .backgroundColor($r('sys.color.comp_background_primary')) - .borderRadius($r('sys.float.corner_radius_level6')) - .justifyContent(FlexAlign.SpaceBetween) - .padding({ - right: this.curBp === 'sm' ? $r('sys.float.padding_level6') : $r('sys.float.padding_level12'), - left: this.curBp === 'sm' ? $r('sys.float.padding_level6') : $r('sys.float.padding_level12') - }) - .margin({ - bottom: $r('sys.float.padding_level6') - }) - - - Row() { - Button({ type: ButtonType.Circle }) { - SymbolGlyph($r('sys.symbol.plus')) - .fontColor([$r('sys.color.comp_background_primary')]) - .fontSize($r('sys.float.Subtitle_L')) - } - .backgroundColor($r('sys.color.brand')) - .height($r('sys.float.Title_M')) - .aspectRatio(1) - .margin({ right: $r('sys.float.padding_level4') }) - - Text($r('app.string.button_select')) - .fontColor($r('sys.color.brand')) - .fontSize($r('sys.float.Body_L')) - .fontWeight(FontWeight.Medium) - } - .onClick(() => { - this.pageInfos.replacePath({ name: 'addPassengers' }); - }) - .width(CommonConstants.FULL_PERCENT) - .height($r('app.integer.button_height')) - .alignItems(VerticalAlign.Center) - .justifyContent(FlexAlign.Center) - .backgroundColor($r('sys.color.comp_background_primary')) - .borderRadius($r('sys.float.corner_radius_level6')) - - } - .padding({ - right: this.curBp === 'lg' ? $r('sys.float.padding_level16') : $r('sys.float.padding_level8'), - left: $r('sys.float.padding_level8') - }) - } - .title($r('app.string.dialog_name')) - .mode(this.curBp === 'lg' ? NavigationMode.Split : NavigationMode.Stack) - .navBarWidth($r('app.integer.nav_bar_width')) - .titleMode(NavigationTitleMode.Mini) - .backgroundColor($r('sys.color.background_secondary')) - .padding({ - top: px2vp(this.topRectHeight), - right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), - bottom: px2vp(this.bottomRectHeight), - left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') - }) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/ScrollOption.ets b/entry/src/main/ets/pages/ScrollOption.ets deleted file mode 100644 index 3b418a6..0000000 --- a/entry/src/main/ets/pages/ScrollOption.ets +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { CommonConstants } from '../common/constants/CommonConstants'; - -@Entry -@Component -struct ScrollOption { - @StorageLink('topRectHeight') topRectHeight: number = 0; - @StorageLink('bottomRectHeight') bottomRectHeight: number = 0; - @StorageLink('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; - private selectTime: Date = new Date('2024-4-17T18:30:00'); - @State select: number = 2; - private fruits: string[] = ['apple1', 'orange2', 'peach3', 'grape4', 'banana5']; - - build() { - Navigation() { - Column() { - Button($r('app.string.button_scroll_option1')) - .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) - .height($r('app.integer.button_height_small')) - .fontSize($r('sys.float.Subtitle_M')) - .backgroundColor($r('sys.color.brand')) - .margin({ - bottom: $r('sys.float.padding_level6') - }) - .onClick(() => { - TimePickerDialog.show({ - selected: this.selectTime, - backgroundColor: $r('sys.color.background_primary'), - onAccept: (value: TimePickerResult) => { - this.selectTime.setHours(value.hour, value.minute); - } - }) - }) - Button($r('app.string.button_scroll_option2')) - .width(this.curBp === 'sm' ? CommonConstants.FULL_PERCENT : CommonConstants.WIDTH_MD_LG) - .height($r('app.integer.button_height_small')) - .fontSize($r('sys.float.Subtitle_M')) - .backgroundColor($r('sys.color.brand')) - .margin({ - bottom: $r('sys.float.padding_level6') - }) - .onClick(() => { - TextPickerDialog.show({ - range: this.fruits, - selected: this.select, - backgroundColor: $r('sys.color.background_primary'), - onAccept: (value: TextPickerResult) => { - this.select = value.index as number; - } - }) - }) - } - .justifyContent(FlexAlign.End) - .width(CommonConstants.FULL_PERCENT) - .height(CommonConstants.FULL_PERCENT) - .padding({ - right: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0'), - left: this.curBp === 'sm' ? $r('sys.float.padding_level8') : $r('sys.float.padding_level0') - }) - } - .title($r('app.string.scroll_option')) - .titleMode(NavigationTitleMode.Mini) - .mode(NavigationMode.Stack) - .backgroundColor($r('sys.color.background_secondary')) - .padding({ - top: px2vp(this.topRectHeight), - right: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8'), - bottom: px2vp(this.bottomRectHeight), - left: this.curBp === 'sm' ? $r('sys.float.padding_level0') : - this.curBp === 'md' ? $r('sys.float.padding_level4') : $r('sys.float.padding_level8') - }) - } -} \ No newline at end of file diff --git a/entry/src/main/resources/base/profile/main_pages.json b/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index b36aec6..0000000 --- a/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/BindContentCoverDemo", - "pages/BindSheet", - "pages/Toast", - "pages/Privacy", - "pages/Details", - "pages/FullScreen", - "pages/CustomCalendar", - "pages/TwoLevelPageSheet", - "pages/ScrollOption" - ] -} \ No newline at end of file diff --git a/entry/src/main/resources/base/profile/router_map.json b/entry/src/main/resources/base/profile/router_map.json deleted file mode 100644 index 38d899d..0000000 --- a/entry/src/main/resources/base/profile/router_map.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "routerMap": [ - { - "name": "addPassengers", - "pageSourceFile": "src/main/ets/view/AddPassengers.ets", - "buildFunction": "AddPassengersBuilder" - }, - { - "name": "defaultList", - "pageSourceFile": "src/main/ets/view/DefaultList.ets", - "buildFunction": "DefaultListBuilder" - } - ] -} \ No newline at end of file -- Gitee