From d2d467bcb65065dc4899bcaa60eaa81f9fee5b86 Mon Sep 17 00:00:00 2001 From: fangzhiyuan Date: Mon, 11 Aug 2025 22:31:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90ArkTS=E6=BC=94=E8=BF=9B=E3=80=91withTh?= =?UTF-8?q?eme=E9=80=82=E9=85=8D=E7=BB=84=E4=BB=B6=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangzhiyuan Change-Id: Ifba960cab98855b53c9cdc03df0ba4c2cb4c9c71 --- .../arkoala-arkts/arkui-ohos/src/component/withTheme.ts | 4 ++++ .../arkui-ohos/src/handwritten/theme/ArkThemeNativeHelper.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/withTheme.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/withTheme.ts index da29f821baf..4e6a40200ac 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/withTheme.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/withTheme.ts @@ -72,6 +72,7 @@ export interface WithThemeAttribute extends CommonMethod { return this } // attributeModifier(value: AttributeModifier | undefined): this + setWithThemeOptions(options: WithThemeOptions): this } export class ArkWithThemeStyle implements WithThemeAttribute { public attributeModifier(value: AttributeModifier | undefined): this { @@ -135,6 +136,9 @@ export class ArkWithThemeSet implements WithThemeAttribute { public attributeModifier(value: AttributeModifier | undefined): this { throw new Error("Not implemented") } + public setWithThemeOptions(options: WithThemeOptions): this { + return this; + } } export class WithThemeOptions_serializer { public static write(buffer: Serializer, value: WithThemeOptions): void { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/theme/ArkThemeNativeHelper.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/theme/ArkThemeNativeHelper.ts index ea1a6a62d58..69b183149bb 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/theme/ArkThemeNativeHelper.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/theme/ArkThemeNativeHelper.ts @@ -63,7 +63,7 @@ export class ArkThemeNativeHelper { ArkThemeScopeManager.getInstance().onEnterLocalColorMode(colorMode); } const thisSerializer : Serializer = Serializer.hold(); - const colorArray = ArkThemeNativeHelper.convertColorsToArray(theme?.colors); + const colorArray = ArkThemeNativeHelper.convertThemeToColorArray(theme); SerializeUtils.writeColorArray(thisSerializer, colorArray); ArkUIAniModule._CreateAndBindTheme(themeScopeId, themeId, thisSerializer.asBuffer(), thisSerializer.length(), colorMode, onThemeScopeDestroy); -- Gitee