From: luozheng <1732036298@qq.com> Date: Tue, 20 May 2025 07:37:09 +0000 (+0800) Subject: 显示样式添加瀑布流 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~299 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=c46980490655a605d31c4a8ed5465a0f0889f5a7;p=mirrors%2FFD230.git 显示样式添加瀑布流 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp index 453781e54..1e2e9ae13 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp @@ -129,9 +129,10 @@ REGIST_SLICE(VIEW_APPLIST, ApplistView, ApplistPresenter); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ApplistPresenter::OnClick viewid = %d", viewId); if (viewId < VIEW_MAX_INTER_APP) { if (viewId == VIEW_SETTING && style == AppListStyle::APPLIST_STYLE) { - NativeAbility::GetInstance().EnterSlice(viewId, type, gSliceDefaultPriority, true); + // NativeAbility::GetInstance().EnterSlice(viewId, type, gSliceDefaultPriority, true); + NativeAbility::GetInstance().EnterSlice(viewId, type); } else { - NativeAbility::GetInstance().EnterSlice(viewId, type, gSliceDefaultPriority, true); + NativeAbility::GetInstance().EnterSlice(viewId, type); } return true; } else if (viewId == VIEW_EXTERN_APP) { diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistView.cpp index 86d94b7d7..fe03ab572 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistView.cpp @@ -85,10 +85,13 @@ void ApplistView::OnStart() FootballStyleOnStart(); } else if (style == AppListStyle::HEXAGONS_STYLE) { HexagonsStyleOnStart(); + } else if (style == AppListStyle::WATERFALL_STYLE) { + WaterfallStyleOnStart(); } else if(style == AppListStyle::ARC_SCALE_LIST_STYLE) { ArcScaleListStyleOnStart(); } else if(style == AppListStyle::CIRCLE_LIST_STYLE) { // CircleListStyleOnStart(); + ListStyleOnStart();// 暂时未合并拨号盘样式,使用列表样式代替 } else { ListStyleOnStart(); } @@ -497,7 +500,7 @@ void ApplistView::ClearAppItemToList() HexagonsStyleOnStop(); } else if (style == AppListStyle::WATERFALL_STYLE) { WaterfallStyleOnStop(); - } else if(AppListStyle::ARC_SCALE_LIST_STYLE == style) { + } else if(style == AppListStyle::ARC_SCALE_LIST_STYLE) { ArcScaleListStyleOnStop(); } else { listAdapter_->ClearItem(); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/include/SettingPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/include/SettingPresenter.h index c29e368f0..5f0ba2339 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/include/SettingPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/include/SettingPresenter.h @@ -31,9 +31,6 @@ namespace OHOS int GetListItemNum(); void OnStart() override; - void OnResume() override; - void OnPause() override; - void OnStop() override; bool OnClick(UIView &view, const ClickEvent &event) override; bool OnDrag(UIView &view, const DragEvent &event) override; diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/src/SettingPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/src/SettingPresenter.cpp index 2b41e696c..5fc810cdf 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/src/SettingPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/src/SettingPresenter.cpp @@ -77,7 +77,6 @@ namespace OHOS void SettingPresenter::OnStart() { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SettingPresenter::OnStart"); - Presenter::OnStart(); settingModel->InitSettingItem(); if (view_ == nullptr) @@ -89,24 +88,6 @@ namespace OHOS view_->RefreshSettingList(itemInfo); } - void SettingPresenter::OnResume(void) - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingPresenter::OnResume"); - } - - // 页面准备切换到后台前执行的逻辑 - void SettingPresenter::OnPause(void) - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingPresenter::OnPause"); - Presenter::OnPause(); - } - - void SettingPresenter::OnStop(void) - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingPresenter::OnStop"); - return; - } - bool SettingPresenter::OnDrag(UIView &view, const DragEvent &event) { UNUSED(view); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStyleModel.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStyleModel.h index f194cec42..9620dacbb 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStyleModel.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStyleModel.h @@ -22,6 +22,7 @@ namespace OHOS static constexpr const char *THEMESTYLE_VALUE_LIST = "list"; static constexpr const char *THEMESTYLE_VALUE_HEXAGONS = "hexagons"; static constexpr const char *THEMESTYLE_VALUE_FOOTBALL = "football"; + static constexpr const char *THEMESTYLE_VALUE_WATERFALL = "waterfall"; static constexpr const char *THEMESTYLE_VALUE_ARC_SCALE_LIST = "arc_scale_list"; static constexpr const char *THEMESTYLE_VALUE_CIRCLE_LIST = "circle_list"; @@ -30,9 +31,9 @@ namespace OHOS ARC_SCALE_LIST_STYLE,//弧形列表 HEXAGONS_STYLE, // 蜂窝显示 CIRCLE_LIST_STYLE,//拨号盘 + WATERFALL_STYLE, // 瀑布流显示 APPLIST_STYLE, // 列表显示 FOOTBALL_STYLE, //足球 - WATERFALL_STYLE, MAX_THEME_STYLE, } ThemeStyle; @@ -41,6 +42,7 @@ namespace OHOS {ThemeStyle::APPLIST_STYLE, THEMESTYLE_VALUE_LIST}, {ThemeStyle::HEXAGONS_STYLE, THEMESTYLE_VALUE_HEXAGONS}, {ThemeStyle::FOOTBALL_STYLE, THEMESTYLE_VALUE_FOOTBALL}, + {ThemeStyle::WATERFALL_STYLE, THEMESTYLE_VALUE_WATERFALL}, {ThemeStyle::ARC_SCALE_LIST_STYLE, THEMESTYLE_VALUE_ARC_SCALE_LIST}, {ThemeStyle::CIRCLE_LIST_STYLE, THEMESTYLE_VALUE_CIRCLE_LIST}, // 在此处添加更多的映射关系 @@ -51,6 +53,7 @@ namespace OHOS {THEMESTYLE_VALUE_LIST, ThemeStyle::APPLIST_STYLE}, {THEMESTYLE_VALUE_HEXAGONS, ThemeStyle::HEXAGONS_STYLE}, {THEMESTYLE_VALUE_FOOTBALL, ThemeStyle::FOOTBALL_STYLE}, + {THEMESTYLE_VALUE_WATERFALL, ThemeStyle::WATERFALL_STYLE}, {THEMESTYLE_VALUE_ARC_SCALE_LIST, ThemeStyle::ARC_SCALE_LIST_STYLE}, {THEMESTYLE_VALUE_CIRCLE_LIST, ThemeStyle::CIRCLE_LIST_STYLE}, // 在此处添加更多的映射关系 diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStylePresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStylePresenter.h index 61a16e946..eb2c7e54d 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStylePresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStylePresenter.h @@ -28,9 +28,6 @@ namespace OHOS ThemeStyle GetSelectThemeStyleId(void); void OnStart() override; - void OnPause() override; - void OnResume() override; - void OnStop() override; private: bool OnClick(UIView &view, const ClickEvent &event) override; diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStyleView.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStyleView.h index 4cdde8199..a400b0360 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStyleView.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/include/ThemeStyleView.h @@ -24,10 +24,11 @@ namespace OHOS { - static constexpr const uint16_t MAX_STYLE = MAX_THEME_STYLE - 3; //直线列表和足球不显示所以删除了两个 + static constexpr const uint16_t MAX_STYLE = MAX_THEME_STYLE - 2; //直线列表和足球不显示所以删除了两个 static constexpr char *THEME_STYLE_LIST = "themestyleList"; // 列表 static constexpr char *THEME_STYLE_HEXAGONS = "themestyleHexagons"; // 蜂窝 static constexpr char *THEME_STYLE_FOOTBALL = "themestyleFootball"; // 足球 + static constexpr char *THEME_STYLE_WATERFALL = "themestyleWaterFall"; // 瀑布流 static constexpr char *THEME_STYLE_ARC_LIST = "themestyleArcList"; // 弧形列表 static constexpr char *THEME_STYLE_CIRCLE_LIST = "themestyleCircleList"; // 拨号盘 static constexpr char *THEMESTYLEVIEWEXIT = "ThemeStyleViewExit"; // exit @@ -35,6 +36,7 @@ namespace OHOS static constexpr char *THEMESTYLE_LIST_IMAGEPATH = "/user/res/themestyle/list.bin"; static constexpr char *THEMESTYLE_HEXAGONS_IMAGEPATH = "/user/res/themestyle/hexagons.bin"; static constexpr char *THEMESTYLE_FOOTBALL_IMAGEPATH = "/user/res/themestyle/grid.bin"; + static constexpr char *THEMESTYLE_WATERFALL_IMAGEPATH = "/user/res/themestyle/grid.bin"; static constexpr char *THEMESTYLE_ARCLIST_IMAGEPATH = "/user/res/themestyle/arclist.bin"; static constexpr char *THEMESTYLE_CIRCLELIST_IMAGEPATH = "/user/res/themestyle/dialplate.bin"; diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleModel.cpp index 2443b75f6..4498c85c1 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStyleModel.cpp @@ -73,6 +73,8 @@ namespace OHOS /*通过power建切换applist的样式*/ void ThemeStyleModel::SwitchApplistStyleOnPowerClick(void) { + //按键切换样式 + #if 0 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThemeStyleModel::SwitchApplistStyleOnPowerClick"); uint16_t style = GetAppListDisplayStyle(); style += 1; @@ -86,6 +88,7 @@ namespace OHOS } SetAppListDisplayStyle(static_cast(style)); return; + #endif } /*设置上一个applist的显示样式*/ diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStylePresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStylePresenter.cpp index 8817b37ef..51e30f24d 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStylePresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/themestyle/src/ThemeStylePresenter.cpp @@ -38,25 +38,7 @@ namespace OHOS return g_pThemeStylePresenter; } - void ThemeStylePresenter::OnStart() - { - Presenter::OnStart(); - } - - void ThemeStylePresenter::OnPause() - { - Presenter::OnPause(); - } - - void ThemeStylePresenter::OnResume(void) - { - Presenter::OnResume(); - } - - void ThemeStylePresenter::OnStop(void) - { - Presenter::OnStop(); - } + void ThemeStylePresenter::OnStart(){} bool ThemeStylePresenter::OnClick(UIView &view, const ClickEvent &event) { @@ -89,6 +71,10 @@ 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_ARC_LIST) { ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::ARC_SCALE_LIST_STYLE); 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 f38d8df41..ab18c6fb8 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 @@ -181,7 +181,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}; + int16_t textId[] = {STR_ARC_SCALE_LIST_DISPLAY, STR_CELLULAR_DISPLAY,STR_DIAL_PLATE,STR_DIAL_PLATE}; LabelConfig labelConfig = { .left = 143, .top = 153, @@ -234,7 +234,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}; + const char *viewId[] = {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; @@ -276,7 +276,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}; + const char *src[] = {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; @@ -326,8 +326,6 @@ namespace OHOS void ThemeStyleView::OnStart() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThemeStyleView::OnStart"); - View::OnStart(); - if (!initViewStatus) { ThemeStyleViewInit();