From: luozheng <1732036298@qq.com>
Date: Thu, 25 Jul 2024 12:12:00 +0000 (+0800)
Subject: 系统界面优化修改
X-Git-Tag: release_V1.2.70_20241020_135402~749
X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=a84805bbe8aa138d82a1dacb7d124f05ad3a7e82;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 9c6e32b5d..79675426c 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
@@ -487,7 +487,8 @@ enum UIResourceTextId : uint16_t {
STR_AIMODES_CHATGPT = 474,
STR_SLIDE_TO_SHUTDOWN = 475,
STR_SLIDE_TO_REBOOT = 476,
- STR_MAX_ID = 477,
+ STR_AI_FAMILY_MEALS = 477,
+ STR_MAX_ID = 478,
}; // UIResourceTextId
enum FontLanguageId : uint8_t {
diff --git a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp
index 03426d4c3..1fb02b4c1 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp
+++ b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp
@@ -23,73 +23,69 @@
namespace OHOS
{
/**- APPLSIT
+ * - ææº
* - å¿ç
* - è¡æ°§
* - è®ç»
* - è®ç»è®°å½
- * - æåé
- * - çµè¯
- * - 常ç¨è系人
- * - 天æ°
* - æ´»å¨
- * - æ´æ¢è¡¨ç
- * - æ¾ç¤ºæ¹å¼
- * - å¡ç管ç
- * - é³ä¹
- * - ç¡ç
+ * - æå¿ä¸è¨
+ * - è±å
+ * - KIMI
+ * - ChatGPT
+ * - æ¯ä»å®
+ * - æ¶æ¯éç¥
+ * - æåé
* - å½é³
+ * - æçµç
+ * - 天æ°
+ * - ç§è¡¨
+ * - 计æ¶å¨
* - å¼å¸è®ç»
* - 饿§æç
§
- * - è¯è¨å©æ
- * - æ¯ä»å®
- * - 计æ¶å¨
* - é¹é
- * - ç§è¡¨
- * - 计ç®å¨
- * - æ¥æ¾ææº
- * - 亮度è°è
* - 声é³
- * - èç
+ * - æ¥æ¾ææº
+ * - å¿æ°æ¨¡å¼
+ * - å¡ç管ç
* - å¿æ°æ¨¡å¼
- * - æ¶æ¯éç¥
* - ççµæ¨¡å¼
- * - AIVoice
- * - æçµç
* - 设置
*/
const AppItem g_nativeAppList[] = {
- {VIEW_BLOODOXY, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_DEFAULT_IMG, "è¡æ°§", STR_BLOOD_OXYGEN, nullptr},
+ {VIEW_MAIN_PHONE, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_DEFAULT_IMG, "ææº", STR_PHONE, nullptr},
{VIEW_HEART, PNG_APPLIST_HEART_IMAGE, PNG_APPLIST_HEART_IMAGE, PNG_APPLIST_DEFAULT_IMG, "å¿ç", STR_HEART_RATE, nullptr},
+ {VIEW_BLOODOXY, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_DEFAULT_IMG, "è¡æ°§", STR_BLOOD_OXYGEN, nullptr},
{VIEW_TRAINING, PNG_APPLIST_TRAINING_IMAGE, PNG_APPLIST_TRAINING_IMAGE, PNG_APPLIST_DEFAULT_IMG, "è®ç»", STR_TRAINING, nullptr},
{VIEW_TRAINING_RECORD, PNG_APPLIST_TRAINING_RECORD_IMAGE, PNG_APPLIST_TRAINING_RECORD_IMAGE, PNG_APPLIST_DEFAULT_IMG, "è®ç»è®°å½", STR_TRAINING_RECORD, nullptr},
- {VIEW_COMPASS, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æåé", STR_COMPASS, nullptr},
- {VIEW_MAIN_PHONE, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_DEFAULT_IMG, "çµè¯", STR_PHONE, nullptr},
- {VIEW_PHONEDIR, PNG_APPLIST_CALLLOG_IMAGE, PNG_APPLIST_CALLLOG_IMAGE, PNG_APPLIST_DEFAULT_IMG, "常ç¨è系人", STR_FAVORITE_CONTACTS, nullptr},
- {VIEW_WEATHER, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_DEFAULT_IMG, "天æ°", STR_WEATHER, nullptr},
{VIEW_GOAL, PNG_APPLIST_GOAL_IMAGE, PNG_APPLIST_GOAL_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æ´»å¨", STR_ACTIVITY, nullptr},
- {VIEW_SET_DIAL_STYLE, PNG_APPLIST_CHANGEDIAL_IMAGE, PNG_APPLIST_CHANGEDIAL_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æ´æ¢è¡¨ç", STR_WATCH_FACE, nullptr},
- {VIEW_THEME_STYLE, PNG_APPLIST_THEME_IMAGE, PNG_APPLIST_THEME_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æ¾ç¤ºæ¹å¼", STR_DISPLAY_MODE, nullptr},
- {VIEW_ADD_CARD, PNG_APPLIST_CARDSET_IMAGE, PNG_APPLIST_CARDSET_IMAGE, PNG_APPLIST_DEFAULT_IMG, "å¡ç管ç", STR_CARD_MANAGEMENT, nullptr},
- {VIEW_SLEEP, PNG_APPLIST_SLEEP_IMAGE, PNG_APPLIST_SLEEP_IMAGE, PNG_APPLIST_DEFAULT_IMG, "ç¡ç ", STR_SLEEP, nullptr},
- {VIEW_RECORD, PNG_APPLIST_RECORD_IMAGE, PNG_APPLIST_RECORD_IMAGE, PNG_APPLIST_DEFAULT_IMG, "å½é³", STR_RECORD, nullptr},
- {VIEW_RESPIRATORY_TRAINING, PNG_APPLIST_BREATHE_IMAGE, PNG_APPLIST_BREATHE_IMAGE, PNG_APPLIST_DEFAULT_IMG, "å¼å¸è®ç»", STR_BREATH_TRAINING, nullptr},
- {VIEW_TAKEPHOTOS, PNG_APPLIST_TACKEPHOTOS_IMAGE, PNG_APPLIST_TACKEPHOTOS_IMAGE, PNG_APPLIST_DEFAULT_IMG, "饿§æç
§", STR_REMOTE_SHOOTING, nullptr},
+ {VIEW_AI_VOICE, PNG_APPLIST_GOAL_IMAGE, PNG_APPLIST_GOAL_IMAGE, PNG_APPLIST_DEFAULT_IMG, "AIå
¨å®¶æ¡¶", STR_AI_FAMILY_MEALS, nullptr},
#ifdef SUPPORT_ALIPAY_SEC
{VIEW_MAIN_ALIPAY, PNG_APPLIST_ALIPAY_IMAGE, PNG_APPLIST_ALIPAY_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æ¯ä»å®", STR_ALIPAY, nullptr},
#endif
- {VIEW_MAIN_COUNTDOWN, PNG_APPLIST_COUNTDOWN_IMAGE, PNG_APPLIST_COUNTDOWN_IMAGE, PNG_APPLIST_DEFAULT_IMG,"计æ¶å¨", STR_TIMER, nullptr},
- {VIEW_MAIN_ALARM, PNG_APPLIST_ALARM_IMAGE, PNG_APPLIST_ALARM_IMAGE,PNG_APPLIST_DEFAULT_IMG,"é¹é", STR_ALARM, nullptr},
- {VIEW_MAIN_STOPWATCH, PNG_APPLIST_STOPWATCH_IMAGE, PNG_APPLIST_STOPWATCH_IMAGE,PNG_APPLIST_DEFAULT_IMG, "ç§è¡¨", STR_STOPWATCH, nullptr},
- {VIEW_FIND_PHONE, PNG_APPLIST_FINDPHONE_IMAGE, PNG_APPLIST_FINDPHONE_IMAGE, PNG_APPLIST_DEFAULT_IMG,"æ¥æ¾ææº", STR_FIND_PHONE, nullptr},
- {VIEW_BRIGHTNESSLEVEL, PNG_APPLIST_BRIGHTNESSLEVEL_IMAGE, PNG_APPLIST_BRIGHTNESSLEVEL_IMAGE, PNG_APPLIST_DEFAULT_IMG,"亮度è°è", STR_BRIGHTNESS_ADJUSTMENT, nullptr},
- {VIEW_SOUND_VIBRATION, PNG_APPLIST_VOICE_IMAGE, PNG_APPLIST_VOICE_IMAGE, PNG_APPLIST_DEFAULT_IMG,"声é³", STR_SOUND, nullptr},
- {VIEW_CLASSIC_BLUETOOTH, PNG_APPLIST_BLUETOOTH_IMAGE, PNG_APPLIST_BLUETOOTH_IMAGE, PNG_APPLIST_DEFAULT_IMG,"èç", STR_BLUETOOTH, nullptr},
- {VIEW_DNOTDISTURB, PNG_APPLIST_DISTURB_IMAGE, PNG_APPLIST_DISTURB_IMAGE, PNG_APPLIST_DEFAULT_IMG,"å¿æ°æ¨¡å¼", STR_DO_NOT_DISTURB, nullptr},
- {VIEW_MESSAGE, PNG_APPLIST_MESSAGE_IMAGE, PNG_APPLIST_MESSAGE_IMAGE, PNG_APPLIST_DEFAULT_IMG,"æ¶æ¯éç¥", STR_MESSAGE_NOTIFICATION, nullptr},
- {VIEW_SAVEELE, PNG_APPLIST_SAVEELE_IMAGE, PNG_APPLIST_SAVEELE_IMAGE, PNG_APPLIST_DEFAULT_IMG,"ççµæ¨¡å¼", STR_POWER_SAVE_MODE, nullptr},
- {VIEW_AI_VOICE, PNG_APPLIST_AIVOICE_IMAGE, PNG_APPLIST_AIVOICE_IMAGE, PNG_APPLIST_DEFAULT_IMG,"AI Voice", STR_AI_VOICE, nullptr},
- {VIEW_FLASHLIGHT, PNG_APPLIST_FLASHLIGHT_IMAGE, PNG_APPLIST_FLASHLIGHT_IMAGE, PNG_APPLIST_DEFAULT_IMG,"æçµç", STR_FLASHLIGHT, nullptr},
- {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_DEFAULT_IMG,"设置", STR_SETTINGS, nullptr},
+ {VIEW_MESSAGE, PNG_APPLIST_MESSAGE_IMAGE, PNG_APPLIST_MESSAGE_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æ¶æ¯éç¥", STR_MESSAGE_NOTIFICATION, nullptr},
+ {VIEW_COMPASS, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æåé", STR_COMPASS, nullptr},
+ {VIEW_RECORD, PNG_APPLIST_RECORD_IMAGE, PNG_APPLIST_RECORD_IMAGE, PNG_APPLIST_DEFAULT_IMG, "å½é³", STR_RECORD, nullptr},
+ {VIEW_FLASHLIGHT, PNG_APPLIST_FLASHLIGHT_IMAGE, PNG_APPLIST_FLASHLIGHT_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æçµç", STR_FLASHLIGHT, nullptr},
+ {VIEW_WEATHER, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_DEFAULT_IMG, "天æ°", STR_WEATHER, nullptr},
+ {VIEW_MAIN_STOPWATCH, PNG_APPLIST_STOPWATCH_IMAGE, PNG_APPLIST_STOPWATCH_IMAGE, PNG_APPLIST_DEFAULT_IMG, "ç§è¡¨", STR_STOPWATCH, nullptr},
+ {VIEW_MAIN_COUNTDOWN, PNG_APPLIST_COUNTDOWN_IMAGE, PNG_APPLIST_COUNTDOWN_IMAGE, PNG_APPLIST_DEFAULT_IMG, "计æ¶å¨", STR_TIMER, nullptr},
+ {VIEW_RESPIRATORY_TRAINING, PNG_APPLIST_BREATHE_IMAGE, PNG_APPLIST_BREATHE_IMAGE, PNG_APPLIST_DEFAULT_IMG, "å¼å¸è®ç»", STR_BREATH_TRAINING, nullptr},
+ {VIEW_TAKEPHOTOS, PNG_APPLIST_TACKEPHOTOS_IMAGE, PNG_APPLIST_TACKEPHOTOS_IMAGE, PNG_APPLIST_DEFAULT_IMG, "饿§æç
§", STR_REMOTE_SHOOTING, nullptr},
+ {VIEW_MAIN_ALARM, PNG_APPLIST_ALARM_IMAGE, PNG_APPLIST_ALARM_IMAGE, PNG_APPLIST_DEFAULT_IMG, "é¹é", STR_ALARM, nullptr},
+ {VIEW_SOUND_VIBRATION, PNG_APPLIST_VOICE_IMAGE, PNG_APPLIST_VOICE_IMAGE, PNG_APPLIST_DEFAULT_IMG, "声é³", STR_SOUND, nullptr},
+ {VIEW_FIND_PHONE, PNG_APPLIST_FINDPHONE_IMAGE, PNG_APPLIST_FINDPHONE_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æ¥æ¾ææº", STR_FIND_PHONE, nullptr},
+ {VIEW_DNOTDISTURB, PNG_APPLIST_DISTURB_IMAGE, PNG_APPLIST_DISTURB_IMAGE, PNG_APPLIST_DEFAULT_IMG, "å¿æ°æ¨¡å¼", STR_DO_NOT_DISTURB, nullptr},
+ {VIEW_ADD_CARD, PNG_APPLIST_CARDSET_IMAGE, PNG_APPLIST_CARDSET_IMAGE, PNG_APPLIST_DEFAULT_IMG, "å¡ç管ç", STR_CARD_MANAGEMENT, nullptr},
+ {VIEW_SET_DIAL_STYLE, PNG_APPLIST_CHANGEDIAL_IMAGE, PNG_APPLIST_CHANGEDIAL_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æ´æ¢è¡¨ç", STR_WATCH_FACE, nullptr},
+ {VIEW_SAVEELE, PNG_APPLIST_SAVEELE_IMAGE, PNG_APPLIST_SAVEELE_IMAGE, PNG_APPLIST_DEFAULT_IMG, "ççµæ¨¡å¼", STR_POWER_SAVE_MODE, nullptr},
+ {VIEW_SLEEP, PNG_APPLIST_SLEEP_IMAGE, PNG_APPLIST_SLEEP_IMAGE, PNG_APPLIST_DEFAULT_IMG, "ç¡ç ", STR_SLEEP, nullptr},
+ {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_DEFAULT_IMG, "设置", STR_SETTINGS, nullptr},
+
+ // {VIEW_PHONEDIR, PNG_APPLIST_CALLLOG_IMAGE, PNG_APPLIST_CALLLOG_IMAGE, PNG_APPLIST_DEFAULT_IMG, "常ç¨è系人", STR_FAVORITE_CONTACTS, nullptr},
+ // {VIEW_THEME_STYLE, PNG_APPLIST_THEME_IMAGE, PNG_APPLIST_THEME_IMAGE, PNG_APPLIST_DEFAULT_IMG, "æ¾ç¤ºæ¹å¼", STR_DISPLAY_MODE, nullptr},
+ // {VIEW_BRIGHTNESSLEVEL, PNG_APPLIST_BRIGHTNESSLEVEL_IMAGE, PNG_APPLIST_BRIGHTNESSLEVEL_IMAGE, PNG_APPLIST_DEFAULT_IMG, "亮度è°è", STR_BRIGHTNESS_ADJUSTMENT, nullptr},
+ // {VIEW_CLASSIC_BLUETOOTH, PNG_APPLIST_BLUETOOTH_IMAGE, PNG_APPLIST_BLUETOOTH_IMAGE, PNG_APPLIST_DEFAULT_IMG, "èç", STR_BLUETOOTH, nullptr},
#if 0
/*å±è½Slice*/
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt
index baca8ed6c..6081ebe38 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt
+++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt
@@ -471,7 +471,8 @@ STR_PLEASE_RESTART_CHAT$Please restart the conversation
STR_CONTINUE_CHAT$Continue the conversation
STR_AIMODELS_DOUBAO$Cici
STR_AIMODES_WENXINYIYAN$ERNIE Bot
-STR_AIMODES_KIMI$Kimi
+STR_AIMODES_KIMI$KIMI
STR_AIMODES_CHATGPT$ChatGPT
-STR_SLIDE_TO_SHUTDOWN$Slide to shutdown
-STR_SLIDE_TO_REBOOT$Slide to reboot
\ No newline at end of file
+STR_SLIDE_TO_SHUTDOWN$Slide to shutdown >>
+STR_SLIDE_TO_REBOOT$Slide to reboot >>
+STR_AI_FAMILY_MEALS$AI Family Meals
\ No newline at end of file
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt
index 459021969..f6c045e09 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt
+++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt
@@ -471,7 +471,8 @@ STR_PLEASE_RESTART_CHAT$è¯·éæ°å¼å§å¯¹è¯
STR_CONTINUE_CHAT$ç»§ç»å¯¹è¯
STR_AIMODELS_DOUBAO$è±å
STR_AIMODES_WENXINYIYAN$æå¿ä¸è¨
-STR_AIMODES_KIMI$Kimi
+STR_AIMODES_KIMI$KIMI
STR_AIMODES_CHATGPT$ChatGPT
STR_SLIDE_TO_SHUTDOWN$æ»å¨å
³æº >>
-STR_SLIDE_TO_REBOOT$æ»å¨éå¯ >>
\ No newline at end of file
+STR_SLIDE_TO_REBOOT$æ»å¨éå¯ >>
+STR_AI_FAMILY_MEALS$AI å
¨å®¶æ¡¶
\ No newline at end of file
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml
index 974a1d2c4..02a569028 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml
+++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml
@@ -472,8 +472,9 @@
-
+
-
-
+
+
+
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml
index 6ad434bcc..493ec5041 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml
+++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml
@@ -472,8 +472,9 @@
-
+
+
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang
index 3f7421371..e35a0ba06 100644
Binary files a/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang and b/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang differ
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h b/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h
index 69218bc92..aba464c46 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h
+++ b/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h
@@ -487,7 +487,8 @@ enum UIResourceTextId : uint16_t {
STR_AIMODES_CHATGPT = 474,
STR_SLIDE_TO_SHUTDOWN = 475,
STR_SLIDE_TO_REBOOT = 476,
- STR_MAX_ID = 477,
+ STR_AI_FAMILY_MEALS = 477,
+ STR_MAX_ID = 478,
}; // UIResourceTextId
enum FontLanguageId : uint8_t {
diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang
index bd8dda943..e7f819a14 100644
Binary files a/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang and b/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang differ
diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h
index 6216ba778..050db8fea 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h
+++ b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h
@@ -2,7 +2,7 @@
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-03-30 18:29:43
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-05-06 19:56:05
+ * @LastEditTime: 2024-07-25 14:48:37
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h
*/
@@ -18,17 +18,7 @@
namespace OHOS
{
- typedef enum
- {
- SYSTEMVIEW = 0, // ç³»ç»è§å¾(slice)
- ABOUTTHEWATCHVIEW, // å
³äºæè¡¨è§å¾(subView)
- SYSTEMLUPGRADE, // ç³»ç»å级(subView)
- WATCHQRCODE, // æè¡¨äºç»´ç è§å¾(subView)
- SYSTEMLANGUAGEVIEW, // ç³»ç»è¯è¨è§å¾(subView)
- FACTORYRESETVIEW, // æ¢å¤åºå设置è§å¾(subView)upgrade
- TEST,
- MAX_SYSTEMVIEWID,
- } SYSTEMVIEWID;
+
/* ---------------------------- æ¢å¤åºå设置ç颿é®çVIEWID --------------------------- */
static const char *FACTORYRESET_CHECKON = "ShoutDownButtonCheckOn"; // 确认
@@ -51,7 +41,6 @@ namespace OHOS
void OnStop() override;
static SystemPresenter *GetInstance();
- //void set_key_falg(bool);
private:
// å 为继æ¿äºOnClickListenerï¼æä»¥æOnClick屿§ï¼è³äºåæ°,å彿°ä¹è¿æ ·ç´æ¥ç»§æ¿;
@@ -63,7 +52,6 @@ namespace OHOS
private:
SystemModel *systemModel;
- //bool isSystemUpgradeState{false}; // æ¯å¦å¤äºåçº§ç¶æ
bool X_DRAG_FLAG{false};
};
} // namespace OHOS
diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h
index 83d809335..a28c27550 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h
+++ b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h
@@ -2,7 +2,7 @@
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-03-30 18:29:39
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-05-07 18:30:05
+ * @LastEditTime: 2024-07-25 16:38:48
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h
*/
#ifndef SYSTEM_VIEW_H
@@ -18,26 +18,47 @@
#include "components/ui_button.h"
#include "components/ui_label_button_ext.h"
#include "system/include/SystemAboutTheWatchView.h"
-#include "system/include/SystemSuperviseView.h"
+// #include "system/include/SystemSuperviseView.h"
#include "system/include/SystemFactoryResetView.h"
-#include "system/include/Systemupgrade.h"
+// #include "system/include/Systemupgrade.h"
#include "components/ui_toggle_button.h"
namespace OHOS
{
- static constexpr const char *ABOUT_THE_WATCH = "AboutTheWatchButton"; // å
³äºæè¡¨
- static constexpr const char *SYSTEM_UPGRADE = "SystemUpgradeButtonExt"; // ç³»ç»å级
+ static constexpr const char *ABOUT_THE_WATCH = "AboutTheWatchButton"; // å
³äºæè¡¨
+ static constexpr const char *SYSTEM_UPGRADE = "SystemUpgradeButtonExt"; // ç³»ç»å级
static constexpr const char *SYSTEM_UPGRADE_t = "SystemUpgradeButtonExt_t"; // ç¹å»ç³»ç»å级
- static constexpr const char *WATCH_QR_CODE = "WatchqrcodeButton"; // æè¡¨äºç»´ç
- static constexpr const char *SYSTEM_LANGUAGE = "SystemLanguageButton"; // ç³»ç»è¯è¨
- static constexpr const char *FACTORY_RESET = "FactoryResetButton"; // æ¢å¤åºå设置
+ static constexpr const char *WATCH_QR_CODE = "WatchqrcodeButton"; // æè¡¨äºç»´ç
+ static constexpr const char *SYSTEM_LANGUAGE = "SystemLanguageButton"; // ç³»ç»è¯è¨
+ static constexpr const char *FACTORY_RESET = "FactoryResetButton"; // æ¢å¤åºå设置
+
+ typedef enum
+ {
+ SYSTEMVIEW = 0, // ç³»ç»è§å¾(slice)
+ ABOUTTHEWATCHVIEW, // å
³äºæè¡¨è§å¾(subView)
+ FACTORYRESETVIEW, // æ¢å¤åºå设置è§å¾(subView)
+ MAX_SYSTEMVIEWID,
+ } SYSTEMVIEWID;
+
class SystemPresenter;
class SystemView : public View
{
public:
+ struct LabelConfig
+ {
+ int16_t left;
+ int16_t top;
+ int16_t width;
+ int16_t height;
+ int16_t fontSize;
+ int16_t lineHeigh;
+ uint16_t textId;
+ uint8_t lineBreakMode;
+ };
+
SystemView();
- virtual ~SystemView();
+ ~SystemView();
static SystemView *GetInstance(void);
void OnStart() override;
@@ -45,51 +66,42 @@ namespace OHOS
void OnTearDownView() override;
void OnStop() override;
- struct ButtonConfig_ext_t
+ struct ButtonConfig
{
- int x;
- int y;
- int w;
- int h;
- // const char *str;
- uint16_t textId;
- const char *ViewId;
- const char *ImageSrc;
-
- // label
- int label_x;
- int label_y;
- uint8_t ALIGN;
- int Fontsize;
+ int16_t x;
+ int16_t y;
+ int16_t w;
+ int16_t h;
+ const char *viewId;
};
- bool ChangeSystemView(int16_t thisView);
- bool ChangeSystemAboutView(int16_t thisView);
- bool ChangeWatchQRCodeView(int16_t thisView);
- bool ChangeSystemLanguageView(int16_t thisView);
- bool ChangeSystemFactoryResetView(int16_t thisView);
- bool ChangeSystemupgradeView(int16_t thisView);
+ bool ChangeToSystemView(int16_t thisView);
+ bool ChangeToSystemAboutView(int16_t thisView);
+ bool ChangeToSystemFactoryResetView(int16_t thisView);
bool ClickFunc(int16_t interface);
+ bool CheckViewParam(int16_t hideView, int16_t showView);
void ChangeView(int16_t hideView, int16_t showView);
UIScrollView *GetSystemScrollView(int ViewId);
private:
- void initView_ext(int x, int y, int w, int h, int interval, const char *imagsrc);
- void ClearAll(void);
- bool SetTheSystemScrollView(void);
- bool SetTheTitle(void);
- void NeedToUpdateImageinit(void);
- UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &ButtonConfig_ext, UIView::OnClickListener *clickListener);
SystemAboutTheWatchView *p_SystemAboutTheWatchView{nullptr}; // å
³äºæè¡¨
- SystemupgradeView *p_SystemupgradeView{nullptr}; // ç³»ç»å级
- SystemSuperviseView *p_WatchQRCodeView{nullptr}; // æè¡¨äºç»´ç
SystemFactoryResetView *p_SystemFactoryResetView{nullptr}; // æ¢å¤åºå设置
- UIScrollView *SystemScrollView[10]{nullptr};
+
+ private:
+ UILabelButtonExt *SystemViewLabelButtonInit(ButtonConfig &buttonconfig);
+ UILabelExt *SystemViewLabelInit(LabelConfig &labelconfig);
+ bool CreateSystemViewLabel(void);
+ bool CreateSystemViewLabelButton(void);
+ bool CreateSystemScrollView(void);
+ void CreateSystemView(void);
+ void ClearAll(void);
+ void NeedToUpdateImageinit(void);
UILabelExt *Title{nullptr}; // æ é¢
- UILabelButtonExt *SystemViewButton[5]{nullptr};
- /* -------------------------------------------------------------------------- */
- UIImageView *NeedToUpdateImage{nullptr}; //æç¤ºéè¦ç³»ç»æ´æ°çiconå¾ç
- /* -------------------------------------------------------------------------- */
+ UIScrollView *SystemScrollView[MAX_SYSTEMVIEWID]{nullptr};
+ UILabelButtonExt *SystemViewLabelButton[5]{nullptr};
+ UILabelExt *SystemViewLabel[5]{nullptr};
+ UIImageView *NeedToUpdateImage{nullptr}; // æç¤ºéè¦ç³»ç»æ´æ°çiconå¾ç
+ bool viewInitStatus{false};
};
} // namespace OHOS
diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp
index 25dbcc357..5d96810a5 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp
+++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp
@@ -100,14 +100,6 @@ namespace OHOS
{
p_SystemView->ChangeView(ABOUTTHEWATCHVIEW, SYSTEMVIEW);
}
- else if (&view == p_SystemView->GetSystemScrollView(SYSTEMLUPGRADE))
- {
- p_SystemView->ChangeView(SYSTEMLUPGRADE, SYSTEMVIEW);
- }
- else if (&view == p_SystemView->GetSystemScrollView(WATCHQRCODE))
- {
- p_SystemView->ChangeView(WATCHQRCODE, SYSTEMVIEW);
- }
else if (&view == p_SystemView->GetSystemScrollView(FACTORYRESETVIEW))
{
p_SystemView->ChangeView(FACTORYRESETVIEW, SYSTEMVIEW);
@@ -196,14 +188,14 @@ namespace OHOS
}
- if (strcmp(view.GetViewId(), SYSTEM_UPGRADE_t) == 0) //ç¹å»æ¯å¦ç«å³å级
- {
- SystemupgradeView::GetInstance()->statr_down_fwpkg();
- }
- if (strcmp(view.GetViewId(), "labelButton1_exit") == 0) //ç¨åå说
- {
- NativeAbility::GetInstance().ChangeSlice(VIEW_SETTING);
- }
+ // if (strcmp(view.GetViewId(), SYSTEM_UPGRADE_t) == 0) //ç¹å»æ¯å¦ç«å³å级
+ // {
+ // SystemupgradeView::GetInstance()->statr_down_fwpkg();
+ // }
+ // if (strcmp(view.GetViewId(), "labelButton1_exit") == 0) //ç¨åå说
+ // {
+ // NativeAbility::GetInstance().ChangeSlice(VIEW_SETTING);
+ // }
return true;
}
diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp
index 6bdf28783..095d065e0 100644
--- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp
+++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp
@@ -8,60 +8,8 @@ extern uint8_t battery_get_voltage(float *voltage);
#include "systemupdate/include/SystemUpdateModel.h"
namespace OHOS
{
-
static SystemView *g_pSystemView{nullptr};
- struct SystemViewMapper_ext
- {
- const int16_t viewId;
- const char *viewid_str;
- // const char *Labe_str;
- uint16_t textId;
- bool (SystemView::*func)(int16_t thisView);
- };
-
- SystemViewMapper_ext ViewMapper_t[] = {
- {ABOUTTHEWATCHVIEW, ABOUT_THE_WATCH, STR_ABOUT_WATCH, &SystemView::ChangeSystemAboutView},
- {SYSTEMLUPGRADE, SYSTEM_UPGRADE, STR_SYSTEM_UPDATE, &SystemView::ChangeSystemupgradeView},
- {WATCHQRCODE, WATCH_QR_CODE, STR_WATCH_QR_CODE, &SystemView::ChangeWatchQRCodeView},
- {SYSTEMLANGUAGEVIEW, SYSTEM_LANGUAGE, STR_SYSTEM_LANGUAGE, &SystemView::ChangeSystemLanguageView},
- {FACTORYRESETVIEW, FACTORY_RESET, STR_FACTORY_RESET, &SystemView::ChangeSystemFactoryResetView},
-
- };
-
- // æ ¹æ®ä¼ å
¥çinterfaceåæ°æ§è¡ç¸åºè§å¾IDå
³èçæå彿°ã
- bool SystemView::ClickFunc(int16_t interface)
- {
- int funcSize = sizeof(ViewMapper_t) / sizeof(ViewMapper_t[SYSTEMVIEW]);
- for (int i = 0; i < funcSize; i++)
- {
- if (interface == ViewMapper_t[i].viewId)
- {
- bool jug = (this->*(ViewMapper_t[i].func))(interface);
- if (jug == false)
- {
- return false;
- }
- return true;
- }
- }
- return false;
- }
-
- // 忢è§å¾
- void SystemView::ChangeView(int16_t hideView, int16_t showView)
- {
- if (hideView > MAX_SYSTEMVIEWID)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: SystemViewId Overstep ones bounds");
- return;
- }
- SystemScrollView[hideView]->SetVisible(false);
- ClickFunc(showView);
- SystemScrollView[showView]->SetVisible(true);
- Draw();
- }
-
SystemView::SystemView()
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemView");
@@ -71,7 +19,6 @@ namespace OHOS
SystemView::~SystemView()
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::~SystemView");
- ClearAll();
g_pSystemView = nullptr;
}
@@ -82,63 +29,186 @@ namespace OHOS
void SystemView::ClearAll()
{
- if (SystemScrollView[SYSTEMVIEW] != nullptr)
+ if (viewInitStatus)
{
- SystemScrollView[SYSTEMVIEW]->RemoveAll();
-
- if (Title != nullptr)
+ if (SystemScrollView[SYSTEMVIEW] != nullptr)
{
- delete Title;
- Title = nullptr;
- }
-
- int num = (sizeof(ViewMapper_t) / sizeof(SystemViewMapper_ext));
- for (int i = 0; i < num; i++)
- {
- delete SystemViewButton[i];
- SystemViewButton[i] = nullptr;
+ SystemScrollView[SYSTEMVIEW]->RemoveAll();
+ if (Title != nullptr)
+ {
+ delete Title;
+ Title = nullptr;
+ }
+ for (int i = 0; i < 5; i++)
+ {
+ if (SystemViewLabelButton[i] != nullptr)
+ {
+ delete SystemViewLabelButton[i];
+ SystemViewLabelButton[i] = nullptr;
+ }
+
+ if (SystemViewLabel[i] != nullptr)
+ {
+ delete SystemViewLabel[i];
+ SystemViewLabel[i] = nullptr;
+ }
+ }
+ if (NeedToUpdateImage != nullptr)
+ {
+ delete NeedToUpdateImage;
+ NeedToUpdateImage = nullptr;
+ }
+ delete SystemScrollView[SYSTEMVIEW];
+ SystemScrollView[SYSTEMVIEW] = nullptr;
}
+ }
+ if (p_SystemAboutTheWatchView != nullptr)
+ {
+ delete p_SystemAboutTheWatchView;
+ p_SystemAboutTheWatchView = nullptr;
+ }
+ if (p_SystemFactoryResetView != nullptr)
+ {
+ delete p_SystemFactoryResetView;
+ p_SystemFactoryResetView = nullptr;
+ }
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ClearAll end!!");
+ }
- if (p_SystemAboutTheWatchView != nullptr)
- {
- delete p_SystemAboutTheWatchView;
- p_SystemAboutTheWatchView = nullptr;
- }
+ UILabelButtonExt *SystemView::SystemViewLabelButtonInit(ButtonConfig &buttonconfig)
+ {
+ UILabelButtonExt *labelButton = new UILabelButtonExt();
+ if (labelButton == nullptr)
+ {
+ return nullptr;
+ }
+ labelButton->SetPosition(buttonconfig.x, buttonconfig.y, buttonconfig.w, buttonconfig.h);
+ labelButton->SetViewId(buttonconfig.viewId);
+ labelButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+ labelButton->SetImageSrc(PNG_SETTING_NEXT_IMAGE, PNG_SETTING_NEXT_IMAGE);
+ labelButton->SetImagePosition(326, 37);
+ labelButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);
+ labelButton->SetOnClickListener(presenter_);
+
+ return labelButton;
+ }
- if (p_SystemupgradeView != nullptr)
- {
- delete p_SystemupgradeView;
- p_SystemupgradeView = nullptr;
- }
+ UILabelExt *SystemView::SystemViewLabelInit(LabelConfig &labelconfig)
+ {
+ UILabelExt *label = new UILabelExt();
+ if (label == nullptr)
+ {
+ return nullptr;
+ }
+ label->SetPosition(labelconfig.left, labelconfig.top, labelconfig.width, labelconfig.height);
+ label->SetStyle(STYLE_TEXT_FONT, labelconfig.fontSize);
+ label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh);
+ label->SetTextId(labelconfig.textId);
+ label->SetLineBreakMode(labelconfig.lineBreakMode);
+ label->SetRollSpeed(70);
+ label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize);
+ return label;
+ }
- if (p_WatchQRCodeView != nullptr)
+ bool SystemView::CreateSystemViewLabel(void)
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::CreateSystemViewLabel");
+ LabelConfig labelConfig = {
+ .left = 83,
+ .top = 50,
+ .width = 300,
+ .height = 35,
+ .fontSize = 30,
+ .lineHeigh = 35,
+ .textId = STR_SYSTEM, /*ç³»ç»*/
+ .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION,
+ };
+ Title = SystemViewLabelInit(labelConfig);
+ if (Title == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::Title");
+ return false;
+ }
+ Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ SystemScrollView[SYSTEMVIEW]->Add(Title);
+ /* -------------------------------------------------------------------------- */
+ struct LabelSetup
+ {
+ int16_t y;
+ const int16_t textId;
+ };
+
+ LabelSetup labelSetups[] = {
+ {153, STR_ABOUT_WATCH},
+ {273, STR_SYSTEM_UPDATE},
+ {393, STR_WATCH_QR_CODE},
+ {513, STR_SYSTEM_LANGUAGE},
+ {633, STR_FACTORY_RESET},
+ };
+ for (int i = 0; i < sizeof(labelSetups) / sizeof(labelSetups[0]); ++i)
+ {
+ labelConfig = {
+ .left = 90,
+ .top = labelSetups[i].y,
+ .width = 240,
+ .height = 35,
+ .fontSize = 30,
+ .lineHeigh = 35,
+ .textId = labelSetups[i].textId,
+ .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION,
+ };
+ SystemViewLabel[i] = SystemViewLabelInit(labelConfig);
+ if (SystemViewLabel[i] == nullptr)
{
- delete p_WatchQRCodeView;
- p_WatchQRCodeView = nullptr;
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::SystemViewLabel[%d] new fail!", i);
+ return false;
}
+ SystemScrollView[SYSTEMVIEW]->Add(SystemViewLabel[i]);
+ }
- if (p_SystemFactoryResetView != nullptr)
- {
- delete p_SystemFactoryResetView;
- p_SystemFactoryResetView = nullptr;
- }
+ return true;
+ }
- if (NeedToUpdateImage != nullptr)
+ bool SystemView::CreateSystemViewLabelButton(void)
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::CreateSystemViewLabelButton");
+ struct ButtonSetup
+ {
+ int y;
+ const char *viewId;
+ };
+ ButtonSetup buttonSetups[] = {
+ {120, ABOUT_THE_WATCH},
+ {240, SYSTEM_UPGRADE},
+ {360, WATCH_QR_CODE},
+ {480, SYSTEM_LANGUAGE},
+ {600, FACTORY_RESET},
+ };
+
+ for (int i = 0; i < sizeof(buttonSetups) / sizeof(buttonSetups[0]); ++i)
+ {
+ ButtonConfig buttonconfig = {
+ .x = 43,
+ .y = buttonSetups[i].y,
+ .w = 380,
+ .h = 100,
+ .viewId = buttonSetups[i].viewId,
+ };
+ SystemViewLabelButton[i] = SystemViewLabelButtonInit(buttonconfig);
+ if (SystemViewLabelButton[i] == nullptr)
{
- delete NeedToUpdateImage;
- NeedToUpdateImage = nullptr;
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::Button[%d] new fail!", i);
+ return false;
}
-
- delete SystemScrollView[SYSTEMVIEW];
- SystemScrollView[SYSTEMVIEW] = nullptr;
+ SystemScrollView[SYSTEMVIEW]->Add(SystemViewLabelButton[i]);
}
+
+ return true;
}
- /// @brief 设置SystemScrollView
- /// @param void
- /// @return true 设置æåï¼false 失败
- bool SystemView::SetTheSystemScrollView(void)
+ bool SystemView::CreateSystemScrollView(void)
{
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::CreateSystemScrollView");
SystemScrollView[SYSTEMVIEW] = new UIScrollView();
if (SystemScrollView[SYSTEMVIEW] == nullptr)
{
@@ -152,124 +222,122 @@ namespace OHOS
SystemScrollView[SYSTEMVIEW]->SetDirection(1);
SystemScrollView[SYSTEMVIEW]->SetThrowDrag(true); // è®¾ç½®æææ¬èµ·å±å¹åæ¯å¦ç»§ç»æ»å¨ã
SystemScrollView[SYSTEMVIEW]->SetMaxScrollDistance(1000); // è®¾ç½®æææ¬èµ·å±å¹åçæå¤§æ»å¨è·ç¦»ã
- UIView::OnDragListener *draglistener = static_cast(SystemPresenter::GetInstance());
- if (draglistener == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!");
- return false;
- }
- SystemScrollView[SYSTEMVIEW]->SetOnDragListener(draglistener);
+ SystemScrollView[SYSTEMVIEW]->RequestFocus();
+ SystemScrollView[SYSTEMVIEW]->SetRotateFactor(true);
+ SystemScrollView[SYSTEMVIEW]->SetOnDragListener(presenter_);
SystemScrollView[SYSTEMVIEW]->SetTouchable(true);
SystemScrollView[SYSTEMVIEW]->SetDraggable(true);
+
return true;
}
- /// @brief 设置æ é¢
- /// @param void
- /// @return true 设置æåï¼false 失败
- bool SystemView::SetTheTitle(void)
+ /*éè¦æ´æ°ç红ç¹å¾çåå§å*/
+ void SystemView::NeedToUpdateImageinit(void)
{
- Title = new UILabelExt();
- if (Title == nullptr)
+ if (NeedToUpdateImage == nullptr)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::Title new fail!");
- return false;
+ NeedToUpdateImage = new UIImageView();
+ if (NeedToUpdateImage == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemView");
+ return;
+ }
+ NeedToUpdateImage->SetPosition(323, 280, 20, 20);
+ NeedToUpdateImage->SetStyle(STYLE_BORDER_RADIUS, 200);
+ const char *imagesPath = "/user/res/system/SYSTEM_UPDATE_FLAG.bin";
+ NeedToUpdateImage->SetSrc(imagesPath);
+
+ SystemScrollView[SYSTEMVIEW]->Add(NeedToUpdateImage);
}
- Title->SetPosition(83, 52, 300, 35);
- Title->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
- Title->SetStyle(STYLE_TEXT_FONT, 30);
- Title->SetStyle(STYLE_LINE_HEIGHT, 35);
- // Title->SetText("ç³»ç»");
- Title->SetTextId(STR_SYSTEM);
- Title->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
- Title->SetRollSpeed(70);
- Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- // Title->SetRollSpeed(6);
- Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
- return true;
}
- UILabelButtonExt *SystemView::SetTheButton_ext(ButtonConfig_ext_t &buttonconfig, UIView::OnClickListener *clickListener)
+ void SystemView::CreateSystemView(void)
{
- UILabelButtonExt *button = new UILabelButtonExt();
- if (button == nullptr)
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::CreateSystemView");
+ if (!CreateSystemScrollView() || !CreateSystemViewLabelButton() || !CreateSystemViewLabel())
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " SystemView::SetTheButton: button new fail!");
- return nullptr;
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::CreateSystemView");
+ return;
}
- button->SetPosition(buttonconfig.x, buttonconfig.y, buttonconfig.w, buttonconfig.h);
- button->SetViewId(buttonconfig.ViewId);
- button->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
- button->SetImageSrc(buttonconfig.ImageSrc, buttonconfig.ImageSrc);
- button->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
- button->SetOnClickListener(clickListener);
-
- // button->SetText(buttonconfig.str);
- button->SetTextId(buttonconfig.textId);
- button->SetAlign(TEXT_ALIGNMENT_LEFT);
- button->SetLabelPosition(buttonconfig.label_x, buttonconfig.label_y);
- button->SetFont(DEFAULT_VECTOR_FONT_FILENAME, buttonconfig.Fontsize);
- // button->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
-
- button->SetImagePosition(326, 37);
- return button;
+ viewInitStatus = true;
}
- void SystemView::initView_ext(int x, int y, int w, int h, int interval, const char *imagsrc)
+ void SystemView::OnStart()
{
- if (!SetTheSystemScrollView())
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::OnStart");
+ View::OnStart();
+ SetContainerView(new UIViewGroup());
+ if (GetContainer() == nullptr)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SetTheSystemScrollView() fail!");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetContainerView fail!!");
return;
}
- if (!SetTheTitle())
+ container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());
+
+ if (!viewInitStatus)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SetTheTitle() fail!");
+ CreateSystemView();
+ }
+
+ RootView::GetInstance()->SetOnKeyActListener(presenter_);
+ }
+
+ void SystemView::OnSetUpView()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::OnSetUpView");
+ View::OnSetUpView();
+ if (SystemScrollView[SYSTEMVIEW] == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: OnSetUpView has nullptr");
return;
}
- /* -------------------------------------------------------------------------- */
- UIView::OnClickListener *clickListener = static_cast(SystemPresenter::GetInstance());
- /* -------------------------------------------------------------------------- */
- ButtonConfig_ext_t buttonconfig;
- buttonconfig.x = x;
- buttonconfig.y = y;
- buttonconfig.w = w;
- buttonconfig.h = h;
+ if (SystemUpdateModel::GetInstance().IsLatestVersion() == false) // 妿䏿¯ææ°ç³»ç»çæ¬åºç°å°åç¹
+ {
+ NeedToUpdateImageinit();
+ }
+ container_->Add(SystemScrollView[SYSTEMVIEW]);
+ Draw();
+ }
- int len = sizeof(ViewMapper_t) / sizeof(SystemViewMapper_ext);
+ void SystemView::OnTearDownView()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::OnTearDownView");
+ View::OnTearDownView();
+ return;
+ }
- for (int i = 0; i < len; i++)
+ void SystemView::OnStop()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::OnStop");
+ View::OnStop();
+ if (container_ != nullptr)
{
- // buttonconfig.str = ViewMapper_t[i].Labe_str;
- buttonconfig.textId = ViewMapper_t[i].textId;
- buttonconfig.ViewId = ViewMapper_t[i].viewid_str;
- buttonconfig.ImageSrc = imagsrc;
- buttonconfig.label_x = 40;
- buttonconfig.label_y = 0;
- buttonconfig.Fontsize = 30;
- buttonconfig.ALIGN = TEXT_ALIGNMENT_LEFT;
- SystemViewButton[i] = SetTheButton_ext(buttonconfig, clickListener);
- buttonconfig.y += interval;
+ container_->RemoveAll();
+ delete container_;
+ container_ = nullptr;
}
+ RootView::GetInstance()->ClearOnKeyActListener();
+ ClearAll();
+ return;
}
// 0.跳转å°ç³»ç»è§å¾ï¼å
¶ä»è§å¾é½å¸éè¿è¿ä¸ªè§å¾è·³è½¬
- bool SystemView::ChangeSystemView(int16_t thisView)
+ bool SystemView::ChangeToSystemView(int16_t thisView)
{
if (SystemScrollView[thisView] == nullptr)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemView");
- RootView::GetInstance()->Add(SystemScrollView[thisView]);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeToSystemView");
+ container_->Add(SystemScrollView[thisView]);
}
return true;
}
// 1.跳转å°å
³äºæè¡¨
- bool SystemView::ChangeSystemAboutView(int16_t thisView)
+ bool SystemView::ChangeToSystemAboutView(int16_t thisView)
{
if (SystemScrollView[thisView] == nullptr)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemAboutView");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeToSystemAboutView");
p_SystemAboutTheWatchView = new SystemAboutTheWatchView();
if (p_SystemAboutTheWatchView == nullptr)
{
@@ -277,41 +345,17 @@ namespace OHOS
return false;
}
SystemScrollView[thisView] = p_SystemAboutTheWatchView->SystemAbouTheWatchtInitIView();
- RootView::GetInstance()->Add(SystemScrollView[thisView]);
+ container_->Add(SystemScrollView[thisView]);
}
return true;
}
- // 2.è·³è½¬å°æè¡¨äºç»´ç
- bool SystemView::ChangeWatchQRCodeView(int16_t thisView)
+ // 3.è·³è½¬å°æ¢å¤åºå设置çé¢
+ bool SystemView::ChangeToSystemFactoryResetView(int16_t thisView)
{
if (SystemScrollView[thisView] == nullptr)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeWatchQRCodeView");
- p_WatchQRCodeView = new SystemSuperviseView();
- if (p_WatchQRCodeView == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);
- return false;
- }
- SystemScrollView[thisView] = p_WatchQRCodeView->SystemSuperviseViewInit();
- RootView::GetInstance()->Add(SystemScrollView[thisView]);
- }
- return true;
- }
-
- // 3.跳转å°ç³»ç»è¯è¨çé¢
- bool SystemView::ChangeSystemLanguageView(int16_t thisView)
- {
- return true;
- }
-
- // 4.è·³è½¬å°æ¢å¤åºå设置çé¢
- bool SystemView::ChangeSystemFactoryResetView(int16_t thisView)
- {
- if (SystemScrollView[thisView] == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemFactoryResetView");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeToSystemFactoryResetView");
p_SystemFactoryResetView = new SystemFactoryResetView();
if (p_SystemFactoryResetView == nullptr)
{
@@ -319,102 +363,80 @@ namespace OHOS
return false;
}
SystemScrollView[thisView] = p_SystemFactoryResetView->SystemFactoryResetViewInit();
- RootView::GetInstance()->Add(SystemScrollView[thisView]);
+ container_->Add(SystemScrollView[thisView]);
}
return true;
}
- // 5.跳转å°ç³»ç»å级çé¢
- bool SystemView::ChangeSystemupgradeView(int16_t thisView)
+ struct SystemViewMapper
{
- if (SystemScrollView[thisView] == nullptr)
+ const int16_t viewId;
+ bool (SystemView::*func)(int16_t thisView);
+ };
+
+ static const SystemViewMapper ViewMapper[] = {
+ {SYSTEMVIEW, &SystemView::ChangeToSystemView},
+ {ABOUTTHEWATCHVIEW, &SystemView::ChangeToSystemAboutView},
+ {FACTORYRESETVIEW, &SystemView::ChangeToSystemFactoryResetView},
+ };
+
+ // æ ¹æ®ä¼ å
¥çinterfaceåæ°æ§è¡ç¸åºè§å¾IDå
³èçæå彿°ã
+ bool SystemView::ClickFunc(int16_t interface)
+ {
+ int funcSize = sizeof(ViewMapper) / sizeof(ViewMapper[SYSTEMVIEW]);
+ for (int i = 0; i < funcSize; i++)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemupgradeView");
- p_SystemupgradeView = new SystemupgradeView();
- if (p_SystemupgradeView == nullptr)
+ if (interface == ViewMapper[i].viewId)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);
- return false;
+ bool jug = (this->*(ViewMapper[i].func))(interface);
+ if (jug == false)
+ {
+ return false;
+ }
+ return true;
}
- SystemScrollView[thisView] = p_SystemupgradeView->SystemupgradeViewInit();
- RootView::GetInstance()->Add(SystemScrollView[thisView]);
}
- return true;
+ return false;
}
- UIScrollView *SystemView::GetSystemScrollView(int ViewId)
+ /*æ£æ¥ä¼ å
¥ç两个è§å¾åæ° hideView å showView çæææ§ã*/
+ bool SystemView::CheckViewParam(int16_t hideView, int16_t showView)
{
- if (SystemScrollView[ViewId] == nullptr)
+ if (showView < 0 || showView >= MAX_SYSTEMVIEWID)
{
- return nullptr;
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::CheckViewParam showView err.");
+ return false;
}
- return SystemScrollView[ViewId];
- }
- void SystemView::NeedToUpdateImageinit(void)
- {
- if (NeedToUpdateImage == nullptr)
+ if (hideView < 0 || hideView > MAX_SYSTEMVIEWID)
{
- NeedToUpdateImage = new UIImageView();
- if (NeedToUpdateImage == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemView");
- return;
- }
- NeedToUpdateImage->SetPosition(323, 280, 20, 20);
- NeedToUpdateImage->SetStyle(STYLE_BORDER_RADIUS, 200);
- const char *imagesPath = "/user/res/system/SYSTEM_UPDATE_FLAG.bin";
- NeedToUpdateImage->SetSrc(imagesPath);
-
- SystemScrollView[SYSTEMVIEW]->Add(NeedToUpdateImage);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::CheckViewParam hideView err.");
+ return false;
}
- }
- void SystemView::OnStart()
- {
- View::OnStart();
- initView_ext(43, 120, 380, 100, 120, "/user/res/SETTING_NEXT.bin");
- RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::SystemPresenter::GetInstance();
- RootView::GetInstance()->SetOnKeyActListener(keyactListener);
+ return true;
}
- void SystemView::OnSetUpView()
+ // 忢è§å¾
+ void SystemView::ChangeView(int16_t hideView, int16_t showView)
{
- View::OnSetUpView();
- if (SystemScrollView[SYSTEMVIEW] == nullptr)
+ if (!CheckViewParam(hideView, showView))
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: OnSetUpView has nullptr");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::CheckViewParam failed.");
return;
}
-
- SystemScrollView[SYSTEMVIEW]->Add(Title);
- int len = sizeof(ViewMapper_t) / sizeof(SystemViewMapper_ext);
-
- for (int i = 0; i < len; i++)
- {
- SystemScrollView[SYSTEMVIEW]->Add(SystemViewButton[i]);
- }
- if (SystemUpdateModel::GetInstance().IsLatestVersion() == false) // 妿䏿¯ææ°ç³»ç»çæ¬åºç°å°åç¹
- {
- NeedToUpdateImageinit();
- }
- RootView::GetInstance()->Add(SystemScrollView[SYSTEMVIEW]);
+ SystemScrollView[hideView]->SetVisible(false);
+ ClickFunc(showView);
+ SystemScrollView[showView]->SetVisible(true);
Draw();
}
- void SystemView::OnTearDownView()
- {
-
- View::OnTearDownView();
- return;
- }
-
- void SystemView::OnStop()
+ UIScrollView *SystemView::GetSystemScrollView(int ViewId)
{
-
- View::OnStop();
- RootView::GetInstance()->ClearOnKeyActListener();
- RootView::GetInstance()->RemoveAll();
- return;
+ if (SystemScrollView[ViewId] == nullptr)
+ {
+ return nullptr;
+ }
+ return SystemScrollView[ViewId];
}
}
\ No newline at end of file
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 3f7421371..e35a0ba06 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 69218bc92..aba464c46 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
@@ -487,7 +487,8 @@ enum UIResourceTextId : uint16_t {
STR_AIMODES_CHATGPT = 474,
STR_SLIDE_TO_SHUTDOWN = 475,
STR_SLIDE_TO_REBOOT = 476,
- STR_MAX_ID = 477,
+ STR_AI_FAMILY_MEALS = 477,
+ STR_MAX_ID = 478,
}; // UIResourceTextId
enum FontLanguageId : uint8_t {
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 bd8dda943..e7f819a14 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