// Write to file as before
WriteJsonToFile(jsonString, filePath.c_str());
cJSON_free(jsonString);
+ return 1;
}
}
STR_RESTART$ Restart\r
STR_SHUTDOWN$Shutdown\r
STR_FACTORY_RESET$Factory Reset\r
-STR_LANGUAGE$Language
\ No newline at end of file
+STR_WATCH_NAME$Watch Name\r
+STR_FIRMWARE_VERSION$Firmware Version \r
+STR_BLUETOOTH_NAME$Bluetooth Name\r
+STR_BLUETOOTH_ADDRESS$Bluetooth Address\r
+STR_LATEST_VERSION$Latest Version\r
+STR_LATER$Later\r
+STR_UP_TO_DATE$The system has been upgraded to the latest version\r
+STR_NO_UPDATE$No update \r
+STR_LANGUAGE_SELECTION$Language Select\r
+STR_RESET_CONFIRM$Are you sure to restart?\r
+STR_SHUTDOWN_CONFIRM$Are you sure to shut down?\r
+STR_RESET_CONFIRM_NOTE$The operation will clear and reset the watch data. Are you sure you want to continue?
\ No newline at end of file
STR_RESTART$重启\r
STR_SHUTDOWN$关机\r
STR_FACTORY_RESET$恢复出厂\r
-STR_LANGUAGE$语言
\ No newline at end of file
+STR_WATCH_NAME$手表名称\r
+STR_FIRMWARE_VERSION$固件版本\r
+STR_BLUETOOTH_NAME$蓝牙名称\r
+STR_BLUETOOTH_ADDRESS$蓝牙地址\r
+STR_LATEST_VERSION$最新版本\r
+STR_LATER$稍后再说\r
+STR_UP_TO_DATE$当前已升级到最新版本\r
+STR_NO_UPDATE$暂无更新\r
+STR_LANGUAGE_SELECTION$语言选择\r
+STR_RESET_CONFIRM$是否确定重新启动?\r
+STR_SHUTDOWN_CONFIRM$是否确定关机?\r
+STR_RESET_CONFIRM_NOTE$该操作会清空并重置手表数据,是否确认继续?
\ No newline at end of file
<lanstr id="STR_RESTART" value=" Restart"/>
<lanstr id="STR_SHUTDOWN" value="Shutdown"/>
<lanstr id="STR_FACTORY_RESET" value="Factory Reset"/>
- <lanstr id="STR_LANGUAGE" value="Language"/>
+ <lanstr id="STR_WATCH_NAME" value="Watch Name"/>
+ <lanstr id="STR_FIRMWARE_VERSION" value="Firmware Version"/>
+ <lanstr id="STR_BLUETOOTH_NAME" value="Bluetooth Name"/>
+ <lanstr id="STR_BLUETOOTH_ADDRESS" value="Bluetooth Address"/>
+ <lanstr id="STR_LATEST_VERSION" value="Latest Version"/>
+ <lanstr id="STR_LATER" value="Later"/>
+ <lanstr id="STR_UP_TO_DATE" value="The system has been upgraded to the latest version"/>
+ <lanstr id="STR_NO_UPDATE" value="No update"/>
+ <lanstr id="STR_LANGUAGE_SELECTION" value="Language Select"/>
+ <lanstr id="STR_RESET_CONFIRM" value="Are you sure to restart?"/>
+ <lanstr id="STR_SHUTDOWN_CONFIRM" value="Are you sure to shut down?"/>
+ <lanstr id="STR_RESET_CONFIRM_NOTE" value="The operation will clear and reset the watch data. Are you sure you want to continue?"/>
</language>
<lanstr id="STR_RESTART" value="重启"/>
<lanstr id="STR_SHUTDOWN" value="关机"/>
<lanstr id="STR_FACTORY_RESET" value="恢复出厂"/>
- <lanstr id="STR_LANGUAGE" value="语言"/>
+ <lanstr id="STR_WATCH_NAME" value="手表名称"/>
+ <lanstr id="STR_FIRMWARE_VERSION" value="固件版本"/>
+ <lanstr id="STR_BLUETOOTH_NAME" value="蓝牙名称"/>
+ <lanstr id="STR_BLUETOOTH_ADDRESS" value="蓝牙地址"/>
+ <lanstr id="STR_LATEST_VERSION" value="最新版本"/>
+ <lanstr id="STR_LATER" value="稍后再说"/>
+ <lanstr id="STR_UP_TO_DATE" value="当前已升级到最新版本"/>
+ <lanstr id="STR_NO_UPDATE" value="暂无更新"/>
+ <lanstr id="STR_LANGUAGE_SELECTION" value="语言选择"/>
+ <lanstr id="STR_RESET_CONFIRM" value="是否确定重新启动?"/>
+ <lanstr id="STR_SHUTDOWN_CONFIRM" value="是否确定关机?"/>
+ <lanstr id="STR_RESET_CONFIRM_NOTE" value="该操作会清空并重置手表数据,是否确认继续?"/>
</language>
STR_RESTART = 307,\r
STR_SHUTDOWN = 308,\r
STR_FACTORY_RESET = 309,\r
- STR_LANGUAGE = 310,\r
- STR_MAX_ID = 311,\r
+ STR_WATCH_NAME = 310,\r
+ STR_FIRMWARE_VERSION = 311,\r
+ STR_BLUETOOTH_NAME = 312,\r
+ STR_BLUETOOTH_ADDRESS = 313,\r
+ STR_LATEST_VERSION = 314,\r
+ STR_LATER = 315,\r
+ STR_UP_TO_DATE = 316,\r
+ STR_NO_UPDATE = 317,\r
+ STR_LANGUAGE_SELECTION = 318,\r
+ STR_RESET_CONFIRM = 319,\r
+ STR_SHUTDOWN_CONFIRM = 320,\r
+ STR_RESET_CONFIRM_NOTE = 321,\r
+ STR_MAX_ID = 322,\r
}; // UIResourceTextId\r
enum FontLanguageId : uint8_t {
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-03-28 14:16:52
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-03-30 20:35:38
+ * @LastEditTime: 2024-05-07 10:01:25
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/language/include/LanguageSwitchPresenter.h
*/
#ifndef LANGUAGE_SWITCH_PRESENTER_H
bool OnDragEnd(UIView &view, const DragEvent &event) override;
bool OnKeyAct(UIView &view, const KeyEvent &event) override; // 增加按键事件
LanguageSwitchModel *p_LanguageSwitchModel{nullptr};
- UILabelButtonExt *LabelButton[MAX_LANGUAGE]{nullptr};
+ //UILabelButtonExt *LabelButton[MAX_LANGUAGE]{nullptr};
ImageInfo *NotSelectedImg;
ImageInfo *SelectedImg;
UILabelExt *m_labelext{nullptr};
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-03-28 14:17:43
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-04-30 11:27:38
+ * @LastEditTime: 2024-05-07 10:02:26
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/language/src/LanguageSwitchPresenter.cpp
*/
#include "AppViewIDs.h"
else
{
g_planguage->ChangeLanguage(p_LanguageSwitchModel->GetCurLanguageCode());
- m_labelext->SetTextId(STR_LANGUAGE);
+ m_labelext->SetTextId(STR_LANGUAGE_SELECTION);
m_labelext->ForceResetText(); // 强制刷新
p_UILabelButtonExt->SetImageSrc(SelectedImg, SelectedImg);
LanguageSwitchViewTitleLabel->SetStyle(STYLE_TEXT_FONT, TITLE_LABEL_TEXT_FONT);
LanguageSwitchViewTitleLabel->SetStyle(STYLE_LINE_HEIGHT, TITLE_LABEL_LINE_HEIGHT);
// LanguageSwitchViewTitleLabel->SetText("语言");
- LanguageSwitchViewTitleLabel->SetTextId(STR_LANGUAGE);
+ LanguageSwitchViewTitleLabel->SetTextId(STR_LANGUAGE_SELECTION);
LanguageSwitchViewTitleLabel->ForceResetText();
LanguageSwitchViewTitleLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
LanguageSwitchViewTitleLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
* @Author: luozheng 1732036298@qq.com\r
* @Date: 2024-03-30 09:14:38\r
* @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-05-06 19:09:44\r
+ * @LastEditTime: 2024-05-07 10:31:43\r
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemAboutTheWatchView.h\r
*/\r
#ifndef SYSTEM_ABOUT_VIEW_H\r
int16_t fontSize; // 字体大小\r
int16_t lineHeigh; // 行高\r
std::string text; // 文本\r
+ uint16_t textId; \r
uint8_t lineBreakMode; // 断行模式。\r
};\r
UIScrollView *SystemAbouTheWatchtInitIView(void);\r
UILabel *BluetoothName{nullptr}; // "蓝牙名称"\r
UILabelExt *BluetoothAddressTitle{nullptr}; // "蓝牙地址Title"\r
UILabel *BluetoothAddress{nullptr}; // "蓝牙地址"\r
- UILabelExt *Network4GTitle{nullptr}; // "4G ModemTitle"\r
+ UILabel *Network4GTitle{nullptr}; // "4G ModemTitle"\r
UILabel *Network4G{nullptr}; // "4G Modem"\r
- UILabelExt *PyVerTitle{nullptr}; // "pyVerTitle"\r
+ UILabel *PyVerTitle{nullptr}; // "pyVerTitle"\r
UILabel *PyVer{nullptr}; // "pyVer"\r
- UILabelExt *IMELTitle{nullptr}; // "IMELTitle"\r
+ UILabel *IMELTitle{nullptr}; // "IMELTitle"\r
UILabel *IMEL{nullptr}; // "IMELTitle"\r
- UILabelExt *FONTTitle = nullptr;\r
+ UILabel *FONTTitle = nullptr;\r
UILabel *FONT = nullptr;\r
\r
bool initViewStatus{false};\r
+/*\r
+ * @Author: luozheng 1732036298@qq.com\r
+ * @Date: 2024-01-29 15:37:44\r
+ * @LastEditors: luozheng 1732036298@qq.com\r
+ * @LastEditTime: 2024-05-07 09:39:01\r
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemFactoryResetView.h\r
+ */\r
#ifndef SYSTEM_FACTORYRESET_VIEW_H\r
#define SYSTEM_FACTORYRESET_VIEW_H\r
\r
#include "components/ui_image_view.h"\r
#include "components/ui_button.h"\r
#include "components/ui_scroll_view.h"\r
+#include "components/ui_label_ext.h"\r
namespace OHOS\r
{\r
class SystemFactoryResetView\r
\r
private:\r
UIScrollView *scrollView{nullptr};\r
- UIImageView *FactoryResetImage{nullptr}; // 恢复出厂设置背景图片\r
+ UILabelExt *Title{nullptr};\r
+ UIImageView *FactoryResetImage{nullptr};\r
+ UILabelExt *FactoryResetNote{nullptr};\r
UIButton *FactoryResetButtonCheckOn{nullptr}; // 重置确认\r
UIButton *FactoryResetButtonCheckOff{nullptr}; // 重置否定\r
bool initViewStatus{false};\r
label->SetPosition(labelConfig.left, labelConfig.top, labelConfig.width, labelConfig.height); // 位置大小\r
label->SetStyle(STYLE_TEXT_FONT, labelConfig.fontSize); // 字体大小\r
label->SetStyle(STYLE_LINE_HEIGHT, labelConfig.lineHeigh); // 字体行高\r
- label->SetText(labelConfig.text.c_str()); // 内容\r
- label->SetLineBreakMode(labelConfig.lineBreakMode); // 断行模式。\r
+ // label->SetText(labelConfig.text.c_str()); // 内容\r
+ label->SetTextId(labelConfig.textId);\r
+ label->SetLineBreakMode(labelConfig.lineBreakMode); // 断行模式。\r
label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP);\r
label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelConfig.fontSize);\r
return label;\r
.height = SYSTEM_ABOUT_THEWATCH_TITLE_H,\r
.fontSize = SYSTEM_ABOUT_THEWATCH_TITLE_FONTSIZE,\r
.lineHeigh = SYSTEM_ABOUT_THEWATCH_TITLE_LINEHEIGHT,\r
- .text = "关于",\r
+ .text = "关于手表",\r
+ .textId = STR_ABOUT_WATCH,\r
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,\r
};\r
SystemAboutTheWatchTitle = InitLabel_Ext(Config);\r
.fontSize = TITLE_LABEL_FONTSIZE,\r
.lineHeigh = TITLE_LABEL_LINEHEIGHT,\r
.text = "手表名称",\r
+ .textId = STR_WATCH_NAME,\r
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,\r
};\r
WatchNameTitle = InitLabel_Ext(Config);\r
.fontSize = TITLE_LABEL_FONTSIZE,\r
.lineHeigh = TITLE_LABEL_LINEHEIGHT,\r
.text = "固件版本",\r
+ .textId = STR_FIRMWARE_VERSION,\r
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,\r
};\r
FirmwareVersionTitle = InitLabel_Ext(Config);\r
.fontSize = TITLE_LABEL_FONTSIZE,\r
.lineHeigh = TITLE_LABEL_LINEHEIGHT,\r
.text = "蓝牙名称",\r
+ .textId = STR_BLUETOOTH_NAME,\r
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,\r
};\r
BluetoothNameTitle = InitLabel_Ext(Config);\r
.fontSize = TITLE_LABEL_FONTSIZE,\r
.lineHeigh = TITLE_LABEL_LINEHEIGHT,\r
.text = "蓝牙地址",\r
+ .textId = STR_BLUETOOTH_ADDRESS,\r
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,\r
};\r
BluetoothAddressTitle = InitLabel_Ext(Config);\r
.text = "4G Modem",\r
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,\r
};\r
- Network4GTitle = InitLabel_Ext(Config);\r
+ Network4GTitle = InitLabel(Config);\r
if (Network4GTitle == nullptr)\r
{\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::Network4GTitle new fail!");\r
.text = "pyVer",\r
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,\r
};\r
- PyVerTitle = InitLabel_Ext(Config);\r
+ PyVerTitle = InitLabel(Config);\r
if (PyVerTitle == nullptr)\r
{\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::PyVerTitle new fail!");\r
.text = "IMEI",\r
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,\r
};\r
- IMELTitle = InitLabel_Ext(Config);\r
+ IMELTitle = InitLabel(Config);\r
if (IMELTitle == nullptr)\r
{\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::IMELTitle new fail!");\r
.text = "FONTS",\r
.lineBreakMode = UILabel::LINE_BREAK_MARQUEE,\r
};\r
- FONTTitle = InitLabel_Ext(Config);\r
+ FONTTitle = InitLabel(Config);\r
if (FONTTitle == nullptr)\r
{\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FONTTitle new fail!");\r
#include "system/include/SystemPresenter.h"\r
#include "wearable_log.h"\r
#include "UiConfig.h"\r
+#include "language/font/ui_resource_string.h"\r
\r
namespace OHOS\r
{\r
if (initViewStatus == true)\r
{\r
scrollView->RemoveAll();\r
+ \r
+ delete Title;\r
+ Title =nullptr;\r
+\r
delete FactoryResetImage;\r
FactoryResetImage = nullptr;\r
+\r
+ delete FactoryResetNote;\r
+ FactoryResetNote = nullptr;\r
+ \r
delete FactoryResetButtonCheckOn;\r
FactoryResetButtonCheckOn = nullptr;\r
+ \r
delete FactoryResetButtonCheckOff;\r
FactoryResetButtonCheckOff = nullptr;\r
+ \r
delete scrollView;\r
scrollView = nullptr;\r
}\r
scrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());\r
scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff);\r
scrollView->SetStyle(STYLE_BORDER_RADIUS, 1294);\r
+ /* ---------------------------------- Title --------------------------------- */\r
+ Title = new UILabelExt();\r
+ if (Title == nullptr)\r
+ {\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemFactoryResetView::new Title fail!");\r
+ return nullptr;\r
+ }\r
+ Title->SetPosition(83, 52, 300, 35);\r
+ Title->SetStyle(STYLE_TEXT_FONT, 30);\r
+ Title->SetStyle(STYLE_LINE_HEIGHT, 35);\r
+ // Title->SetText("恢复出厂");\r
+ Title->SetTextId(STR_FACTORY_RESET);\r
+ Title->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);\r
+ Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);\r
+ Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);\r
/* ---------------------------- FactoryResetImage --------------------------- */\r
FactoryResetImage = new UIImageView();\r
if (FactoryResetImage == nullptr)\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemFactoryResetView::new FactoryResetImage fail!");\r
return nullptr;\r
}\r
- FactoryResetImage->SetPosition(0, 0, 466, 466);\r
- FactoryResetImage->SetStyle(STYLE_BORDER_RADIUS, 300);\r
- FactoryResetImage->SetSrc("/user/res/system/factoryreset.bin"); // 恢复出厂设置\r
+ FactoryResetImage->SetPosition(193, 120);\r
+ FactoryResetImage->SetSrc(PNG_ATTENTION_IMAGE);\r
+ /* ---------------------------- FactoryResetNote ---------------------------- */\r
+ FactoryResetNote = new UILabelExt();\r
+ if (FactoryResetNote == nullptr)\r
+ {\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemFactoryResetView::new FactoryResetNote fail!");\r
+ return nullptr;\r
+ }\r
+ FactoryResetNote->SetPosition(53, 228,360,70); \r
+ FactoryResetNote->SetStyle(STYLE_TEXT_FONT, 30);\r
+ FactoryResetNote->SetStyle(STYLE_LINE_HEIGHT, 35);\r
+ //FactoryResetNote->SetText("该操作会清空并重置手表数据,是否确认继续?");\r
+ FactoryResetNote->SetTextId(STR_RESET_CONFIRM_NOTE);\r
+ FactoryResetNote->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);\r
+ FactoryResetNote->SetTextColor(Color::GetColorFromRGBA(0xff, 0x8a, 0x36, 0xff));\r
+ FactoryResetNote->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);\r
+ FactoryResetNote->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);\r
/* ----------------------- FactoryResetButtonCheckOff ----------------------- */\r
FactoryResetButtonCheckOff = new UIButton();\r
if (FactoryResetButtonCheckOff == nullptr)\r
FactoryResetButtonCheckOff->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
FactoryResetButtonCheckOff->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED);\r
FactoryResetButtonCheckOff->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
+ FactoryResetButtonCheckOff->SetImageSrc(PNG_SYSTEM_CHECK_OFF_IMAGE, PNG_SYSTEM_CHECK_OFF_IMAGE);\r
UIView::OnClickListener *FactoryResetButtonCheckOffClick = static_cast<UIView::OnClickListener *>(SystemPresenter::GetInstance());\r
FactoryResetButtonCheckOff->SetOnClickListener(FactoryResetButtonCheckOffClick);\r
/* ------------------------ FactoryResetButtonCheckOn ----------------------- */\r
FactoryResetButtonCheckOn->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
FactoryResetButtonCheckOn->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED);\r
FactoryResetButtonCheckOn->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
+ FactoryResetButtonCheckOn->SetImageSrc(PNG_SYSTEM_CHECK_ON_IMAGE, PNG_SYSTEM_CHECK_ON_IMAGE);\r
UIView::OnClickListener *FactoryResetButtonCheckOnClick = static_cast<UIView::OnClickListener *>(SystemPresenter::GetInstance());\r
FactoryResetButtonCheckOn->SetOnClickListener(FactoryResetButtonCheckOnClick);\r
\r
/* ----------------------------- Add to scroView ---------------------------- */\r
+ scrollView->Add(Title);\r
scrollView->Add(FactoryResetImage);\r
+ scrollView->Add(FactoryResetNote);\r
scrollView->Add(FactoryResetButtonCheckOff);\r
scrollView->Add(FactoryResetButtonCheckOn);\r
initViewStatus = true;\r
STR_RESTART = 307,\r
STR_SHUTDOWN = 308,\r
STR_FACTORY_RESET = 309,\r
- STR_LANGUAGE = 310,\r
- STR_MAX_ID = 311,\r
+ STR_WATCH_NAME = 310,\r
+ STR_FIRMWARE_VERSION = 311,\r
+ STR_BLUETOOTH_NAME = 312,\r
+ STR_BLUETOOTH_ADDRESS = 313,\r
+ STR_LATEST_VERSION = 314,\r
+ STR_LATER = 315,\r
+ STR_UP_TO_DATE = 316,\r
+ STR_NO_UPDATE = 317,\r
+ STR_LANGUAGE_SELECTION = 318,\r
+ STR_RESET_CONFIRM = 319,\r
+ STR_SHUTDOWN_CONFIRM = 320,\r
+ STR_RESET_CONFIRM_NOTE = 321,\r
+ STR_MAX_ID = 322,\r
}; // UIResourceTextId\r
enum FontLanguageId : uint8_t {
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:deb0e9546c9f3a1d59c39d7645d89fc9608306b7c38b8c14ece8530c5689b3de
+size 344