From 9bd8cb0658bc693c9a41c299dd7d0391994c1889 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 11 Nov 2025 10:47:24 +0800 Subject: [PATCH] =?utf8?q?n9=E5=B1=8F=E8=94=BD=E6=8B=A8=E5=8F=B7=E7=9B=98?= =?utf8?q?=E5=92=8C=E7=80=91=E5=B8=83=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../main/src/dropdown/DropDownCardPage2.cpp | 25 ++++++------------- .../themestyle/include/ThemeStyleView.h | 2 +- .../themestyle/src/ThemeStylePresenter.cpp | 18 +++++++------ .../themestyle/src/ThemeStyleView.cpp | 15 +++++------ 4 files changed, 25 insertions(+), 35 deletions(-) diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp index c8db8dec5..04b96aa78 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/main/src/dropdown/DropDownCardPage2.cpp @@ -29,9 +29,7 @@ namespace OHOS "/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() @@ -68,15 +66,11 @@ namespace OHOS } 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); + toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[0], DROPDOWN_APPLIST_DISPLAY_IMAGE[0]); // 切换到列表 + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::APPLIST_STYLE); } - else if (style == ThemeStyle::WATERFALL_STYLE) + // 如果当前是拨号盘或瀑布流,直接切换到列表 + else if (style == ThemeStyle::CIRCLE_LIST_STYLE || style == ThemeStyle::WATERFALL_STYLE) { toggleButton[2]->SetImages(DROPDOWN_APPLIST_DISPLAY_IMAGE[0], DROPDOWN_APPLIST_DISPLAY_IMAGE[0]); // 切换到列表 ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::APPLIST_STYLE); @@ -161,13 +155,10 @@ namespace OHOS { index = 2; } - else if (style == ThemeStyle::CIRCLE_LIST_STYLE) // 拨号盘 - { - index = 3; - } - else if (style == ThemeStyle::WATERFALL_STYLE) // 瀑布流 + // 如果当前是拨号盘或瀑布流,显示为列表样式 + else if (style == ThemeStyle::CIRCLE_LIST_STYLE || style == ThemeStyle::WATERFALL_STYLE) { - index = 4; + index = 0; } ToggleButtonConfig toggleButtonConfig[] = { diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/include/ThemeStyleView.h b/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/include/ThemeStyleView.h index afac7918a..4f29e0dcc 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/include/ThemeStyleView.h +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/include/ThemeStyleView.h @@ -24,7 +24,7 @@ namespace OHOS { - static constexpr const uint16_t MAX_STYLE = MAX_THEME_STYLE - 1; //直线列表和足球不显示所以删除了两个 + static constexpr const uint16_t MAX_STYLE = MAX_THEME_STYLE - 3; //直线列表和足球不显示所以删除了两个 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/n9/nativeapp/nativeui/themestyle/src/ThemeStylePresenter.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStylePresenter.cpp index d398e03b8..7a9d97860 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStylePresenter.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStylePresenter.cpp @@ -76,18 +76,20 @@ namespace OHOS { ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::FOOTBALL_STYLE); } - else if (viewId == THEME_STYLE_WATERFALL) - { - ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::WATERFALL_STYLE); - } + // 拨号盘和瀑布流已屏蔽,不再处理 + // else if (viewId == THEME_STYLE_WATERFALL) + // { + // ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::WATERFALL_STYLE); + // } else if (viewId == THEME_STYLE_ARC_LIST) { ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::ARC_SCALE_LIST_STYLE); } - else if (viewId == THEME_STYLE_CIRCLE_LIST) - { - ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::CIRCLE_LIST_STYLE); - } + // 拨号盘和瀑布流已屏蔽,不再处理 + // else if (viewId == THEME_STYLE_CIRCLE_LIST) + // { + // ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::CIRCLE_LIST_STYLE); + // } /* -------------------------------------------------------------------------- */ view_->UpdateSelectedStyle(); diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp index 49a0c0770..17981edc7 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStyleView.cpp +++ b/code/sdk/application/wearable/n9/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_LIST_DISPLAY,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}; 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_LIST,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}; 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_LIST_IMAGEPATH,THEMESTYLE_ARCLIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH,THEMESTYLE_CIRCLELIST_IMAGEPATH,THEMESTYLE_WATERFALL_IMAGEPATH}; + const char *src[] = {THEMESTYLE_LIST_IMAGEPATH,THEMESTYLE_ARCLIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH}; for (int i = 0; i < sizeof(src) / sizeof(src[0]); i++) { imageconfig.y = y + 120 * i; @@ -352,13 +352,10 @@ namespace OHOS { index = 2; } - else if (style == ThemeStyle::CIRCLE_LIST_STYLE) + // 如果当前是拨号盘或瀑布流,显示为列表样式 + else if (style == ThemeStyle::CIRCLE_LIST_STYLE || style == ThemeStyle::WATERFALL_STYLE) { - index = 3; - } - else if (style == ThemeStyle::WATERFALL_STYLE) - { - index = 4; + index = 0; } for (int i = 0; i < MAX_STYLE; i++) { -- 2.17.1