From f79b93dcc79844e997e4d19100c84e5f6bbb4c23 Mon Sep 17 00:00:00 2001 From: hucong Date: Thu, 20 Feb 2025 04:00:07 +0000 Subject: [PATCH 01/10] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E8=89=B2=E6=A8=AA=E7=AB=96=E5=B1=8F=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E4=B8=8A=E6=96=B9=E7=99=BD=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hucong --- .../interfaces/atomicservicenavigation.js | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index b129314..a81f85e 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -149,8 +149,8 @@ export class AtomicServiceNavigation extends ViewPU { this.modeChangeCallback = undefined; this.settings = new RenderingContextSettings(true); this.context = new CanvasRenderingContext2D(this.settings); - this.navigationWidth = 0; - this.navigationHeight = 0; + this.__navigationWidth = new ObservedPropertySimplePU(0, this, "navigationWidth"); + this.__navigationHeight = new ObservedPropertySimplePU(0, this, "navigationHeight"); this.mainWindow = undefined; this.onWindowSizeChangeCallback = undefined; this.onAvoidSafeAreaChangeCallback = undefined; @@ -258,6 +258,8 @@ export class AtomicServiceNavigation extends ViewPU { this.__currentBreakPoint.purgeDependencyOnElmtId(rmElmtId); this.__sideBarAttribute.purgeDependencyOnElmtId(rmElmtId); this.__controlButtonVisible.purgeDependencyOnElmtId(rmElmtId); + this.__navigationWidth.purgeDependencyOnElmtId(rmElmtId); + this.__navigationHeight.purgeDependencyOnElmtId(rmElmtId); } aboutToBeDeleted() { @@ -276,6 +278,8 @@ export class AtomicServiceNavigation extends ViewPU { this.__currentBreakPoint.aboutToBeDeleted(); this.__sideBarAttribute.aboutToBeDeleted(); this.__controlButtonVisible.aboutToBeDeleted(); + this.__navigationWidth.aboutToBeDeleted(); + this.__navigationHeight.aboutToBeDeleted(); SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } @@ -399,7 +403,18 @@ export class AtomicServiceNavigation extends ViewPU { set controlButtonVisible(newValue) { this.__controlButtonVisible.set(newValue); } - + get navigationWidth() { + return this.__navigationWidth.get(); + } + set navigationWidth(newValue) { + this.__navigationWidth.set(newValue); + } + get navigationHeight() { + return this.__navigationHeight.get(); + } + set navigationHeight(newValue) { + this.__navigationHeight.set(newValue); + } defaultNavDestinationBuilder(name, param, parent = null) { } @@ -1119,7 +1134,7 @@ export class AtomicServiceNavigation extends ViewPU { Stack.create(); Stack.width('100%'); Stack.height('100%'); - Stack.background(this.gradientBackground === undefined ? undefined : { + Stack.background(this.gradientBackground === undefined || (this.navigationWidth === -1 && this.navigationHeight === -1) ? undefined : { builder: () => { this.BackgroundBuilder.call(this, makeBuilderParameterProxy('BackgroundBuilder', { primaryColor: () => this.gradientBackground.primaryColor, @@ -1129,7 +1144,7 @@ export class AtomicServiceNavigation extends ViewPU { alpha: () => this.gradientBackground.alpha })); } - }); + } , { align: Alignment.Top }); Stack.onSizeChange((oldValue, newValue) => { this.navigationWidth = newValue.width; this.navigationHeight = newValue.height; -- Gitee From 1c02a92ebff90b570330016012b56d0295eaa0b2 Mon Sep 17 00:00:00 2001 From: hucong Date: Thu, 20 Feb 2025 04:00:28 +0000 Subject: [PATCH 02/10] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E8=89=B2=E6=A8=AA=E7=AB=96=E5=B1=8F=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E4=B8=8A=E6=96=B9=E7=99=BD=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hucong --- .../source/atomicservicenavigation.ets | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/atomicservicenavigation/source/atomicservicenavigation.ets b/atomicservicenavigation/source/atomicservicenavigation.ets index d9dff7c..0f576b4 100644 --- a/atomicservicenavigation/source/atomicservicenavigation.ets +++ b/atomicservicenavigation/source/atomicservicenavigation.ets @@ -140,8 +140,8 @@ export struct AtomicServiceNavigation { private settings: RenderingContextSettings = new RenderingContextSettings(true); private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); - private navigationWidth: number = 0; - private navigationHeight: number = 0; + @State private navigationWidth: number = 0; + @State private navigationHeight: number = 0; private mainWindow?: window.Window; private onWindowSizeChangeCallback?: Callback; @@ -627,13 +627,14 @@ export struct AtomicServiceNavigation { } .width('100%') .height('100%') - .background(this.gradientBackground === undefined ? undefined : this.BackgroundBuilder({ + .background(this.gradientBackground === undefined || (this.navigationWidth === -1 && this.navigationHeight === -1) ? + undefined : this.BackgroundBuilder({ primaryColor: this.gradientBackground.primaryColor, secondaryColor: this.gradientBackground.secondaryColor, backgroundTheme: this.gradientBackground.backgroundTheme, mixMode: this.gradientBackground.mixMode, alpha: this.gradientBackground.alpha - })) + }), { align: Alignment.Top }) .onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => { this.navigationWidth = newValue.width as number; this.navigationHeight = newValue.height as number; -- Gitee From b1f934682ba1dec450bf79fbd03f6e0d5fb3c6df Mon Sep 17 00:00:00 2001 From: hucong Date: Thu, 20 Feb 2025 06:04:39 +0000 Subject: [PATCH 03/10] update atomicservicenavigation/interfaces/atomicservicenavigation.js. Signed-off-by: hucong --- atomicservicenavigation/interfaces/atomicservicenavigation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index a81f85e..a2a0a44 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -1144,7 +1144,7 @@ export class AtomicServiceNavigation extends ViewPU { alpha: () => this.gradientBackground.alpha })); } - } , { align: Alignment.Top }); + }, { align: Alignment.Top }); Stack.onSizeChange((oldValue, newValue) => { this.navigationWidth = newValue.width; this.navigationHeight = newValue.height; -- Gitee From ec2060251b412a79b9aaf1df2a5ffc43ff59b8b9 Mon Sep 17 00:00:00 2001 From: hucong Date: Thu, 20 Feb 2025 06:06:39 +0000 Subject: [PATCH 04/10] update atomicservicenavigation/interfaces/atomicservicenavigation.js. Signed-off-by: hucong --- atomicservicenavigation/interfaces/atomicservicenavigation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index a2a0a44..01a5b0d 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -149,8 +149,8 @@ export class AtomicServiceNavigation extends ViewPU { this.modeChangeCallback = undefined; this.settings = new RenderingContextSettings(true); this.context = new CanvasRenderingContext2D(this.settings); - this.__navigationWidth = new ObservedPropertySimplePU(0, this, "navigationWidth"); - this.__navigationHeight = new ObservedPropertySimplePU(0, this, "navigationHeight"); + this.__navigationWidth = new ObservedPropertySimplePU(0, this, 'navigationWidth'); + this.__navigationHeight = new ObservedPropertySimplePU(0, this, 'navigationHeight'); this.mainWindow = undefined; this.onWindowSizeChangeCallback = undefined; this.onAvoidSafeAreaChangeCallback = undefined; -- Gitee From 2b9f07d254ca00e7c01e30130ca4a1497a131f0d Mon Sep 17 00:00:00 2001 From: hucong Date: Fri, 21 Feb 2025 02:38:01 +0000 Subject: [PATCH 05/10] update atomicservicenavigation/source/atomicservicenavigation.ets. Signed-off-by: hucong --- .../source/atomicservicenavigation.ets | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/atomicservicenavigation/source/atomicservicenavigation.ets b/atomicservicenavigation/source/atomicservicenavigation.ets index 37482d9..15b2905 100644 --- a/atomicservicenavigation/source/atomicservicenavigation.ets +++ b/atomicservicenavigation/source/atomicservicenavigation.ets @@ -187,7 +187,7 @@ export struct AtomicServiceNavigation { gradientBackground.backgroundTheme === undefined ? BackgroundTheme.DEFAULT : gradientBackground.backgroundTheme); } - }) + }).expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) } aboutToAppear(): void { @@ -559,6 +559,16 @@ export struct AtomicServiceNavigation { build() { Stack() { + Column(){ + if(this.gradientBackground !== undefined) + this.BackgroundBuilder({ + primaryColor: this.gradientBackground.primaryColor, + secondaryColor: this.gradientBackground.secondaryColor, + backgroundTheme: this.gradientBackground.backgroundTheme, + mixMode: this.gradientBackground.mixMode, + alpha: this.gradientBackground.alpha + }) + } if (this.titleOptions?.titleBarType === TitleBarType.DRAWER) { this.controlButton(); @@ -638,14 +648,6 @@ export struct AtomicServiceNavigation { } .width('100%') .height('100%') - .background(this.gradientBackground === undefined || (this.navigationWidth === -1 && this.navigationHeight === -1) ? - undefined : this.BackgroundBuilder({ - primaryColor: this.gradientBackground.primaryColor, - secondaryColor: this.gradientBackground.secondaryColor, - backgroundTheme: this.gradientBackground.backgroundTheme, - mixMode: this.gradientBackground.mixMode, - alpha: this.gradientBackground.alpha - }), { align: Alignment.Top }) .onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => { this.navigationWidth = newValue.width as number; this.navigationHeight = newValue.height as number; -- Gitee From 63ea9fadb0139ac18694b022b17ba07baa1816d7 Mon Sep 17 00:00:00 2001 From: hucong Date: Fri, 21 Feb 2025 02:38:21 +0000 Subject: [PATCH 06/10] update atomicservicenavigation/interfaces/atomicservicenavigation.js. Signed-off-by: hucong --- .../interfaces/atomicservicenavigation.js | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index 6845adb..402a901 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -412,6 +412,7 @@ export class AtomicServiceNavigation extends ViewPU { gradientBackground.backgroundTheme); } }); + Canvas.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]); }, Canvas); Canvas.pop(); } @@ -978,23 +979,29 @@ export class AtomicServiceNavigation extends ViewPU { Stack.create(); Stack.width('100%'); Stack.height('100%'); - Stack.background(this.gradientBackground === undefined || (this.navigationWidth === -1 && this.navigationHeight === -1) ? undefined : { - builder: () => { - this.BackgroundBuilder.call(this, makeBuilderParameterProxy('BackgroundBuilder', { - primaryColor: () => this.gradientBackground.primaryColor, - secondaryColor: () => this.gradientBackground.secondaryColor, - backgroundTheme: () => this.gradientBackground.backgroundTheme, - mixMode: () => this.gradientBackground.mixMode, - alpha: () => this.gradientBackground.alpha - })); - } - }, { align: Alignment.Top }); Stack.onSizeChange((oldValue, newValue) => { this.navigationWidth = newValue.width; this.navigationHeight = newValue.height; }); Stack.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]); }, Stack); + this.observeComponentCreation2((elmtId, isInitialRender) => { + Column.create(); + }, Column); + this.observeComponentCreation2((elmtId, isInitialRender) => { + If.create(); + if (this.gradientBackground !== undefined) { + this.ifElseBranchUpdateFunction(0, () => { + this.BackgroundBuilder.bind(this)(makeBuilderParameterProxy("BackgroundBuilder", { primaryColor: () => this.gradientBackground.primaryColor, secondaryColor: () => this.gradientBackground.secondaryColor, backgroundTheme: () => this.gradientBackground.backgroundTheme, mixMode: () => this.gradientBackground.mixMode, alpha: () => this.gradientBackground.alpha })); + }); + } + else { + this.ifElseBranchUpdateFunction(1, () => { + }); + } + }, If); + If.pop(); + Column.pop(); this.observeComponentCreation2((elmtId, isInitialRender) => { If.create(); if (this.titleOptions?.titleBarType === TitleBarType.DRAWER) { -- Gitee From ac945d944346abcda0377b8e82e2a4b13ac7bec3 Mon Sep 17 00:00:00 2001 From: hucong Date: Fri, 21 Feb 2025 06:04:20 +0000 Subject: [PATCH 07/10] update atomicservicenavigation/interfaces/atomicservicenavigation.js. Signed-off-by: hucong --- atomicservicenavigation/interfaces/atomicservicenavigation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index 402a901..abf02fb 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -992,7 +992,7 @@ export class AtomicServiceNavigation extends ViewPU { If.create(); if (this.gradientBackground !== undefined) { this.ifElseBranchUpdateFunction(0, () => { - this.BackgroundBuilder.bind(this)(makeBuilderParameterProxy("BackgroundBuilder", { primaryColor: () => this.gradientBackground.primaryColor, secondaryColor: () => this.gradientBackground.secondaryColor, backgroundTheme: () => this.gradientBackground.backgroundTheme, mixMode: () => this.gradientBackground.mixMode, alpha: () => this.gradientBackground.alpha })); + this.BackgroundBuilder.bind(this)(makeBuilderParameterProxy('BackgroundBuilder', { primaryColor: () => this.gradientBackground.primaryColor, secondaryColor: () => this.gradientBackground.secondaryColor, backgroundTheme: () => this.gradientBackground.backgroundTheme, mixMode: () => this.gradientBackground.mixMode, alpha: () => this.gradientBackground.alpha })); }); } else { -- Gitee From b241561a4f1d5a3e3ef60a25709d753f40c99428 Mon Sep 17 00:00:00 2001 From: hucong Date: Fri, 21 Feb 2025 06:07:25 +0000 Subject: [PATCH 08/10] update atomicservicenavigation/interfaces/atomicservicenavigation.js. Signed-off-by: hucong --- .../interfaces/atomicservicenavigation.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index abf02fb..e9f279c 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -992,10 +992,15 @@ export class AtomicServiceNavigation extends ViewPU { If.create(); if (this.gradientBackground !== undefined) { this.ifElseBranchUpdateFunction(0, () => { - this.BackgroundBuilder.bind(this)(makeBuilderParameterProxy('BackgroundBuilder', { primaryColor: () => this.gradientBackground.primaryColor, secondaryColor: () => this.gradientBackground.secondaryColor, backgroundTheme: () => this.gradientBackground.backgroundTheme, mixMode: () => this.gradientBackground.mixMode, alpha: () => this.gradientBackground.alpha })); + this.BackgroundBuilder.bind(this)(makeBuilderParameterProxy('BackgroundBuilder', { + primaryColor: () => this.gradientBackground.primaryColor, + secondaryColor: () => this.gradientBackground.secondaryColor, + backgroundTheme: () => this.gradientBackground.backgroundTheme, + mixMode: () => this.gradientBackground.mixMode, + alpha: () => this.gradientBackground.alpha + })); }); - } - else { + } else { this.ifElseBranchUpdateFunction(1, () => { }); } -- Gitee From c0cc989072d58299ea4dd35ee602468a88e220de Mon Sep 17 00:00:00 2001 From: hucong Date: Fri, 21 Feb 2025 06:14:50 +0000 Subject: [PATCH 09/10] update atomicservicenavigation/source/atomicservicenavigation.ets. Signed-off-by: hucong --- atomicservicenavigation/source/atomicservicenavigation.ets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomicservicenavigation/source/atomicservicenavigation.ets b/atomicservicenavigation/source/atomicservicenavigation.ets index 15b2905..5af7429 100644 --- a/atomicservicenavigation/source/atomicservicenavigation.ets +++ b/atomicservicenavigation/source/atomicservicenavigation.ets @@ -559,8 +559,8 @@ export struct AtomicServiceNavigation { build() { Stack() { - Column(){ - if(this.gradientBackground !== undefined) + Column() { + if (this.gradientBackground !== undefined) this.BackgroundBuilder({ primaryColor: this.gradientBackground.primaryColor, secondaryColor: this.gradientBackground.secondaryColor, -- Gitee From 5e1589c873c62154a135c07eff988609df3d01f1 Mon Sep 17 00:00:00 2001 From: hucong Date: Fri, 21 Feb 2025 06:25:22 +0000 Subject: [PATCH 10/10] update atomicservicenavigation/source/atomicservicenavigation.ets. Signed-off-by: hucong --- atomicservicenavigation/source/atomicservicenavigation.ets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atomicservicenavigation/source/atomicservicenavigation.ets b/atomicservicenavigation/source/atomicservicenavigation.ets index 5af7429..42593cf 100644 --- a/atomicservicenavigation/source/atomicservicenavigation.ets +++ b/atomicservicenavigation/source/atomicservicenavigation.ets @@ -560,7 +560,7 @@ export struct AtomicServiceNavigation { build() { Stack() { Column() { - if (this.gradientBackground !== undefined) + if (this.gradientBackground !== undefined) { this.BackgroundBuilder({ primaryColor: this.gradientBackground.primaryColor, secondaryColor: this.gradientBackground.secondaryColor, @@ -568,6 +568,7 @@ export struct AtomicServiceNavigation { mixMode: this.gradientBackground.mixMode, alpha: this.gradientBackground.alpha }) + } } if (this.titleOptions?.titleBarType === TitleBarType.DRAWER) { this.controlButton(); -- Gitee