From cd7221301f5582da4d2bf6c3edd841a9f103e7a6 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sat, 22 Jun 2024 15:46:48 +0800 Subject: [PATCH] =?utf8?q?=E6=98=BE=E7=A4=BA=E6=96=B9=E5=BC=8FModel?= =?utf8?q?=E6=96=87=E4=BB=B6SetAppListDisplayStyle=E5=87=BD=E6=95=B0?= =?utf8?q?=E6=B7=BB=E5=8A=A0=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=E6=89=93?= =?utf8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/themestyle/src/ThemeStyleModel.cpp | 14 ++++++++++---- .../wearable/nativeabilityfwk/src/Ability.cpp | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleModel.cpp index 6da8835c8..58ba50568 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-07 09:21:47 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-18 14:42:50 + * @LastEditTime: 2024-06-22 15:10:07 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/ThemeStyleModel.cpp */ @@ -10,6 +10,7 @@ #include "kv_store.h" #include "securec.h" #include "wearable_log.h" +#include namespace OHOS { static const int STYLE_VALUE_LEN = 32; @@ -49,13 +50,18 @@ namespace OHOS /// @param style 要设置的风格样式 void ThemeStyleModel::SetAppListDisplayStyle(ThemeStyle style) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThemeStyleModel::SetAppListDisplayStyle"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThemeStyleModel::SetAppListDisplayStyle,style = %d", style); // 检查是否存在对应的样式选项 if (ThemeStyleMap.find(style) != ThemeStyleMap.end()) { // 根据映射设置显示样式值 - (void)UtilsSetValue(THEMESTYLE_KEY, ThemeStyleMap.at(style).c_str()); + int ret = UtilsSetValue(THEMESTYLE_KEY, ThemeStyleMap.at(style).c_str()); + if (ret != EC_SUCCESS) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UtilsSetValue error,ret = %d", ret); + return; + } } else { @@ -63,7 +69,7 @@ namespace OHOS } } - //获取选中的样式Id + // 获取选中的样式Id uint16_t ThemeStyleModel::GetSelectThemeStyleId(void) { return GetAppListDisplayStyle(); diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp b/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp index 114fc4ba8..311cba0e8 100755 --- a/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp +++ b/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp @@ -183,7 +183,7 @@ void Ability::PostChangeSlice(const uint16_t targetSliceId, TransitionType type, void Ability::OnTransitionEnd() { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::OnTransitionEnd"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "Ability::OnTransitionEnd"); if (!sliceTransition_.IsCurrentSnapshotEnabled()) { if (prevSlice_.slice != nullptr) { prevSlice_.slice->OnStop(); -- 2.17.1