diff --git a/entry/src/main/ets/application/MailBox.ets b/entry/src/main/ets/application/MailBox.ets index 11240b84a52c893cf0276778ca124f5ecb31684c..e157a7bbe9aff531ca398a9e9217c3b0e530366d 100644 --- a/entry/src/main/ets/application/MailBox.ets +++ b/entry/src/main/ets/application/MailBox.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { BreakpointType } from '../common/BreakpointSystem'; import { MailNavigation } from '../common/MailNavigation'; import { MailSideBar } from '../common/MailSideBar'; diff --git a/entry/src/main/ets/application/PhotoAlbum.ets b/entry/src/main/ets/application/PhotoAlbum.ets index bb79582f5c8953fc00af76865ae6a664662427ef..e70f41585ddefbeccc719702e01df0ca05332af3 100644 --- a/entry/src/main/ets/application/PhotoAlbum.ets +++ b/entry/src/main/ets/application/PhotoAlbum.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { BreakpointType } from '../common/BreakpointSystem'; import { CommonConstants } from '../common/CommonConstants'; import { PhotoContent } from '../common/PhotoContent'; diff --git a/entry/src/main/ets/application/Settings.ets b/entry/src/main/ets/application/Settings.ets index a2c1887d1a34ee67ae0bc780b04053886650cba1..699a478e047c84bf72871c1538fa224f74ef05ee 100644 --- a/entry/src/main/ets/application/Settings.ets +++ b/entry/src/main/ets/application/Settings.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { BreakpointType } from '../common/BreakpointSystem'; import { MainItem } from '../common/SettingItem'; import { WlanItem } from '../common/WlanItem'; diff --git a/entry/src/main/ets/common/BreakpointSystem.ets b/entry/src/main/ets/common/BreakpointSystem.ets index fa084659fb6136e2f2e43a8f62bfd21d8fddafca..3e70feb9ab5230c7934cfa973e98ba6dc75489da 100644 --- a/entry/src/main/ets/common/BreakpointSystem.ets +++ b/entry/src/main/ets/common/BreakpointSystem.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 diff --git a/entry/src/main/ets/common/CommonConstants.ets b/entry/src/main/ets/common/CommonConstants.ets index 652a8b4d640ecd5b0291d8107724d84a12ddbfba..b2f6854da1078ab18bc7348c48faebb9ded618b1 100644 --- a/entry/src/main/ets/common/CommonConstants.ets +++ b/entry/src/main/ets/common/CommonConstants.ets @@ -16,16 +16,7 @@ /** * Common constants for all features. */ - export class CommonConstants { - /** - * font weight is 500. - */ - public static readonly FONT_WEIGHT_FIVE: number = 500; - /** - * font weight is 500. - */ - public static readonly FONT_WEIGHT_FOUR: number = 400; /** * Index page padding top size. */ @@ -46,14 +37,6 @@ export class CommonConstants { * Breakpoint sm. */ public static readonly BREAK_POINT_SM: string = 'sm'; - /** - * Breakpoint md. - */ - public static readonly BREAK_POINT_MD: string = 'md'; - /** - * Breakpoint lg. - */ - public static readonly BREAK_POINT_LG: string = 'lg'; /** * Routes */ diff --git a/entry/src/main/ets/common/MailContent.ets b/entry/src/main/ets/common/MailContent.ets index 83b767dbfbe29434747e3dcb424be448f0971b88..c0791504e740f0450bb844cbd90d290d32e2f6ba 100644 --- a/entry/src/main/ets/common/MailContent.ets +++ b/entry/src/main/ets/common/MailContent.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 diff --git a/entry/src/main/ets/common/MailNavigation.ets b/entry/src/main/ets/common/MailNavigation.ets index 05c21b90a38839050f9dba39d8322f45b9ba1716..bbdf13ee315bd5ecb29d4d24bc139a51adf5f96c 100644 --- a/entry/src/main/ets/common/MailNavigation.ets +++ b/entry/src/main/ets/common/MailNavigation.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -19,7 +19,6 @@ import { MailContent } from './MailContent'; @Component export struct MailNavigation { @State pathInfo: NavPathStack = new NavPathStack(); - @State currentIndex: number = 0; @State mailList: string[] = ['1', '1', '1', '1', '1', '1']; @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; @StorageProp('topRectHeight') topRectHeight: number = 0; diff --git a/entry/src/main/ets/common/MailSideBar.ets b/entry/src/main/ets/common/MailSideBar.ets index 51a3a34db0509e64962d1fc50dc0d3757bf8fd30..597fc7c89b29a1d0a66d3c6935750a46e74bbe1e 100644 --- a/entry/src/main/ets/common/MailSideBar.ets +++ b/entry/src/main/ets/common/MailSideBar.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - import { MailType } from '../model/dataType'; import { BreakpointType } from './BreakpointSystem'; import { CommonConstants } from './CommonConstants'; @@ -30,7 +29,6 @@ export struct MailSideBar { build() { Column() { AccountInfo() - MailStatusList() }.width('100%') } diff --git a/entry/src/main/ets/common/PhotoContent.ets b/entry/src/main/ets/common/PhotoContent.ets index a5b0a3d15c5d21818af4352abbb370664f9478ce..b8fca8ed0892beb208922b34df895cf3a49ccbb9 100644 --- a/entry/src/main/ets/common/PhotoContent.ets +++ b/entry/src/main/ets/common/PhotoContent.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 diff --git a/entry/src/main/ets/common/PhotoSideBar.ets b/entry/src/main/ets/common/PhotoSideBar.ets index a545e72d4eecb677ca12fe6ba6d639e20abe621d..91ea1ab61de4a4fc02ddb09c53a44baa1873764f 100644 --- a/entry/src/main/ets/common/PhotoSideBar.ets +++ b/entry/src/main/ets/common/PhotoSideBar.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 diff --git a/entry/src/main/ets/common/SettingItem.ets b/entry/src/main/ets/common/SettingItem.ets index 276141c0ee7860dd6e7b0df9f52ac7fa0e53142c..e53a4dcd846451bd2fdba0ad7bb17e745486cca6 100644 --- a/entry/src/main/ets/common/SettingItem.ets +++ b/entry/src/main/ets/common/SettingItem.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 diff --git a/entry/src/main/ets/common/WlanItem.ets b/entry/src/main/ets/common/WlanItem.ets index 2339310bc74979d63e9da6c6f72a3f2ea547ac80..926aae47a61b523e858ab2e1f9fe8890d8a97ffb 100644 --- a/entry/src/main/ets/common/WlanItem.ets +++ b/entry/src/main/ets/common/WlanItem.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 91bd278f9a003c2f97b8f1a846d35061420f6b98..c698329a02416c333312baeafe6b59f5ba4703aa 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -17,7 +17,6 @@ import { ConfigurationConstant, UIAbility } from '@kit.AbilityKit'; import { display, window } from '@kit.ArkUI'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { BusinessError } from '@kit.BasicServicesKit'; -import { resourceManager } from '@kit.LocalizationKit'; export default class EntryAbility extends UIAbility { private curBp: string = ''; @@ -37,15 +36,13 @@ export default class EntryAbility extends UIAbility { this.curBp = newBp; AppStorage.setOrCreate('currentBreakpoint', this.curBp); } - } catch (exception) { - hilog.error(0x0000, 'testTag', - `UpdateBreakpoint fail, error message${JSON.stringify((exception as BusinessError).code)}`); + } catch (error) { + hilog.error(0x0000, 'testTag', `Update breakpoint fail. Cause: ${(error as BusinessError).message}`); } } onCreate(): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - AppStorage.setOrCreate('systemColorMode', this.context.config.colorMode); this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); } @@ -54,37 +51,38 @@ export default class EntryAbility extends UIAbility { } onWindowStageCreate(windowStage: window.WindowStage): void { - windowStage.getMainWindow().then((windowObj: window.Window) => { - let type = window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR; - let avoidArea = windowObj.getWindowAvoidArea(type); - let bottomRectHeight = avoidArea.bottomRect.height; - AppStorage.setOrCreate('bottomRectHeight', bottomRectHeight); - type = window.AvoidAreaType.TYPE_SYSTEM; - avoidArea = windowObj.getWindowAvoidArea(type); - let topRectHeight = avoidArea.topRect.height; - AppStorage.setOrCreate('topRectHeight', topRectHeight); - this.updateBreakpoint(windowObj.getWindowProperties().windowRect.width); - windowObj.on('windowSizeChange', (windowSize) => { - this.updateBreakpoint(windowSize.width); - }) - }); // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - let context = this.context; - let resourceManager: resourceManager.ResourceManager = context.resourceManager; - AppStorage.setOrCreate('resourceManager', resourceManager); - windowStage.loadContent('pages/Index', (err) => { + windowStage.getMainWindow().then((windowObj: window.Window) => { + try { + let type = window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR; + let avoidArea = windowObj.getWindowAvoidArea(type); + let bottomRectHeight = avoidArea.bottomRect.height; + AppStorage.setOrCreate('bottomRectHeight', bottomRectHeight); + type = window.AvoidAreaType.TYPE_SYSTEM; + avoidArea = windowObj.getWindowAvoidArea(type); + let topRectHeight = avoidArea.topRect.height; + AppStorage.setOrCreate('topRectHeight', topRectHeight); + this.updateBreakpoint(windowObj.getWindowProperties().windowRect.width); + windowObj.on('windowSizeChange', (windowSize) => { + this.updateBreakpoint(windowSize.width); + }) + windowObj.setWindowLayoutFullScreen(true).then(() => { + hilog.info(0x0000, 'testTag', '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. Cause: ${err.message}`); + }); + } catch (error) { + hilog.error(0x0000, 'testTag', `Update window size fail. Cause: ${(error as BusinessError).message}`); + } + }).catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `Failed to get main window. Cause: ${err.message}`); + }); + windowStage.loadContent('pages/Index', (err: BusinessError) => { if (err.code) { - hilog.error(0x0000, 'Failed to load the content. Cause: %{public}s', JSON.stringify(err.code) ?? ''); + hilog.error(0x0000, 'testTag', `Failed to load the content. Cause: ${err.message}`); return; } - let windowClass: window.Window = windowStage.getMainWindowSync(); - let isLayoutFullScreen = true; - windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => { - hilog.info(0x0000, 'testTag', 'Succeeded in setting the window layout to full-screen mode.'); - }).catch((err: BusinessError) => { - hilog.error(0x0000, 'Failed to set the window layout to full-screen mode.', JSON.stringify(err.code)); - }); }); } diff --git a/entry/src/main/ets/model/dataType.ets b/entry/src/main/ets/model/dataType.ets index 4d7bcc3b345dfec56db44f5216cfe8be7f427522..420509fd047958f68785bc9c535db15c3c72b8a6 100644 --- a/entry/src/main/ets/model/dataType.ets +++ b/entry/src/main/ets/model/dataType.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index f12350b695752c96f2679223a4f9ae3b43abed21..c21e2316e455c5e15de4e093d98cd3a49ad7b781 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -15,6 +15,8 @@ import { router } from '@kit.ArkUI'; import { CommonConstants, Route } from '../common/CommonConstants'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BusinessError } from '@kit.BasicServicesKit'; @Entry @Component @@ -45,7 +47,11 @@ struct Index { .margin({ top: $r('sys.float.padding_level6') }) .backgroundColor($r('sys.color.comp_background_emphasize')) .onClick(() => { - router.pushUrl({ url: item.to }); + try { + router.pushUrl({ url: item.to }); + } catch (error) { + hilog.error(0x0000, 'testTag', `Push url fail. Cause: ${(error as BusinessError).message}`); + } }) }, (item: Route) => JSON.stringify(item)) }