From f2f4412d35ee18f345626d56d3050e53e1422368 Mon Sep 17 00:00:00 2001 From: wzp Date: Thu, 14 Dec 2023 10:29:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E6=8B=96=E5=8A=A8=E7=BB=93=E6=9D=9F=E5=90=8E=EF=BC=8C=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E9=80=9A=E7=9F=A5=EF=BC=8C=E8=A7=92=E6=A0=87=E4=B8=8D?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wzp --- .../src/main/ets/default/common/components/SwiperPage.ets | 7 ++++++- .../src/main/ets/default/layout/ResidentLayout.ets | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/feature/pagedesktop/src/main/ets/default/common/components/SwiperPage.ets b/feature/pagedesktop/src/main/ets/default/common/components/SwiperPage.ets index be488206..3914c5ed 100644 --- a/feature/pagedesktop/src/main/ets/default/common/components/SwiperPage.ets +++ b/feature/pagedesktop/src/main/ets/default/common/components/SwiperPage.ets @@ -21,7 +21,8 @@ import { localEventManager, EventConstants, CardItemInfo, - FolderData + FolderData, + BadgeManager } from '@ohos/common'; import AppItem from './AppItem'; import FormItem from './FormItem'; @@ -262,6 +263,10 @@ export default struct SwiperPage { const dragResult = PageDesktopDragHandler.getInstance().onDragDrop(event.getWindowX(), event.getWindowY()); Log.showInfo(TAG, `onDrop dragResult: ${dragResult}`); AppStorage.setOrCreate('selectAppIndex', null); + const dragItemInfo: LauncherDragItemInfo = AppStorage.get('dragItemInfo') as LauncherDragItemInfo; + if (dragItemInfo.bundleName) { + BadgeManager.getInstance().updateBadgeNumber(dragItemInfo.bundleName, dragItemInfo.badgeNumber); + } if (!dragResult) { AppStorage.setOrCreate('dragItemInfo', new LauncherDragItemInfo()); } else { diff --git a/feature/smartdock/src/main/ets/default/layout/ResidentLayout.ets b/feature/smartdock/src/main/ets/default/layout/ResidentLayout.ets index 237bb524..94e3b3aa 100644 --- a/feature/smartdock/src/main/ets/default/layout/ResidentLayout.ets +++ b/feature/smartdock/src/main/ets/default/layout/ResidentLayout.ets @@ -24,7 +24,8 @@ import { StyleConstants, ResourceManager, Log, - MenuInfo + MenuInfo, + BadgeManager } from '@ohos/common'; import { SmartDockStyleConfig } from '../config/SmartDockStyleConfig'; import SmartDockDragHandler from '../common/SmartDockDragHandler'; @@ -122,6 +123,10 @@ export default struct ResidentLayout { Log.showInfo(TAG, `onDrop event: [${event.getWindowX()}, ${event.getWindowY()}]`); const dragResult = SmartDockDragHandler.getInstance().onDragDrop(event.getWindowX(), event.getWindowY()); AppStorage.setOrCreate('selectAppIndex', null); + const dragItemInfo: LauncherDragItemInfo = AppStorage.get('dragItemInfo') as LauncherDragItemInfo; + if (dragItemInfo.bundleName) { + BadgeManager.getInstance().updateBadgeNumber(dragItemInfo.bundleName, dragItemInfo.badgeNumber); + } if (!dragResult) { AppStorage.setOrCreate('dragItemInfo', new LauncherDragItemInfo()); } else {