From 405ee2b770028c9c4c53904df3f248b717063145 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 14 Oct 2025 12:04:16 +0800 Subject: [PATCH] =?utf8?q?=E4=B8=8B=E6=8B=89=E7=95=8C=E9=9D=A2=E6=B7=BB?= =?utf8?q?=E5=8A=A0=E5=88=87=E6=8D=A2=E6=A0=B7=E5=BC=8F=E6=8C=89=E9=92=AE?= =?utf8?q?=EF=BC=8Cfd230,272=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../main/include/dropdown/DropDownCardPage2.h | 3 +- .../main/src/dropdown/DropDownCardPage2.cpp | 79 ++++++++++++++-- .../themestyle/src/ThemeStyleView.cpp | 20 ++++- .../main/include/dropdown/DropDownCardPage2.h | 3 +- .../main/src/dropdown/DropDownCardPage2.cpp | 89 +++++++++++++++++-- .../themestyle/include/ThemeStyleView.h | 2 +- .../themestyle/src/ThemeStyleView.cpp | 30 ++++++- 7 files changed, 208 insertions(+), 18 deletions(-) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h index d67569cf8..a003fc146 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h @@ -38,10 +38,11 @@ namespace OHOS void ClearAll(); UIToggleButton *GetDropDownCardPage2_ToggleButton(int index); + void SetApplistDisplay(void); private: UIToggleButton *ToggleButtonInit(ToggleButtonConfig &toggleButtonConfig); - UIToggleButton *toggleButton[2]{nullptr}; + UIToggleButton *toggleButton[3]{nullptr}; }; } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp index c14c51cc4..84d9e6577 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp @@ -11,17 +11,27 @@ #include "string" #include "AppViewIDs.h" #include "NativeAbility.h" +#include "themestyle/include/ThemeStyleModel.h" namespace OHOS { // viewId - static constexpr const char *DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID = "dropdown_bt"; // 查找手机 - static constexpr const char *DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID = "dropdown_4g"; // 手电筒 + static constexpr const char *DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID = "dropdown_bt"; // 查找手机 + static constexpr const char *DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID = "dropdown_4g"; // 手电筒 + static constexpr const char *DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID = "dropdown_applist_display"; // 列表样式 // Image src static constexpr const char *DROPDOWN_FINDPHONE_IMAGE = "/user/res/dropdown/DROPDOWN_FINDPHONE.bin"; static constexpr const char *DROPDOWN_LIGHTING_IMAGE = "/user/res/dropdown/DROPDOWN_LIGHTING.bin"; + static constexpr const char *DROPDOWN_APPLIST_DISPLAY_IMAGE[] = + { + "/user/res/themestyle/arclist.bin", // 弧形列表 + "/user/res/themestyle/hexagons.bin", // 蜂窝 + "/user/res/themestyle/dialplate.bin", // 拨号盘 + "/user/res/themestyle/grid.bin", // 瀑布流 + }; + static DropDownCardPage2 *g_pDropDownCardPage2{nullptr}; DropDownCardPage2::DropDownCardPage2() { @@ -42,11 +52,37 @@ namespace OHOS return g_pDropDownCardPage2; } + void DropDownCardPage2::SetApplistDisplay(void) + { + ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle(); + if (style == ThemeStyle::ARC_SCALE_LIST_STYLE) + { + toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[1], DROPDOWN_APPLIST_DISPLAY_IMAGE[2]);// 切换到蜂窝 + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::HEXAGONS_STYLE); + } + else if (style == ThemeStyle::HEXAGONS_STYLE) + { + toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[2], DROPDOWN_APPLIST_DISPLAY_IMAGE[3]); // 切换到拨号盘 + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::CIRCLE_LIST_STYLE); + } + else if (style == ThemeStyle::CIRCLE_LIST_STYLE) + { + toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[3], DROPDOWN_APPLIST_DISPLAY_IMAGE[4]); // 切换到瀑布流 + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::WATERFALL_STYLE); + } + else if (style == ThemeStyle::WATERFALL_STYLE) + { + toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[0], DROPDOWN_APPLIST_DISPLAY_IMAGE[0]); // 切换到列表 + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::ARC_SCALE_LIST_STYLE); + } + + return; + } bool DropDownCardPage2::OnClick(UIView &view, const ClickEvent &event) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DropDownCardPage2::OnClick"); std::string viewId = view.GetViewId(); - if (viewId == DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID) + if (viewId == DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID) { NativeAbility::GetInstance().EnterSlice(VIEW_FIND_PHONE); } @@ -54,6 +90,10 @@ namespace OHOS { NativeAbility::GetInstance().EnterSlice(VIEW_FLASHLIGHT); } + else if (viewId == DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID) + { + SetApplistDisplay(); + } return true; } @@ -80,8 +120,17 @@ namespace OHOS } toggleButton->SetPosition(toggleButtonConfig.left, toggleButtonConfig.top, toggleButtonConfig.width, toggleButtonConfig.height); toggleButton->SetViewId(toggleButtonConfig.viewId); - toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200); + if (toggleButtonConfig.viewId == DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID) + { + toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + toggleButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200); + } + else + { + toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200); + } toggleButton->SetImages(toggleButtonConfig.selectImg, toggleButtonConfig.unselectImg); toggleButton->SetTouchable(toggleButtonConfig.isTouchable); @@ -92,9 +141,29 @@ namespace OHOS bool DropDownCardPage2::InitPage(void) { int size = sizeof(toggleButton) / sizeof(toggleButton[0]); + ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle(); + int index = 0; + if (style == ThemeStyle::ARC_SCALE_LIST_STYLE) // 弧形列表 + { + index = 0; + } + else if (style == ThemeStyle::HEXAGONS_STYLE) // 蜂窝 + { + index = 1; + } + else if (style == ThemeStyle::CIRCLE_LIST_STYLE) // 拨号盘 + { + index = 2; + } + else if (style == ThemeStyle::WATERFALL_STYLE) // 瀑布流 + { + index = 3; + } + ToggleButtonConfig toggleButtonConfig[] = { {0, 0, 100, 100, DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID, DROPDOWN_FINDPHONE_IMAGE, DROPDOWN_FINDPHONE_IMAGE, true}, {110, 0, 100, 100, DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID, DROPDOWN_LIGHTING_IMAGE, DROPDOWN_LIGHTING_IMAGE, true}, + {220, 0, 100, 100, DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID, DROPDOWN_APPLIST_DISPLAY_IMAGE[index], DROPDOWN_APPLIST_DISPLAY_IMAGE[index], true}, }; for (int i = 0; i < size; i++) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp index 42695067f..148a98300 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp @@ -338,9 +338,27 @@ namespace OHOS // 更新按钮的选中状态 void ThemeStyleView::UpdateSelectedStyle(void) { + ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle(); + int index = 0; + if (style == ThemeStyle::ARC_SCALE_LIST_STYLE) + { + index = 0; + } + else if (style == ThemeStyle::HEXAGONS_STYLE) + { + index = 1; + } + else if (style == ThemeStyle::CIRCLE_LIST_STYLE) + { + index = 2; + } + else if (style == ThemeStyle::WATERFALL_STYLE) + { + index = 3; + } for (int i = 0; i < MAX_STYLE; i++) { - if (i == presenter_->GetSelectThemeStyleId()) + if (i == index) { ThemeStyleLabelButton[i]->SetImageSrc(PNG_CHECKBOX_ON_IMAGE, PNG_CHECKBOX_ON_IMAGE); } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h index d67569cf8..a003fc146 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/include/dropdown/DropDownCardPage2.h @@ -38,10 +38,11 @@ namespace OHOS void ClearAll(); UIToggleButton *GetDropDownCardPage2_ToggleButton(int index); + void SetApplistDisplay(void); private: UIToggleButton *ToggleButtonInit(ToggleButtonConfig &toggleButtonConfig); - UIToggleButton *toggleButton[2]{nullptr}; + UIToggleButton *toggleButton[3]{nullptr}; }; } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp index c14c51cc4..c8db8dec5 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp @@ -11,17 +11,28 @@ #include "string" #include "AppViewIDs.h" #include "NativeAbility.h" +#include "themestyle/include/ThemeStyleModel.h" namespace OHOS { // viewId - static constexpr const char *DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID = "dropdown_bt"; // 查找手机 - static constexpr const char *DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID = "dropdown_4g"; // 手电筒 + static constexpr const char *DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID = "dropdown_bt"; // 查找手机 + static constexpr const char *DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID = "dropdown_4g"; // 手电筒 + static constexpr const char *DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID = "dropdown_applist_display"; // 列表样式 // Image src static constexpr const char *DROPDOWN_FINDPHONE_IMAGE = "/user/res/dropdown/DROPDOWN_FINDPHONE.bin"; static constexpr const char *DROPDOWN_LIGHTING_IMAGE = "/user/res/dropdown/DROPDOWN_LIGHTING.bin"; + static constexpr const char *DROPDOWN_APPLIST_DISPLAY_IMAGE[] = + { + "/user/res/themestyle/list.bin", // 列表 + "/user/res/themestyle/arclist.bin", // 弧形列表 + "/user/res/themestyle/hexagons.bin", // 蜂窝 + "/user/res/themestyle/dialplate.bin", // 拨号盘 + "/user/res/themestyle/grid.bin", // 瀑布流 + }; + static DropDownCardPage2 *g_pDropDownCardPage2{nullptr}; DropDownCardPage2::DropDownCardPage2() { @@ -42,11 +53,42 @@ namespace OHOS return g_pDropDownCardPage2; } + void DropDownCardPage2::SetApplistDisplay(void) + { + ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle(); + if (style == ThemeStyle::APPLIST_STYLE) + { + toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[1], DROPDOWN_APPLIST_DISPLAY_IMAGE[1]); // 切换到弧形列表 + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::ARC_SCALE_LIST_STYLE); + } + else if (style == ThemeStyle::ARC_SCALE_LIST_STYLE) + { + toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[2], DROPDOWN_APPLIST_DISPLAY_IMAGE[2]);// 切换到蜂窝 + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::HEXAGONS_STYLE); + } + else if (style == ThemeStyle::HEXAGONS_STYLE) + { + toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[3], DROPDOWN_APPLIST_DISPLAY_IMAGE[3]); // 切换到拨号盘 + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::CIRCLE_LIST_STYLE); + } + else if (style == ThemeStyle::CIRCLE_LIST_STYLE) + { + toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[4], DROPDOWN_APPLIST_DISPLAY_IMAGE[4]); // 切换到瀑布流 + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::WATERFALL_STYLE); + } + else if (style == ThemeStyle::WATERFALL_STYLE) + { + toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[0], DROPDOWN_APPLIST_DISPLAY_IMAGE[0]); // 切换到列表 + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::APPLIST_STYLE); + } + + return; + } bool DropDownCardPage2::OnClick(UIView &view, const ClickEvent &event) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DropDownCardPage2::OnClick"); std::string viewId = view.GetViewId(); - if (viewId == DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID) + if (viewId == DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID) { NativeAbility::GetInstance().EnterSlice(VIEW_FIND_PHONE); } @@ -54,6 +96,10 @@ namespace OHOS { NativeAbility::GetInstance().EnterSlice(VIEW_FLASHLIGHT); } + else if (viewId == DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID) + { + SetApplistDisplay(); + } return true; } @@ -80,8 +126,17 @@ namespace OHOS } toggleButton->SetPosition(toggleButtonConfig.left, toggleButtonConfig.top, toggleButtonConfig.width, toggleButtonConfig.height); toggleButton->SetViewId(toggleButtonConfig.viewId); - toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200); + if (toggleButtonConfig.viewId == DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID) + { + toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + toggleButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200); + } + else + { + toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + toggleButton->SetStyle(STYLE_BORDER_RADIUS, 200); + } toggleButton->SetImages(toggleButtonConfig.selectImg, toggleButtonConfig.unselectImg); toggleButton->SetTouchable(toggleButtonConfig.isTouchable); @@ -92,9 +147,33 @@ namespace OHOS bool DropDownCardPage2::InitPage(void) { int size = sizeof(toggleButton) / sizeof(toggleButton[0]); + ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle(); + int index = 0; + if (style == ThemeStyle::APPLIST_STYLE) // 列表 + { + index = 0; + } + else if (style == ThemeStyle::ARC_SCALE_LIST_STYLE) // 弧形列表 + { + index = 1; + } + else if (style == ThemeStyle::HEXAGONS_STYLE) // 蜂窝 + { + index = 2; + } + else if (style == ThemeStyle::CIRCLE_LIST_STYLE) // 拨号盘 + { + index = 3; + } + else if (style == ThemeStyle::WATERFALL_STYLE) // 瀑布流 + { + index = 4; + } + ToggleButtonConfig toggleButtonConfig[] = { {0, 0, 100, 100, DROPDOWN_FINDPHONE_TOGGLEBUTTON_VIEWID, DROPDOWN_FINDPHONE_IMAGE, DROPDOWN_FINDPHONE_IMAGE, true}, {110, 0, 100, 100, DROPDOWN_LIGHTING_TOGGLEBUTTON_VIEWID, DROPDOWN_LIGHTING_IMAGE, DROPDOWN_LIGHTING_IMAGE, true}, + {220, 0, 100, 100, DROPDOWN_APPLIST_DISPLAY_TOGGLEBUTTON_VIEWID, DROPDOWN_APPLIST_DISPLAY_IMAGE[index], DROPDOWN_APPLIST_DISPLAY_IMAGE[index], true}, }; for (int i = 0; i < size; i++) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/include/ThemeStyleView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/include/ThemeStyleView.h index a400b0360..afac7918a 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/include/ThemeStyleView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/include/ThemeStyleView.h @@ -24,7 +24,7 @@ namespace OHOS { - static constexpr const uint16_t MAX_STYLE = MAX_THEME_STYLE - 2; //直线列表和足球不显示所以删除了两个 + static constexpr const uint16_t MAX_STYLE = MAX_THEME_STYLE - 1; //直线列表和足球不显示所以删除了两个 static constexpr char *THEME_STYLE_LIST = "themestyleList"; // 列表 static constexpr char *THEME_STYLE_HEXAGONS = "themestyleHexagons"; // 蜂窝 static constexpr char *THEME_STYLE_FOOTBALL = "themestyleFootball"; // 足球 diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp index 42695067f..49a0c0770 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp @@ -182,7 +182,7 @@ namespace OHOS scrollView->Add(titleText); /* -------------------------------------------------------------------------- */ // int16_t textId[] = {STR_LIST_DISPLAY, STR_CELLULAR_DISPLAY, STR_ARC_SCALE_LIST_DISPLAY,STR_DIAL_PLATE}; - int16_t textId[] = {STR_ARC_SCALE_LIST_DISPLAY, STR_CELLULAR_DISPLAY,STR_DIAL_PLATE,STR_WATERFALL_DISPLAY}; + int16_t textId[] = {STR_LIST_DISPLAY,STR_ARC_SCALE_LIST_DISPLAY, STR_CELLULAR_DISPLAY,STR_DIAL_PLATE,STR_WATERFALL_DISPLAY}; LabelConfig labelConfig = { .left = 143, .top = 153, @@ -235,7 +235,7 @@ namespace OHOS }; // const char *viewId[] = {THEME_STYLE_LIST, THEME_STYLE_HEXAGONS, THEME_STYLE_ARC_LIST,THEME_STYLE_CIRCLE_LIST}; - const char *viewId[] = {THEME_STYLE_ARC_LIST, THEME_STYLE_HEXAGONS,THEME_STYLE_CIRCLE_LIST,THEME_STYLE_WATERFALL}; + const char *viewId[] = {THEME_STYLE_LIST,THEME_STYLE_ARC_LIST, THEME_STYLE_HEXAGONS,THEME_STYLE_CIRCLE_LIST,THEME_STYLE_WATERFALL}; for (int i = 0; i < sizeof(viewId) / sizeof(viewId[0]); i++) { labelbuttonconfig.top = 120 + 120 * i; @@ -277,7 +277,7 @@ namespace OHOS }; int y = 150; // const char *src[MAX_STYLE] = {THEMESTYLE_LIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH, THEMESTYLE_ARCLIST_IMAGEPATH,THEMESTYLE_CIRCLELIST_IMAGEPATH}; - const char *src[] = {THEMESTYLE_ARCLIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH,THEMESTYLE_CIRCLELIST_IMAGEPATH,THEMESTYLE_WATERFALL_IMAGEPATH}; + const char *src[] = {THEMESTYLE_LIST_IMAGEPATH,THEMESTYLE_ARCLIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH,THEMESTYLE_CIRCLELIST_IMAGEPATH,THEMESTYLE_WATERFALL_IMAGEPATH}; for (int i = 0; i < sizeof(src) / sizeof(src[0]); i++) { imageconfig.y = y + 120 * i; @@ -338,9 +338,31 @@ namespace OHOS // 更新按钮的选中状态 void ThemeStyleView::UpdateSelectedStyle(void) { + ThemeStyle style = ThemeStyleModel::GetInstance().GetAppListDisplayStyle(); + int index = 0; + if (style == ThemeStyle::APPLIST_STYLE) + { + index = 0; + } + else if (style == ThemeStyle::ARC_SCALE_LIST_STYLE) + { + index = 1; + } + else if (style == ThemeStyle::HEXAGONS_STYLE) + { + index = 2; + } + else if (style == ThemeStyle::CIRCLE_LIST_STYLE) + { + index = 3; + } + else if (style == ThemeStyle::WATERFALL_STYLE) + { + index = 4; + } for (int i = 0; i < MAX_STYLE; i++) { - if (i == presenter_->GetSelectThemeStyleId()) + if (i == index) { ThemeStyleLabelButton[i]->SetImageSrc(PNG_CHECKBOX_ON_IMAGE, PNG_CHECKBOX_ON_IMAGE); } -- 2.17.1