From 999ebc84303d8b6e4536f54adb005af2918f84e8 Mon Sep 17 00:00:00 2001 From: hyiso Date: Tue, 27 Aug 2024 11:09:35 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20setApplicationSwitcherDescription=20?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hyiso --- .../embedding/engine/systemchannels/PlatformChannel.ets | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/PlatformChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/PlatformChannel.ets index 8afbc92223..caf39c4916 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/PlatformChannel.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/PlatformChannel.ets @@ -321,7 +321,8 @@ class PlatformMethodCallback implements MethodCallHandler { case "SystemChrome.setApplicationSwitcherDescription": Log.d(PlatformMethodCallback.TAG, "setApplicationSwitcherDescription: " + JSON.stringify(args)); try { - this.platform.platformMessageHandler.setApplicationSwitcherDescription(args); + let description: AppSwitcherDescription = this.decodeAppSwitcherDescription(args); + this.platform.platformMessageHandler.setApplicationSwitcherDescription(description); result.success(null); } catch (err) { Log.e(PlatformMethodCallback.TAG, "setApplicationSwitcherDescription err:" + JSON.stringify(err)); @@ -398,6 +399,12 @@ class PlatformMethodCallback implements MethodCallHandler { } } + private decodeAppSwitcherDescription(encodedDescription: Map): AppSwitcherDescription { + let color: number = encodedDescription.get('color') as number; + let label: string = encodedDescription.get('label') as string; + return new AppSwitcherDescription(color, label); + } + private decodeSystemUiOverlays(encodedSystemUiOverlay: string[]): SystemUiOverlay[] { let overlays: SystemUiOverlay[] = []; for(let i = 0; i < encodedSystemUiOverlay.length; i++) { -- Gitee