From: luozheng <1732036298@qq.com> Date: Mon, 19 Aug 2024 10:49:30 +0000 (+0800) Subject: 显示方式界面添加弧形列表样式,并添加对应资源 X-Git-Tag: release_V1.2.70_20241020_135402~629 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F728%2F3;p=mirrors%2FFD230.git 显示方式界面添加弧形列表样式,并添加对应资源 --- diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h index 061540995..fc0599e31 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h @@ -530,12 +530,13 @@ enum UIResourceTextId : uint16_t { STR_NO_PAIRED_DEV = 517, STR_IGNORE = 518, STR_START = 519, - STR_MAX_ID = 520, + STR_ARC_SCALE_LIST_DISPLAY = 520, + STR_MAX_ID = 521, }; // UIResourceTextId enum FontLanguageId : uint8_t { - LANGUAGE_ID_ZH, LANGUAGE_ID_EN, + LANGUAGE_ID_ZH, LANGUAGE_ID_MAX }; // UITextLanguageTextId } diff --git a/code/sdk/application/wearable/fd230app/nativeui/themestyle/include/ThemeStyleModel.h b/code/sdk/application/wearable/fd230app/nativeui/themestyle/include/ThemeStyleModel.h index 31f82aabe..ce038bf6a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/themestyle/include/ThemeStyleModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/themestyle/include/ThemeStyleModel.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-14 09:40:13 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-07-17 15:29:00 + * @LastEditTime: 2024-08-19 18:44:49 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/themestyle/include/ThemeStyleModel.h */ #ifndef SET_THEMESTYLE_MODEL_H @@ -27,8 +27,8 @@ namespace OHOS { APPLIST_STYLE, // 列表显示 HEXAGONS_STYLE, // 蜂窝显示 + ARC_SCALE_LIST_STYLE,//弧形列表 FOOTBALL_STYLE, //足球 - ARC_SCALE_LIST_STYLE, MAX_THEME_STYLE, } ThemeStyle; diff --git a/code/sdk/application/wearable/fd230app/nativeui/themestyle/include/ThemeStyleView.h b/code/sdk/application/wearable/fd230app/nativeui/themestyle/include/ThemeStyleView.h index c97f73704..b9a870d06 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/themestyle/include/ThemeStyleView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/themestyle/include/ThemeStyleView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-14 09:40:13 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-07-24 20:33:55 + * @LastEditTime: 2024-08-19 18:24:49 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/themestyle/include/ThemeStyleView.h */ @@ -28,11 +28,13 @@ namespace OHOS 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_ARC_LIST = "themestyleArcList"; // 弧形列表 static constexpr char *THEMESTYLEVIEWEXIT = "ThemeStyleViewExit"; // exit 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_ARCLIST_IMAGEPATH = "/user/res/themestyle/grid.bin"; class ThemeStylePresenter; class ThemeStyleView : public View 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 13aa916b1..b43785e8c 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-07-06 18:08:24 + * @LastEditTime: 2024-08-19 18:40:32 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/ThemeStylePresenter.cpp */ @@ -85,6 +85,14 @@ namespace OHOS { ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::FOOTBALL_STYLE); } + else if (viewId == THEME_STYLE_ARC_LIST) + { + ThemeStyleModel::GetInstance().SetAppListDisplayStyle(ThemeStyle::ARC_SCALE_LIST_STYLE); + } + + /* -------------------------------------------------------------------------- */ + view_->UpdateSelectedStyle(); + /* -------------------------------------------------------------------------- */ uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); if (preSlice == VIEW_APPLIST) diff --git a/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleView.cpp b/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleView.cpp index 39ad7f285..f6b970827 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-14 09:40:20 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-07-24 20:43:01 + * @LastEditTime: 2024-08-19 18:48:59 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleView.cpp */ @@ -137,6 +137,9 @@ namespace OHOS scrollView->SetHorizontalScrollState(false); scrollView->RequestFocus(); scrollView->SetRotateFactor(1.0); + scrollView->SetMaxScrollDistance(1000); + scrollView->SetDragACCLevel(5); + scrollView->SetSwipeACCLevel(800); /*设置手指抬起屏幕后的补偿距离。*/ scrollView->SetTouchable(true); scrollView->SetDraggable(true); container_->Add(scrollView); @@ -162,9 +165,7 @@ namespace OHOS titleText->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); scrollView->Add(titleText); /* -------------------------------------------------------------------------- */ - // const char *viewId[MAX_STYLE] = {THEME_STYLE_LIST, THEME_STYLE_HEXAGONS, THEME_STYLE_FOOTBALL}; - // uint16_t textId[MAX_STYLE] = {STR_LIST_DISPLAY, STR_CELLULAR_DISPLAY, STR_GRID_DISPLAY}; - int16_t textId[MAX_STYLE] = {STR_LIST_DISPLAY, STR_CELLULAR_DISPLAY}; + int16_t textId[] = {STR_LIST_DISPLAY, STR_CELLULAR_DISPLAY, STR_ARC_SCALE_LIST_DISPLAY}; LabelConfig labelConfig = { .left = 143, .top = 153, @@ -175,7 +176,7 @@ namespace OHOS .textId = 0, .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; - for (int16_t i = 0; i < MAX_STYLE; i++) + for (int16_t i = 0; i < sizeof(textId) / sizeof(textId[0]); i++) { labelConfig.top = 153 + 120 * i; labelConfig.textId = textId[i]; @@ -216,8 +217,8 @@ namespace OHOS .viewId = THEME_STYLE_LIST, }; - const char *viewId[MAX_STYLE] = {THEME_STYLE_LIST, THEME_STYLE_HEXAGONS}; - for (int i = 0; i < MAX_STYLE; i++) + const char *viewId[] = {THEME_STYLE_LIST, THEME_STYLE_HEXAGONS, THEME_STYLE_ARC_LIST}; + for (int i = 0; i < sizeof(viewId) / sizeof(viewId[0]); i++) { labelbuttonconfig.top = 120 + 120 * i; labelbuttonconfig.viewId = viewId[i]; @@ -257,9 +258,8 @@ namespace OHOS .src = THEMESTYLE_LIST_IMAGEPATH, }; int y = 150; - // const char *src[MAX_STYLE] = {THEMESTYLE_LIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH, THEMESTYLE_FOOTBALL_IMAGEPATH}; - const char *src[MAX_STYLE] = {THEMESTYLE_LIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH}; - for (int i = 0; i < MAX_STYLE; i++) + const char *src[MAX_STYLE] = {THEMESTYLE_LIST_IMAGEPATH, THEMESTYLE_HEXAGONS_IMAGEPATH, THEMESTYLE_ARCLIST_IMAGEPATH}; + for (int i = 0; i < sizeof(src) / sizeof(src[0]); i++) { imageconfig.y = y + 120 * i; imageconfig.src = src[i]; diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang index f39fe487a..0f091fb31 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h index 061540995..fc0599e31 100644 --- a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h @@ -530,12 +530,13 @@ enum UIResourceTextId : uint16_t { STR_NO_PAIRED_DEV = 517, STR_IGNORE = 518, STR_START = 519, - STR_MAX_ID = 520, + STR_ARC_SCALE_LIST_DISPLAY = 520, + STR_MAX_ID = 521, }; // UIResourceTextId enum FontLanguageId : uint8_t { - LANGUAGE_ID_ZH, LANGUAGE_ID_EN, + LANGUAGE_ID_ZH, LANGUAGE_ID_MAX }; // UITextLanguageTextId } diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang index 256771405..f82b5f251 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang differ diff --git a/tools/language_tool/Language_xml/input_list_en.txt b/tools/language_tool/Language_xml/input_list_en.txt index 0d48cace9..86267f05c 100644 --- a/tools/language_tool/Language_xml/input_list_en.txt +++ b/tools/language_tool/Language_xml/input_list_en.txt @@ -517,4 +517,5 @@ STR_SCHEDULE_NO_DATA$No schedules STR_SCHEDULE_NO_DATA_PROMPT$Please sync with the APP STR_NO_PAIRED_DEV$No paired devices are available STR_IGNORE$Ignore -STR_START$Start \ No newline at end of file +STR_START$Start +STR_ARC_SCALE_LIST_DISPLAY$Arc list display \ No newline at end of file diff --git a/tools/language_tool/Language_xml/input_list_zh.txt b/tools/language_tool/Language_xml/input_list_zh.txt index 3ab2aa533..8b688eb3a 100644 --- a/tools/language_tool/Language_xml/input_list_zh.txt +++ b/tools/language_tool/Language_xml/input_list_zh.txt @@ -517,4 +517,5 @@ STR_SCHEDULE_NO_DATA$当前无日程 STR_SCHEDULE_NO_DATA_PROMPT$请先通过APP同步 STR_NO_PAIRED_DEV$暂无已配对设备 STR_IGNORE$忽略 -STR_START$开始 \ No newline at end of file +STR_START$开始 +STR_ARC_SCALE_LIST_DISPLAY$弧形列表显示 \ No newline at end of file diff --git a/tools/language_tool/Language_xml/language.xlsx b/tools/language_tool/Language_xml/language.xlsx index 95c1b8cb0..9dab50fa2 100644 Binary files a/tools/language_tool/Language_xml/language.xlsx and b/tools/language_tool/Language_xml/language.xlsx differ diff --git a/tools/language_tool/Language_xml/language_en.xml b/tools/language_tool/Language_xml/language_en.xml index ed0897d3f..306a5e106 100644 --- a/tools/language_tool/Language_xml/language_en.xml +++ b/tools/language_tool/Language_xml/language_en.xml @@ -519,4 +519,5 @@ + diff --git a/tools/language_tool/Language_xml/language_zh.xml b/tools/language_tool/Language_xml/language_zh.xml index 14b3f0986..8470de53d 100644 --- a/tools/language_tool/Language_xml/language_zh.xml +++ b/tools/language_tool/Language_xml/language_zh.xml @@ -519,4 +519,5 @@ + diff --git a/tools/language_tool/font/en.lang b/tools/language_tool/font/en.lang index f39fe487a..0f091fb31 100644 Binary files a/tools/language_tool/font/en.lang and b/tools/language_tool/font/en.lang differ diff --git a/tools/language_tool/font/ui_resource_string.h b/tools/language_tool/font/ui_resource_string.h index 061540995..fc0599e31 100644 --- a/tools/language_tool/font/ui_resource_string.h +++ b/tools/language_tool/font/ui_resource_string.h @@ -530,12 +530,13 @@ enum UIResourceTextId : uint16_t { STR_NO_PAIRED_DEV = 517, STR_IGNORE = 518, STR_START = 519, - STR_MAX_ID = 520, + STR_ARC_SCALE_LIST_DISPLAY = 520, + STR_MAX_ID = 521, }; // UIResourceTextId enum FontLanguageId : uint8_t { - LANGUAGE_ID_ZH, LANGUAGE_ID_EN, + LANGUAGE_ID_ZH, LANGUAGE_ID_MAX }; // UITextLanguageTextId } diff --git a/tools/language_tool/font/zh.lang b/tools/language_tool/font/zh.lang index 256771405..f82b5f251 100644 Binary files a/tools/language_tool/font/zh.lang and b/tools/language_tool/font/zh.lang differ