diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 52b6c8cb4732068c2688956db238e1c969c52f0f..56deb8c2f2b9131cc11fb987278628b7b6983617 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -23,7 +23,6 @@ import { Constants } from '../common/Constants'; const TAG: string = '[EntryAbility]' export default class EntryAbility extends UIAbility { - private windowObj?: window.Window; private curBp: string = ''; private updateBreakpoint(windowWidth: number): void { @@ -38,10 +37,11 @@ export default class EntryAbility extends UIAbility { newBp = Constants.BREAK_POINT_LG; } if (this.curBp !== newBp) { + this.curBp = newBp; AppStorage.setOrCreate('currentBreakpoint', this.curBp); } } catch (error) { - hilog.error(0x0000, TAG, 'updateBreakpoint catch err:', JSON.stringify(error) ?? ''); + hilog.error(0x0000, TAG, `updateBreakpoint catch err:`, JSON.stringify((error as BusinessError).message) ?? ''); } } @@ -60,7 +60,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/view/SampleUnitView.ets b/entry/src/main/ets/view/SampleUnitView.ets index f2376dc2de0226c179490e13041c9061058b6155..f6a03c54f6e43cfe6a643bcc894a0121b46d55ff 100644 --- a/entry/src/main/ets/view/SampleUnitView.ets +++ b/entry/src/main/ets/view/SampleUnitView.ets @@ -36,7 +36,6 @@ export default struct SampleUnitView { @Prop buttonUnit: ButtonUnitItem; @Prop type: string; @Prop imageArray: Resource[]; - private controller: VideoController = new VideoController(); build() { Flex({ direction: FlexDirection.Column }) { @@ -48,7 +47,7 @@ export default struct SampleUnitView { .fontFamily(FONT_FAMILY) .margin({ bottom: STATIC_MARGIN }) if (this.type === TYPE_ENUM[0]) { - SampleUnitVideoView({ controller: this.controller }); + SampleUnitVideoView(); } else if (this.type === TYPE_ENUM[1]) { SampleUnitPicView({ imageArray: this.imageArray }); }