static constexpr uint16_t LABEL_W = 400;
static constexpr uint16_t LABEL_H = 40;
static constexpr uint16_t LABEL_FONTSIZE = 30;
- static constexpr uint16_t LABEL_LINEHEIGHT = 35;
+ static constexpr uint16_t LABEL_LINEHEIGHT = 0;
static testAboutView g_pSystemAboutTheWatchView;
void testAboutView::ClearAll()
{
- if (initViewStatus == true)
- {
+ if(testAboutTheWatchScrollView)
+ {
testAboutTheWatchScrollView->RemoveAll();
- delete SystemAboutTheWatchTitle;
- SystemAboutTheWatchTitle = nullptr;
-
- delete WatchNameTitle;
- WatchNameTitle = nullptr;
- delete WatchName;
- WatchName = nullptr;
-
- delete FirmwareVersionTitle;
- FirmwareVersionTitle = nullptr;
- delete FirmwareVersion;
- FirmwareVersion = nullptr;
-
- delete BluetoothNameTitle;
- BluetoothNameTitle = nullptr;
- delete BluetoothName;
- BluetoothName = nullptr;
-
- delete BluetoothAddressTitle;
- BluetoothAddressTitle = nullptr;
- delete BluetoothAddress;
- BluetoothAddress = nullptr;
-
- delete Network4GTitle;
- Network4GTitle = nullptr;
- delete Network4G;
- Network4G = nullptr;
-
- delete PyVerTitle;
- PyVerTitle = nullptr;
- delete PyVer;
- PyVer = nullptr;
-
- delete IMELTitle;
- IMELTitle = nullptr;
- delete IMEL;
- IMEL = nullptr;
-
- delete FONTTitle;
- FONTTitle = nullptr;
- delete FONT;
- FONT = nullptr;
+ if(SystemAboutTheWatchTitle)
+ {
+ delete SystemAboutTheWatchTitle;
+ SystemAboutTheWatchTitle = nullptr;
+ }
+
+ if(FirmwareVersion)
+ {
+ delete FirmwareVersion;
+ FirmwareVersion = nullptr;
+ }
+
+ if(BluetoothAddress)
+ {
+ delete BluetoothAddress;
+ BluetoothAddress = nullptr;
+ }
+ if(Network4G)
+ {
+ delete Network4G;
+ Network4G = nullptr;
+ }
+
+ if(PyVer)
+ {
+ delete PyVer;
+ PyVer = nullptr;
+ }
+
+ if(IMEL)
+ {
+ delete IMEL;
+ IMEL = nullptr;
+ }
+
delete testAboutTheWatchScrollView;
testAboutTheWatchScrollView = nullptr;
- }
+ }
+
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!");
return false;
}
- testAboutTheWatchScrollView->SetOnDragListener(draglistener);
+ testAboutTheWatchScrollView->SetOnDragListener(draglistener);
testAboutTheWatchScrollView->SetTouchable(true);
testAboutTheWatchScrollView->SetDraggable(true);
return nullptr;
}
/* -------------------------------------------------------------------------- */
- LabelConfig Config = {
- .left = SYSTEM_ABOUT_THEWATCH_TITLE_X,
- .top = SYSTEM_ABOUT_THEWATCH_TITLE_Y,
- .width = SYSTEM_ABOUT_THEWATCH_TITLE_W,
- .height = SYSTEM_ABOUT_THEWATCH_TITLE_H,
- .fontSize = SYSTEM_ABOUT_THEWATCH_TITLE_FONTSIZE,
- .lineHeigh = SYSTEM_ABOUT_THEWATCH_TITLE_LINEHEIGHT,
- .text = "关于",
- .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
- };
- SystemAboutTheWatchTitle = InitLabel(Config);
- if (SystemAboutTheWatchTitle == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::SystemAboutTheWatchTitle new fail!");
- return nullptr;
- }
+
+ SystemAboutTheWatchTitle = init_title(142,60,"ABOUT_WATCH");
+
testAboutTheWatchScrollView->Add(SystemAboutTheWatchTitle);
/* -------------------------------------------------------------------------- */
- Config = {
- .left = TITLE_LABEL_X,
- .top = WATCH_NAME_POS_TOP,
- .width = TITLE_LABEL_W,
- .height = TITLE_LABEL_H,
- .fontSize = TITLE_LABEL_FONTSIZE,
- .lineHeigh = TITLE_LABEL_LINEHEIGHT,
- .text = "手表名称",
- .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
- };
- WatchNameTitle = InitLabel(Config);
- if (WatchNameTitle == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::WatchNameTitle new fail!");
- return nullptr;
- }
- testAboutTheWatchScrollView->Add(WatchNameTitle);
+
/* -------------------------------------------------------------------------- */
- Config = {
- .left = LABEL_X,
- .top = WATCH_NAME_VALUE_POS_TOP,
- .width = LABEL_W,
- .height = LABEL_H,
- .fontSize = LABEL_FONTSIZE,
- .lineHeigh = LABEL_LINEHEIGHT,
- .text = "Watch Soar",
- .lineBreakMode = UILabel::LINE_BREAK_WRAP,
- };
- WatchName = InitLabel(Config);
- if (WatchName == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::WatchName new fail!");
- return nullptr;
- }
- WatchName->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff));
- testAboutTheWatchScrollView->Add(WatchName);
- /* -------------------------------------------------------------------------- */
- Config = {
- .left = TITLE_LABEL_X,
- .top = WATCH_FIRMWARE_POS_TOP,
- .width = TITLE_LABEL_W,
- .height = TITLE_LABEL_H,
- .fontSize = TITLE_LABEL_FONTSIZE,
- .lineHeigh = TITLE_LABEL_LINEHEIGHT,
- .text = "固件版本",
- .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
- };
- FirmwareVersionTitle = InitLabel(Config);
- if (FirmwareVersionTitle == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FirmwareVersionTitle new fail!");
- return nullptr;
- }
- testAboutTheWatchScrollView->Add(FirmwareVersionTitle);
+ // Config = {
+ // .left = TITLE_LABEL_X,
+ // .top = WATCH_FIRMWARE_POS_TOP,
+ // .width = TITLE_LABEL_W,
+ // .height = TITLE_LABEL_H,
+ // .fontSize = TITLE_LABEL_FONTSIZE,
+ // .lineHeigh = TITLE_LABEL_LINEHEIGHT,
+ // .text = "固件版本",
+ // .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
+ // };
+ // FirmwareVersionTitle = InitLabel(Config);
+ // if (FirmwareVersionTitle == nullptr)
+ // {
+ // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FirmwareVersionTitle new fail!");
+ // return nullptr;
+ // }
+ // testAboutTheWatchScrollView->Add(FirmwareVersionTitle);
/* -------------------------------------------------------------------------- */
+ #define offest 40
char version_buf[128] = {0};
uint32_t version_len = 128;
uapi_get_buildversion((uint8_t *)version_buf, version_len);
- Config = {
+ char version_buf_[128] = {0};
+ sprintf_s(version_buf_,128,"ver:%s",version_buf);
+ LabelConfig Config = {
.left = LABEL_X,
- .top = WATCH_FIRMWARE_VALUE_POS_TOP,
+ .top = 110,
.width = LABEL_W,
.height = LABEL_H,
.fontSize = LABEL_FONTSIZE,
.lineHeigh = LABEL_LINEHEIGHT,
- .text = (char *)version_buf,
+ .text = (char *)version_buf_,
.lineBreakMode = UILabel::LINE_BREAK_WRAP,
};
FirmwareVersion = InitLabel(Config);
+
if (FirmwareVersion == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FirmwareVersion new fail!");
FirmwareVersion->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff));
testAboutTheWatchScrollView->Add(FirmwareVersion);
/* -------------------------------------------------------------------------- */
- Config = {
- .left = TITLE_LABEL_X,
- .top = WATCH_BT_NAME_TOP,
- .width = TITLE_LABEL_W,
- .height = TITLE_LABEL_H,
- .fontSize = TITLE_LABEL_FONTSIZE,
- .lineHeigh = TITLE_LABEL_LINEHEIGHT,
- .text = "蓝牙名称",
- .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
- };
- BluetoothNameTitle = InitLabel(Config);
- if (BluetoothNameTitle == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::BluetoothNameTitle new fail!");
- return nullptr;
- }
- testAboutTheWatchScrollView->Add(BluetoothNameTitle);
+
+
/* -------------------------------------------------------------------------- */
- uint8_t ble_name[LABEL_FONTSIZE] = {0};
- uint32_t ble_name_len = sizeof(ble_name);
- errcode_t ret = uapi_get_nv_btname(ble_name, &ble_name_len);
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get btname %s ,ret 0x%X\n", ble_name, ret);
-
- Config = {
- .left = LABEL_X,
- .top = WATCH_BT_NAME_VALUE_TOP,
- .width = LABEL_W,
- .height = LABEL_H,
- .fontSize = LABEL_FONTSIZE,
- .lineHeigh = LABEL_LINEHEIGHT,
- .text = (char *)ble_name,
- .lineBreakMode = UILabel::LINE_BREAK_WRAP,
- };
- BluetoothName = InitLabel(Config);
- if (BluetoothName == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::BluetoothName new fail!");
- return nullptr;
- }
- BluetoothName->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff));
- testAboutTheWatchScrollView->Add(BluetoothName);
- /* -------------------------------------------------------------------------- */
- Config = {
- .left = TITLE_LABEL_X,
- .top = WATCH_BT_ADDR_TOP,
- .width = TITLE_LABEL_W,
- .height = TITLE_LABEL_H,
- .fontSize = TITLE_LABEL_FONTSIZE,
- .lineHeigh = TITLE_LABEL_LINEHEIGHT,
- .text = "蓝牙地址",
- .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
- };
- BluetoothAddressTitle = InitLabel(Config);
- if (BluetoothAddressTitle == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::BluetoothAddressTitle new fail!");
- return nullptr;
- }
- testAboutTheWatchScrollView->Add(BluetoothAddressTitle);
+
/* -------------------------------------------------------------------------- */
uint8_t btaddr[6] = {0};
uint8_t btaddr_str[64] = {0};
uint32_t len = 6;
- ret = uapi_get_nv_btaddr((uint8_t *)btaddr, &len);
- sprintf((char *)btaddr_str, "%02X:%02X:%02X:%02X:%02X:%02X", btaddr[0], btaddr[1], btaddr[2], btaddr[3], btaddr[4], btaddr[5]);
+ errcode_t ret = uapi_get_nv_btaddr((uint8_t *)btaddr, &len);
+ sprintf((char *)btaddr_str, "蓝牙地址:%02X:%02X:%02X:%02X:%02X:%02X", btaddr[0], btaddr[1], btaddr[2], btaddr[3], btaddr[4], btaddr[5]);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get btaddr %s , ret 0x%X\n", btaddr_str, ret);
Config = {
.left = LABEL_X,
- .top = WATCH_BT_ADDR_VALUE_TOP,
+ .top = 150+offest,
.width = LABEL_W,
.height = LABEL_H,
.fontSize = LABEL_FONTSIZE,
BluetoothAddress->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff));
testAboutTheWatchScrollView->Add(BluetoothAddress);
/* -------------------------------------------------------------------------- */
- Config = {
- .left = TITLE_LABEL_X,
- .top = WATCH_MODEM_VERSION_TOP,
- .width = TITLE_LABEL_W,
- .height = TITLE_LABEL_H,
- .fontSize = TITLE_LABEL_FONTSIZE,
- .lineHeigh = TITLE_LABEL_LINEHEIGHT,
- .text = "4G Modem",
- .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
- };
- Network4GTitle = InitLabel(Config);
- if (Network4GTitle == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::Network4GTitle new fail!");
- return nullptr;
- }
- testAboutTheWatchScrollView->Add(Network4GTitle);
- /* -------------------------------------------------------------------------- */
- Config = {
- .left = LABEL_X,
- .top = WATCH_MODEM_VERSION_VALUE_TOP,
- .width = LABEL_W,
- .height = LABEL_H,
- .fontSize = LABEL_FONTSIZE - 2,
- .lineHeigh = LABEL_LINEHEIGHT,
- .text = ConfigModel::GetInstance()->GetmoderVer(),
- .lineBreakMode = UILabel::LINE_BREAK_WRAP,
- };
- Network4G = InitLabel(Config);
- if (Network4G == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::Network4G new fail!");
- return nullptr;
- }
- Network4G->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
- testAboutTheWatchScrollView->Add(Network4G);
+
/* -------------------------------------------------------------------------- */
- Config = {
- .left = TITLE_LABEL_X,
- .top = WATCH_MODEM_APP_VERSION_TOP,
- .width = TITLE_LABEL_W,
- .height = TITLE_LABEL_H,
- .fontSize = TITLE_LABEL_FONTSIZE,
- .lineHeigh = TITLE_LABEL_LINEHEIGHT,
- .text = "pyVer",
- .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
- };
- PyVerTitle = InitLabel(Config);
- if (PyVerTitle == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::PyVerTitle new fail!");
- return nullptr;
- }
- testAboutTheWatchScrollView->Add(PyVerTitle);
+ char GetpyVer_buf[256] = {0};
+ sprintf_s(GetpyVer_buf,256,"PY:%s",ConfigModel::GetInstance()->GetpyVer().c_str());
+
/* -------------------------------------------------------------------------- */
Config = {
.left = LABEL_X,
- .top = WATCH_MODEM_APP_VERSION_VALUE_TOP,
+ .top = 190+offest,
.width = LABEL_W,
.height = LABEL_H,
.fontSize = LABEL_FONTSIZE,
.lineHeigh = LABEL_LINEHEIGHT,
- .text = ConfigModel::GetInstance()->GetpyVer(),
+ .text = GetpyVer_buf,
.lineBreakMode = UILabel::LINE_BREAK_WRAP,
};
PyVer = InitLabel(Config);
}
PyVer->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
testAboutTheWatchScrollView->Add(PyVer);
- /* -------------------------------------------------------------------------- */
- Config = {
- .left = TITLE_LABEL_X,
- .top = WATCH_IMEI_TOP,
- .width = TITLE_LABEL_W,
- .height = TITLE_LABEL_H,
- .fontSize = TITLE_LABEL_FONTSIZE,
- .lineHeigh = TITLE_LABEL_LINEHEIGHT,
- .text = "IMEI",
- .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
- };
- IMELTitle = InitLabel(Config);
- if (IMELTitle == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::IMELTitle new fail!");
- return nullptr;
- }
- testAboutTheWatchScrollView->Add(IMELTitle);
+
+ char Getimei_buf[256] = {0};
+ sprintf_s(Getimei_buf,256,"IMEI:%s",ConfigModel::GetInstance()->Getimei().c_str());
+
/* -------------------------------------------------------------------------- */
Config = {
.left = LABEL_X,
- .top = WATCH_IMEI_VALUE_TOP,
+ .top = 230+offest,
.width = LABEL_W,
.height = LABEL_H,
.fontSize = LABEL_FONTSIZE,
.lineHeigh = TITLE_LABEL_LINEHEIGHT,
- .text = ConfigModel::GetInstance()->Getimei(),
+ .text =Getimei_buf, //ConfigModel::GetInstance()->Getimei(),
.lineBreakMode = UILabel::LINE_BREAK_WRAP,
};
IMEL = InitLabel(Config);
IMEL->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
testAboutTheWatchScrollView->Add(IMEL);
/* -------------------------------------------------------------------------- */
- Config = {
- .left = TITLE_LABEL_X,
- .top = WATCH_FONT_TOP,
- .width = TITLE_LABEL_W,
- .height = TITLE_LABEL_H,
- .fontSize = TITLE_LABEL_FONTSIZE,
- .lineHeigh = TITLE_LABEL_LINEHEIGHT,
- .text = "FONTS",
- .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
- };
- FONTTitle = InitLabel(Config);
- if (FONTTitle == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FONTTitle new fail!");
- return nullptr;
- }
- testAboutTheWatchScrollView->Add(FONTTitle);
+ char GetmoderVer_buf[256] = {0};
+ sprintf_s(GetmoderVer_buf,256,"4G:%s",ConfigModel::GetInstance()->GetmoderVer().c_str());
/* -------------------------------------------------------------------------- */
Config = {
.left = LABEL_X,
- .top = WATCH_FONT_VALUE_TOP,
+ .top = 270+offest,
.width = LABEL_W,
.height = LABEL_H,
- .fontSize = LABEL_FONTSIZE,
+ .fontSize = LABEL_FONTSIZE - 2,
.lineHeigh = LABEL_LINEHEIGHT,
- .text = "HarmonyOS Sans",
+ .text = GetmoderVer_buf,
.lineBreakMode = UILabel::LINE_BREAK_WRAP,
};
- FONT = InitLabel(Config);
- if (FONT == nullptr)
+ Network4G = InitLabel(Config);
+ if (Network4G == nullptr)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FONT new fail!");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::Network4G new fail!");
return nullptr;
}
- FONT->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
- testAboutTheWatchScrollView->Add(FONT);
+ Network4G->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
+ testAboutTheWatchScrollView->Add(Network4G);
+
/* -------------------------------------------------------------------------- */
initViewStatus = true;
- labelButton_next =init_button_next(165, WATCH_ABOUT_NEXT_BUTTON_TOP,"LCDButton_next");
+ labelButton_next =init_button_next(165,400,"LCDButton_next");
testAboutTheWatchScrollView->Add(labelButton_next);
return testAboutTheWatchScrollView;