From c7ebf7a3aafa394f5e181d80d95c30aa57190c95 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Fri, 14 Jun 2024 19:46:48 +0800 Subject: [PATCH] =?utf8?q?applist=E4=B8=8E=E4=B8=BB=E9=A2=98=E6=A0=B7?= =?utf8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/applist/src/ApplistModel.cpp | 3 +- .../themestyle/src/ThemeStylePresenter.cpp | 40 ++++++++++--------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp index dfcff847a..25105cb27 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp @@ -20,6 +20,7 @@ #include "ApplistModel.h" #include "ApplistPresenter.h" #include "SetDesktopModel.h" +#include "themestyle/include/ThemeStyleModel.h" namespace OHOS { @@ -195,6 +196,6 @@ namespace OHOS bool ApplistModel::GetIsUseListStyle(void) { - return (SetDesktopModel::GetInstance().GetDesktopStyle() == APPLIST_STYLE); + return (ThemeStyleModel::GetInstance().GetAppListDisplayStyle() == APPLIST_STYLE); } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStylePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStylePresenter.cpp index 956a9a7ee..3771bf5ea 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStylePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStylePresenter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-08 16:43:48 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-14 19:14:53 + * @LastEditTime: 2024-06-14 19:39:03 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/ThemeStylePresenter.cpp */ @@ -65,26 +65,28 @@ namespace OHOS NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); return true; } - /* -------------------------------------------------------------------------- */ - if (viewId == THEME_STYLE_LIST) - { - ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::APPLIST_STYLE); - } - else if (viewId == THEME_STYLE_HEXAGONS) - { - ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::HEXAGONS_STYLE); - } - LabelButtonExt->SetImageSrc(PNG_CHECKBOX_ON_IMAGE, PNG_CHECKBOX_ON_IMAGE); - LabelButtonExt->Invalidate(); - uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); - if (preSlice == VIEW_APPLIST) - { - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); - } else { - NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); - NativeAbility::GetInstance().ClearSliceIdStack(); + if (viewId == THEME_STYLE_LIST) + { + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::APPLIST_STYLE); + } + else if (viewId == THEME_STYLE_HEXAGONS) + { + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::HEXAGONS_STYLE); + } + // LabelButtonExt->SetImageSrc(PNG_CHECKBOX_ON_IMAGE, PNG_CHECKBOX_ON_IMAGE); + // LabelButtonExt->Invalidate(); + uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + if (preSlice == VIEW_APPLIST) + { + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); + } + else + { + NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); + NativeAbility::GetInstance().ClearSliceIdStack(); + } } return true; -- 2.17.1