-/***
- * @Date: 2024-04-16 19:15:33
- * @LastEditors: Caisking 3449750381@qq.com
- * @LastEditTime: 2024-04-16 19:56:24
- * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/fd230app/nativeui/main/include/PullUpDownView.h
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-04-17 15:26:49
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-04-26 15:17:25
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/include/PullUpDownView.h
*/
-
/*
* Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved.
* Description: WeekStep
namespace OHOS
{
+ static constexpr int16_t SETTING_INDEX = 0;
+ static constexpr int16_t LIGHTING_INDEX = 1;
+ static constexpr int16_t DNOTDISTURB_INDEX = 2;
+ static constexpr int16_t SAVEPOWER_INDEX = 3;
+ static constexpr int16_t FINDPHONE_INDEX = 4;
+ static constexpr int16_t MAX_INDEX = 5;
+
class PullUpDownView : public UICardPage
{
public:
void UpdateDnotDisturbStatus(int status);
bool InitBaseData(); // 初始化基础数据组件
void RefreshData(); // 刷新数据
-
+
UILabel *GetTimeLabel();
UILabel *GetDateLabel();
UILabel *GetWeekLabel();
UIBoxProgress *GetProgress();
+ void ClearAll();
+ bool InitSingalComponentsView();
+ void ClearAllSingalComponentsView();
+ void SetSingalComponentsVisible(int SignalStrength);
+ int GetSignalStrength(void);
+
+ void ClearAllConnectedStatusComponentsView();
+ bool GetPhoneConnectedStatus(void);
+ bool GetEarPhoneConnectedStatus(void);
+ bool GetBluetoothConnectedStatus(void);
+
private:
- UIImageView *dropSetting{nullptr}; // 设置
- UIImageView *dropLighting{nullptr}; // 亮屏
- UIImageView *dropDnotDisturb{nullptr}; // 勿扰模式
- UIImageView *dropSavePower{nullptr}; // 省电
- UIImageView *drofindPhone{nullptr}; // 找手机
- UIImageView *dropIconBackground[5]{nullptr}; // 放置各个icon的背景
- UIImageView *showPhoneConnectedStatus{nullptr}; // 显示手机连接状态
- UIImageView *showEarPhoneConnectedStatus{nullptr}; // 显示耳机连接状态
- UIImageView *showBluetoothConnectedStatus{nullptr}; // 显示蓝牙连接状态
- UIImageView *dropLine{nullptr}; // 线
- UILabel *showTimeLabel{nullptr}; // 显示时间
- UILabel *showDateLabel{nullptr}; // 显示日期
- UILabel *showWeekLabel{nullptr}; // 显示星期
+ UIImageView *dropSetting{nullptr}; // 设置
+ UIImageView *dropLighting{nullptr}; // 蓝牙
+ UIImageView *dropDnotDisturb{nullptr}; // 勿扰模式
+ UIImageView *dropSavePower{nullptr}; // 省电
+ UIImageView *drofindPhone{nullptr}; // 找手机
+ UIImageView *dropIconBackground[MAX_INDEX]{nullptr}; // 放置各个icon的背景
+ UIButton *connectedStatusBackgroundButton{nullptr}; // 放置连接状态icon的背景按钮
+ UIImageView *showPhoneConnectedStatus{nullptr}; // 显示手机连接状态
+ UIImageView *showEarPhoneConnectedStatus{nullptr}; // 显示耳机连接状态
+ UIImageView *showBluetoothConnectedStatus{nullptr}; // 显示蓝牙连接状态
+ UIImageView *dropLine{nullptr}; // 线
+ UILabel *showTimeLabel{nullptr}; // 显示时间
+ UILabel *showDateLabel{nullptr}; // 显示日期
+ UILabel *showWeekLabel{nullptr}; // 显示星期
+ UIImageView *showSignalStrength[4]{nullptr}; // 信号强度
+ UILabel *Singal_4{nullptr}; // 4G图标
+ UIImageView *NoSignal{nullptr}; // 无信号
UIImageView *batteryimage = nullptr;
UIBoxProgress *progress = nullptr;
namespace OHOS
{
- static constexpr int16_t SETTING_INDEX = 0;
- static constexpr int16_t LIGHTING_INDEX = 1;
- static constexpr int16_t DNOTDISTURB_INDEX = 2;
- static constexpr int16_t SAVEPOWER_INDEX = 3;
- static constexpr int16_t FINDPHONE_INDEX = 4;
- static constexpr int16_t MAX_INDEX = 5;
-
/* ---------------------------------- 坐标位置 ---------------------------------- */
// 设置
constexpr int16_t SETTING_IMG_X = 30;
constexpr int16_t WEEK_LABEL_Y = 300;
// 手机连接状态
- constexpr int16_t PHONECONNECTSTATUS_BUTTON_X = 155;
- constexpr int16_t PHONECONNECTSTATUS_BUTTON_Y = 369;
+ constexpr int16_t PHONECONNECTSTATUS_BUTTON_X = 123;
+ constexpr int16_t PHONECONNECTSTATUS_BUTTON_Y = 350;
+ constexpr int16_t PHONECONNECTSTATUS_BUTTON_W = 60;
+ constexpr int16_t PHONECONNECTSTATUS_BUTTON_H = 60;
// 耳机连接状态
- constexpr int16_t EARPHONESCONNECTSTATUS_BUTTON_X = 217;
- constexpr int16_t EARPHONESCONNECTSTATUS_BUTTON_Y = 369;
+ constexpr int16_t EARPHONESCONNECTSTATUS_BUTTON_X = 203;
+ constexpr int16_t EARPHONESCONNECTSTATUS_BUTTON_Y = 350;
+ constexpr int16_t EARPHONESCONNECTSTATUS_BUTTON_W = 60;
+ constexpr int16_t EARPHONESCONNECTSTATUS_BUTTON_H = 60;
// 蓝牙连接状态
- constexpr int16_t BLUETOOTHCONNECTSTATUS_BUTTON_X = 279;
- constexpr int16_t BLUETOOTHCONNECTSTATUS_BUTTON_Y = 369;
+ constexpr int16_t BLUETOOTHCONNECTSTATUS_BUTTON_X = 283;
+ constexpr int16_t BLUETOOTHCONNECTSTATUS_BUTTON_Y = 350;
+ constexpr int16_t BLUETOOTHCONNECTSTATUS_BUTTON_W = 60;
+ constexpr int16_t BLUETOOTHCONNECTSTATUS_BUTTON_H = 60;
/* -------------------------------------------------------------------------- */
std::string getWeekString(int wday)
{
PullUpDownView::~PullUpDownView()
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::~PullUpDownView");
+ ClearAll();
+ g_pPullUpDownView = nullptr;
+ }
+
+ PullUpDownView *PullUpDownView::GetInstance(void)
+ {
+ return g_pPullUpDownView;
+ }
+
+ void PullUpDownView::ClearAll()
+ {
RemoveAll();
+
for (int i = 0; i < MAX_INDEX; i++)
{
delete dropIconBackground[i];
dropIconBackground[i] = nullptr;
}
+
delete dropSetting;
dropSetting = nullptr;
+
delete dropLighting;
dropLighting = nullptr;
+
delete dropDnotDisturb;
dropDnotDisturb = nullptr;
+
delete dropLine;
dropLine = nullptr;
+
delete dropSavePower;
dropSavePower = nullptr;
+
delete drofindPhone;
drofindPhone = nullptr;
+
delete showTimeLabel;
showTimeLabel = nullptr;
+
delete showDateLabel;
showDateLabel = nullptr;
+
delete showWeekLabel;
showWeekLabel = nullptr;
- delete showPhoneConnectedStatus;
- showPhoneConnectedStatus = nullptr;
- delete showEarPhoneConnectedStatus;
- showEarPhoneConnectedStatus = nullptr;
- delete showBluetoothConnectedStatus;
- showBluetoothConnectedStatus = nullptr;
+ /* -------------------------------------------------------------------------- */
+ ClearAllSingalComponentsView();
+ ClearAllConnectedStatusComponentsView();
/* -------------------------------------------------------------------------- */
delete progress;
progress = nullptr;
+
if (progresscallback_ != nullptr)
{
delete progresscallback_;
progresscallback_ = nullptr;
}
+
if (progressanimator_ != nullptr)
{
progressanimator_->Stop();
delete progressanimator_;
progressanimator_ = nullptr;
}
- /* -------------------------------------------------------------------------- */
- g_pPullUpDownView = nullptr;
- }
-
- PullUpDownView *PullUpDownView::GetInstance(void)
- {
- static PullUpDownView instance;
- return &instance;
}
/// @brief 初始化icon图标背景
dropSetting->SetViewId(DROPDOWN_CLICK_SETTING); // 进入设置界面
dropSetting->SetTouchable(true);
dropSetting->SetOnClickListener(clickListener);
- /* ----------------------------------- 亮屏 ----------------------------------- */
+ /* ----------------------------------- 蓝牙 ----------------------------------- */
dropLighting = new UIImageView();
if (dropLighting == nullptr)
{
dropLighting->SetPosition(LIGHTING_IMG_X, LIGHTING_IMG_Y, ICON_IMG_SIZE_W, ICON_IMG_SIZE_H);
dropLighting->SetAutoEnable(false);
dropLighting->SetResizeMode(UIImageView::CENTER);
- ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, dropLighting, DROPDOWN_LIGHTING);
+ ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, dropLighting, DROPDOWN_BLUETOOTH);
dropLighting->SetViewId(DROPDOWN_CLICK_LIGHTING); // 进入亮屏界面
dropLighting->SetTouchable(true);
dropLighting->SetOnClickListener(clickListener);
Add(dropLine);
}
+ // 获取手机连接状态
+ bool PullUpDownView::GetPhoneConnectedStatus(void)
+ {
+ return true;
+ }
+
+ // 获取蓝牙耳机连接状态
+ bool PullUpDownView::GetEarPhoneConnectedStatus(void)
+ {
+ return true;
+ }
+
+ // 获取蓝牙连接状态
+ bool PullUpDownView::GetBluetoothConnectedStatus(void)
+ {
+ return true;
+ }
+
/// @brief 连接状态
/// @param void
void PullUpDownView::InitTimeDateWeekLabelAndConnectedStatusImage(void)
{
- bool ConnectedStatus = false;
+ if (connectedStatusBackgroundButton == nullptr)
+ {
+ connectedStatusBackgroundButton = new UIButton();
+ }
+ connectedStatusBackgroundButton->SetPosition(113, 348, 240, 64);
+ connectedStatusBackgroundButton->SetViewId(CONNECTEDSTATUSBACKGROUNDBUTTON);
+ connectedStatusBackgroundButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
+ connectedStatusBackgroundButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+ // connectedStatusBackgroundButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED);
+ // connectedStatusBackgroundButton->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);
+ // connectedStatusBackgroundButton->SetStyleForState(STYLE_BORDER_COLOR, 0xffffffff, UIButton::PRESSED);
+ // connectedStatusBackgroundButton->SetStyleForState(STYLE_BORDER_OPA, 0x00, UIButton::PRESSED);
+ UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::MainPresenterSample::GetInstance();
+ // connectedStatusBackgroundButton->SetOnClickListener(clickListener);
+ Add(connectedStatusBackgroundButton);
/* -------------------------------- 显示手机连接状态 -------------------------------- */
showPhoneConnectedStatus = new UIImageView();
if (showPhoneConnectedStatus == nullptr)
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showPhoneConnectedStatus new fail");
return;
}
- showPhoneConnectedStatus->SetPosition(PHONECONNECTSTATUS_BUTTON_X, PHONECONNECTSTATUS_BUTTON_Y);
- if (ConnectedStatus) // 获取手机连接状态
+ showPhoneConnectedStatus->SetPosition(PHONECONNECTSTATUS_BUTTON_X, PHONECONNECTSTATUS_BUTTON_Y, PHONECONNECTSTATUS_BUTTON_W, PHONECONNECTSTATUS_BUTTON_H);
+ showPhoneConnectedStatus->SetAutoEnable(false);
+ showPhoneConnectedStatus->SetResizeMode(UIImageView::CENTER);
+ showPhoneConnectedStatus->SetStyle(STYLE_BORDER_RADIUS, 30);
+ if (GetPhoneConnectedStatus()) // 获取手机连接状态
{
ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, showPhoneConnectedStatus, DROPDOWN_PHONECONNECTED);
}
{
ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, showPhoneConnectedStatus, DROPDOWN_PHONEDISCONNECTED);
}
+
/* -------------------------------- 显示耳机连接状态 -------------------------------- */
showEarPhoneConnectedStatus = new UIImageView();
if (showEarPhoneConnectedStatus == nullptr)
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showEarPhoneConnectedStatus new fail");
return;
}
- showEarPhoneConnectedStatus->SetPosition(EARPHONESCONNECTSTATUS_BUTTON_X, EARPHONESCONNECTSTATUS_BUTTON_Y);
- if (ConnectedStatus) // 获取耳机连接状态
+ showEarPhoneConnectedStatus->SetPosition(EARPHONESCONNECTSTATUS_BUTTON_X, EARPHONESCONNECTSTATUS_BUTTON_Y, EARPHONESCONNECTSTATUS_BUTTON_W, EARPHONESCONNECTSTATUS_BUTTON_H);
+ showEarPhoneConnectedStatus->SetAutoEnable(false);
+ showEarPhoneConnectedStatus->SetResizeMode(UIImageView::CENTER);
+ showEarPhoneConnectedStatus->SetStyle(STYLE_BORDER_RADIUS, 30);
+ if (GetEarPhoneConnectedStatus()) // 获取耳机连接状态
{
ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, showEarPhoneConnectedStatus, DROPDOWN_EARPHONESCONNECTED);
}
{
ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, showEarPhoneConnectedStatus, DROPDOWN_EARPHONESDISCONNECTED);
}
+
/* -------------------------------- 显示蓝牙连接状态 -------------------------------- */
showBluetoothConnectedStatus = new UIImageView();
if (showBluetoothConnectedStatus == nullptr)
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showBluetoothConnectedStatus new fail");
return;
}
- showBluetoothConnectedStatus->SetPosition(BLUETOOTHCONNECTSTATUS_BUTTON_X, BLUETOOTHCONNECTSTATUS_BUTTON_Y);
- if (BluetoothModel::GetInstance() == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showBluetoothConnectedStatus model nullptr");
- return;
- }
- if (SettingModel::GetInstance().GetBlueToothConnectStatus()) // 获取蓝牙连接状态
+ showBluetoothConnectedStatus->SetPosition(BLUETOOTHCONNECTSTATUS_BUTTON_X, BLUETOOTHCONNECTSTATUS_BUTTON_Y, BLUETOOTHCONNECTSTATUS_BUTTON_W, BLUETOOTHCONNECTSTATUS_BUTTON_H);
+ showBluetoothConnectedStatus->SetAutoEnable(false);
+ showBluetoothConnectedStatus->SetResizeMode(UIImageView::CENTER);
+ showBluetoothConnectedStatus->SetStyle(STYLE_BORDER_RADIUS, 30);
+ if (GetBluetoothConnectedStatus()) // 获取蓝牙连接状态
{
ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, showBluetoothConnectedStatus, DROPDOWN_BLUETOOTHCONNECTED);
}
{
ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, showBluetoothConnectedStatus, DROPDOWN_BLUETOOTHDISCONNECTED);
}
+ /* -------------------------------------------------------------------------- */
Add(showPhoneConnectedStatus);
Add(showEarPhoneConnectedStatus);
Add(showBluetoothConnectedStatus);
}
+
+ // 清除所有与连接状态相关的视图组件
+ void PullUpDownView::ClearAllConnectedStatusComponentsView()
+ {
+ delete connectedStatusBackgroundButton;
+ connectedStatusBackgroundButton = nullptr;
+
+ delete showPhoneConnectedStatus;
+ showPhoneConnectedStatus = nullptr;
+
+ delete showEarPhoneConnectedStatus;
+ showEarPhoneConnectedStatus = nullptr;
+
+ delete showBluetoothConnectedStatus;
+ showBluetoothConnectedStatus = nullptr;
+ }
+
/***
- * @brief 初始化时间,日期,星期,电池
+ * @brief 初始化时间,日期,星期,电池,信号强度
*/
bool PullUpDownView::InitBaseData()
{
+
+ if (!InitSingalComponentsView())
+ {
+ return false;
+ }
+
/* ---------------------------------- 时间显示 ---------------------------------- */
showTimeLabel = new UILabel();
if (showTimeLabel == nullptr)
showWeekLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
showWeekLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28);
/* ----------------------------------- 电池 ----------------------------------- */
+ batteryimage = new UIImageView();
if (batteryimage == nullptr)
{
- batteryimage = new UIImageView();
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "batteryimage new fail");
+ return false;
+ }
+ if (GetSignalStrength() == 0)
+ {
+ batteryimage->SetPosition(200, 180, 48, 30);
+ }
+ else
+ {
+ batteryimage->SetPosition(258, 180, 48, 30);
}
- batteryimage->SetPosition(210, 180); // widget's left position and top position
- batteryimage->Resize(48, 30); // widget's width and height
- batteryimage->SetViewId("imagebattery"); // Set style
std::string batteryimagesPath = "/user/res/Battery/Battery-E.bin";
batteryimage->SetSrc(batteryimagesPath.c_str());
Add(batteryimage);
/* -------------------------------------------------------------------------- */
+ progress = new UIBoxProgress();
if (progress == nullptr)
{
- progress = new UIBoxProgress();
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "progress new fail");
+ return false;
+ }
+ if (GetSignalStrength() == 0)
+ {
+ batteryimage->SetPosition(206, 180, 48, 30);
+ }
+ else
+ {
+ progress->SetPosition(264, 186, 31, 19);
}
- progress->SetPosition(216, 186); // widget's left position and top position
- progress->Resize(31, 19); // widget's width and height
- progress->SetViewId("progress1"); // Set style
progress->SetValidHeight(19);
progress->SetValidWidth(31);
return true;
}
+ // 初始化信号强度相关组件
+ bool PullUpDownView::InitSingalComponentsView()
+ {
+
+ /* -------------------------------------------------------------------------- */
+ NoSignal = new UIImageView();
+ if (NoSignal == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "NoSignal new fail");
+ return false;
+ }
+ NoSignal->SetPosition(160, 176, 36, 38);
+ NoSignal->SetAutoEnable(false);
+ NoSignal->SetResizeMode(UIImageView::CENTER);
+ ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, NoSignal, DROPDOWN_NOSIGNAL);
+ NoSignal->SetVisible(false);
+ Add(NoSignal);
+ /* -------------------------------------------------------------------------- */
+ // 定义一个结构体,用于存储 ImageView 的信息
+ struct ImageViewInfo
+ {
+ int posX;
+ int posY;
+ int width;
+ int height;
+ };
+ // 待添加的 ImageView 信息列表
+ std::vector<ImageViewInfo> imageViewList = {
+ {160, 204, 6, 6},
+ {170, 196, 6, 14},
+ {180, 188, 6, 22},
+ {190, 180, 6, 30},
+ };
+
+ // 循环添加 ImageView 到相应的容器中
+ for (int i = 0; i < 4; i++)
+ {
+ if (showSignalStrength[i] == nullptr)
+ {
+ showSignalStrength[i] = new UIImageView();
+ if (showSignalStrength[i] == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showSignalStrength[%d] new fail", i);
+ return false;
+ }
+ }
+ showSignalStrength[i]->SetPosition(imageViewList[i].posX, imageViewList[i].posY, imageViewList[i].width, imageViewList[i].height);
+ if (i < GetSignalStrength())
+ {
+ showSignalStrength[i]->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
+ }
+ else
+ {
+ showSignalStrength[i]->SetStyle(STYLE_BACKGROUND_COLOR, 0xff383838);
+ }
+ showSignalStrength[i]->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ showSignalStrength[i]->SetStyle(STYLE_BORDER_RADIUS, 10);
+ Add(showSignalStrength[i]);
+ showSignalStrength[i]->SetVisible(false);
+ }
+ /* -------------------------------------------------------------------------- */
+ if (Singal_4 == nullptr)
+ {
+ Singal_4 = new UILabel();
+ }
+ Singal_4->SetPosition(201, 176, 40, 47);
+ Singal_4->SetStyle(STYLE_TEXT_FONT, 34);
+ Singal_4->SetStyle(STYLE_LINE_HEIGHT, 40);
+ Singal_4->SetText("4G");
+ Singal_4->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+ Singal_4->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ Singal_4->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34);
+ Singal_4->SetVisible(false);
+ Add(Singal_4);
+ /* -------------------------------------------------------------------------- */
+ SetSingalComponentsVisible(GetSignalStrength());
+
+ return true;
+ }
+
+ // 获取信号强度
+ int PullUpDownView::GetSignalStrength(void)
+ {
+ int SignalStrength = 4; // 信号强度
+ return SignalStrength;
+ }
+
+ // 根据信号强度设置信号组件是否可见
+ void PullUpDownView::SetSingalComponentsVisible(int SignalStrength)
+ {
+ if (SignalStrength != 0)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ showSignalStrength[i]->SetVisible(true);
+ }
+ Singal_4->SetVisible(true);
+ }
+ else
+ {
+ NoSignal->SetVisible(true);
+ }
+ }
+
+ // 清除信号强度相关组件
+ void PullUpDownView::ClearAllSingalComponentsView()
+ {
+ if (NoSignal != nullptr)
+ {
+ delete NoSignal;
+ NoSignal = nullptr;
+ }
+
+ for (int i = 0; i < 4; i++)
+ {
+ if (showSignalStrength[i] != nullptr)
+ {
+ delete showSignalStrength[i];
+ showSignalStrength[i] = nullptr;
+ }
+ }
+
+ if (Singal_4 != nullptr)
+ {
+ delete Singal_4;
+ Singal_4 = nullptr;
+ }
+ }
+
bool PullUpDownView::InitView()
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::InitDropDownView caller:");
/*更新勿扰模式状态*/
void PullUpDownView::UpdateDnotDisturbStatus(int status)
{
+ for (int i = 0; i < MAX_INDEX; i++)
+ {
+ if (dropIconBackground[i] == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "dropIconBackground[%d] is nullptr", i);
+ }
+ }
+
if (dropIconBackground[DNOTDISTURB_INDEX] != nullptr)
{
if (status)
uint8_t value = 0;
value = battery_get_voltage(&voltage);
PRINT("Read ALLData!\n");
-
+
// 更新界面显示
showTimeLabel->SetText(timeStr);
showWeekLabel->SetText(weekStr);