diff --git a/entry/src/main/ets/application/MailBox.ets b/entry/src/main/ets/application/MailBox.ets index 4b206d7dc62d68acec4e4b5f778337fef160ab9d..11240b84a52c893cf0276778ca124f5ecb31684c 100644 --- a/entry/src/main/ets/application/MailBox.ets +++ b/entry/src/main/ets/application/MailBox.ets @@ -13,7 +13,6 @@ * limitations under the License. */ import { BreakpointType } from '../common/BreakpointSystem'; - import { MailNavigation } from '../common/MailNavigation'; import { MailSideBar } from '../common/MailSideBar'; @@ -25,8 +24,7 @@ struct MailBox { @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; @State isFold: boolean = false; @State sideBarWidth: number = 304; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; build() { GridRow() { diff --git a/entry/src/main/ets/application/PhotoAlbum.ets b/entry/src/main/ets/application/PhotoAlbum.ets index f070fd345bf6482210e59a0d4af781b2a16740c8..bb79582f5c8953fc00af76865ae6a664662427ef 100644 --- a/entry/src/main/ets/application/PhotoAlbum.ets +++ b/entry/src/main/ets/application/PhotoAlbum.ets @@ -14,7 +14,6 @@ */ import { BreakpointType } from '../common/BreakpointSystem'; import { CommonConstants } from '../common/CommonConstants'; - import { PhotoContent } from '../common/PhotoContent'; import { PhotoSideBar } from '../common/PhotoSideBar'; @@ -26,10 +25,7 @@ struct PhotoAlbum { @State sideBarStatus: boolean = true; @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'sm'; @StorageProp('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; - @StorageProp('bottomRectHeight') - bottomRectHeight: number = 0; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; build() { GridRow() { diff --git a/entry/src/main/ets/application/Settings.ets b/entry/src/main/ets/application/Settings.ets index b373479acaeac8af01fcc9478c0e61c71bbd5292..a2c1887d1a34ee67ae0bc780b04053886650cba1 100644 --- a/entry/src/main/ets/application/Settings.ets +++ b/entry/src/main/ets/application/Settings.ets @@ -13,8 +13,6 @@ * limitations under the License. */ import { BreakpointType } from '../common/BreakpointSystem'; -import { CommonConstants } from '../common/CommonConstants'; - import { MainItem } from '../common/SettingItem'; import { WlanItem } from '../common/WlanItem'; @@ -25,10 +23,6 @@ let storage = LocalStorage.getShared(); struct Settings { @State pathInfo: NavPathStack = new NavPathStack(); @LocalStorageLink('currentBreakPoint') currentBreakPoint: string = 'md'; - @StorageProp('bottomRectHeight') - bottomRectHeight: number = 0; - @StorageProp('topRectHeight') - topRectHeight: number = 0; @Builder myRouter(name: string, param?: number | undefined) { diff --git a/entry/src/main/ets/common/MailContent.ets b/entry/src/main/ets/common/MailContent.ets index cc9b2efa7685b28857b60fb41d3b13cd02cb0047..83b767dbfbe29434747e3dcb424be448f0971b88 100644 --- a/entry/src/main/ets/common/MailContent.ets +++ b/entry/src/main/ets/common/MailContent.ets @@ -27,10 +27,8 @@ export struct MailContent { new OperateTabs($r('sys.symbol.dot_grid_2x2'), $r('app.string.more')), ] @StorageProp('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; - @StorageProp('bottomRectHeight') - bottomRectHeight: number = 0; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('bottomRectHeight') bottomRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; build() { NavDestination() { diff --git a/entry/src/main/ets/common/MailNavigation.ets b/entry/src/main/ets/common/MailNavigation.ets index 4a458f566525531271967c0a6127eea7100fca99..05c21b90a38839050f9dba39d8322f45b9ba1716 100644 --- a/entry/src/main/ets/common/MailNavigation.ets +++ b/entry/src/main/ets/common/MailNavigation.ets @@ -22,11 +22,10 @@ export struct MailNavigation { @State currentIndex: number = 0; @State mailList: string[] = ['1', '1', '1', '1', '1', '1']; @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; @Builder - myRouter(name: string, param?: number | undefined) { + myRouter() { MailContent() } diff --git a/entry/src/main/ets/common/PhotoContent.ets b/entry/src/main/ets/common/PhotoContent.ets index 3a01be3575a1c23bcda3051415adb207e27d2c70..a5b0a3d15c5d21818af4352abbb370664f9478ce 100644 --- a/entry/src/main/ets/common/PhotoContent.ets +++ b/entry/src/main/ets/common/PhotoContent.ets @@ -32,8 +32,7 @@ export struct PhotoContent { @State columnsTemplate: string = '1fr 1fr 1fr'; @Link @Watch('onStateChange') sideBarStatus: boolean; @StorageProp('currentBreakpoint') currentBreakPoint: string = CommonConstants.BREAK_POINT_SM; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; aboutToAppear() { if (this.sideBarStatus === true && this.currentBreakPoint === 'md') { diff --git a/entry/src/main/ets/common/PhotoSideBar.ets b/entry/src/main/ets/common/PhotoSideBar.ets index 2becec383a454eebb23f8485c1ff6fccd385ad81..a545e72d4eecb677ca12fe6ba6d639e20abe621d 100644 --- a/entry/src/main/ets/common/PhotoSideBar.ets +++ b/entry/src/main/ets/common/PhotoSideBar.ets @@ -31,8 +31,7 @@ export struct PhotoSideBar { new PhotoType($r('app.string.hidden'), 1), ]; @StorageProp('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; build() { Column() { diff --git a/entry/src/main/ets/common/WlanItem.ets b/entry/src/main/ets/common/WlanItem.ets index 58f2f45dffc1d4dccc0f6630098bea76935e34a1..2339310bc74979d63e9da6c6f72a3f2ea547ac80 100644 --- a/entry/src/main/ets/common/WlanItem.ets +++ b/entry/src/main/ets/common/WlanItem.ets @@ -21,8 +21,7 @@ import { BreakpointType } from './BreakpointSystem'; export struct WlanItem { @State netWorkStatus: Resource = $r('app.string.closed'); @LocalStorageProp('currentBreakPoint') currentBreakPoint: string = 'md'; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; @Builder CustomDivider() { diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index d0db6a59db3557dc924a8bb5582172decfa1de65..91bd278f9a003c2f97b8f1a846d35061420f6b98 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -13,14 +13,13 @@ * limitations under the License. */ -import { Configuration, ConfigurationConstant, UIAbility } from '@kit.AbilityKit'; +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 windowObj?: window.Window; private curBp: string = ''; private updateBreakpoint(windowWidth: number): void { @@ -39,7 +38,8 @@ export default class EntryAbility extends UIAbility { AppStorage.setOrCreate('currentBreakpoint', this.curBp); } } catch (exception) { - hilog.error(0x0000, 'testTag', `UpdateBreakpoint fail, error message${JSON.stringify(exception)}`); + hilog.error(0x0000, 'testTag', + `UpdateBreakpoint fail, error message${JSON.stringify((exception as BusinessError).code)}`); } } @@ -49,15 +49,6 @@ export default class EntryAbility extends UIAbility { this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); } - 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); - } - } - onDestroy(): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); } @@ -72,7 +63,6 @@ export default class EntryAbility extends UIAbility { avoidArea = windowObj.getWindowAvoidArea(type); let topRectHeight = avoidArea.topRect.height; AppStorage.setOrCreate('topRectHeight', topRectHeight); - this.windowObj = windowObj; this.updateBreakpoint(windowObj.getWindowProperties().windowRect.width); windowObj.on('windowSizeChange', (windowSize) => { this.updateBreakpoint(windowSize.width); diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 17e4f8191d7ff6f29e74c884bb1d9dc74bf59dca..f12350b695752c96f2679223a4f9ae3b43abed21 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -20,10 +20,8 @@ import { CommonConstants, Route } from '../common/CommonConstants'; @Component struct Index { @StorageProp('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; - @StorageProp('bottomRectHeight') - bottomRectHeight: number = 0; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('bottomRectHeight') bottomRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; private routes: Route[] = CommonConstants.ROUTES; build() {