From: luozheng <1732036298@qq.com> Date: Wed, 10 Apr 2024 09:29:34 +0000 (+0800) Subject: 1.添加勿扰slice,差关闭抬腕亮屏,震动模式,关闭铃声接口 X-Git-Tag: release_V1.2.70_20241020_135402~1189^2~23 X-Git-Url: http://git.snicker.com.cn/css/static/script.js?a=commitdiff_plain;h=ac3d67825e118e5c4faf7b7028157046b86a5c22;p=mirrors%2FFD230.git 1.添加勿扰slice,差关闭抬腕亮屏,震动模式,关闭铃声接口 2.勿扰模式视图中的显示时间标签用的毫秒级notify实现,后续要讨论更改 --- diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index e51e0c355..40c61eec2 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -308,6 +308,7 @@ set(SOURCES #勿扰 ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/dnotdisturb/src/DnotDisturbView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/dnotdisturb/src/DnotDisturbModel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/language/LanguageInit.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/config/src/ConfigModel.cpp diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h index 8965e819d..814158348 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h @@ -59,6 +59,7 @@ typedef enum : uint16_t VIEW_MAIN_STOPWATCH, // 秒表 VIEW_MAIN_COUNTDOWN, // 计时器 VIEW_DNOTDISTURB, // 勿扰模式 + VIEW_FLASHLIGH, // 手电筒 /* ----------------------------------- 录音 ----------------------------------- */ VIEW_RECORD, /* ---------------------------------- 界面 ---------------------------------- */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbModel.h b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbModel.h new file mode 100644 index 000000000..749756079 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbModel.h @@ -0,0 +1,30 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-10 16:38:44 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-10 16:44:52 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbModel.h + */ +#ifndef DNOTDISTURB_MODEL_H +#define DNOTDISTURB_MODEL_H + +namespace OHOS +{ + class DnotDisturbModel + { + public: + static DnotDisturbModel &GetInstance(void); + void SetDoNotDisturbModeEnabled(bool enabled); + bool GetDoNotDisturbModeEnabled() const; + + private: + DnotDisturbModel(); + DnotDisturbModel(const DnotDisturbModel &) = delete; + DnotDisturbModel &operator=(const DnotDisturbModel &) = delete; + virtual ~DnotDisturbModel(); + + bool isDoNotDisturbModeEnabled = false; // 默认勿扰模式未开启 + }; +} + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbPresenter.h index 72357bcc8..37d9ba928 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbPresenter.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-10 11:58:32 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-10 15:22:51 + * @LastEditTime: 2024-04-10 16:26:47 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbPresenter.h */ @@ -18,6 +18,7 @@ namespace OHOS class DnotDisturbPresenter : public Presenter, public UIView::OnClickListener, public RootView::OnKeyActListener, + public ModelListenerSample, public UIView::OnDragListener { public: @@ -30,6 +31,7 @@ namespace OHOS void OnStop() override; static DnotDisturbPresenter *GetInstance(); + virtual void Notify() override; private: bool OnClick(UIView &view, const ClickEvent &event) override; diff --git a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbView.h b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbView.h index a744564c6..c634f9698 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-10 11:58:15 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-10 15:06:49 + * @LastEditTime: 2024-04-10 16:30:58 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/include/DnotDisturbView.h */ #ifndef DNOTDISTURB_VIEW_H @@ -15,6 +15,8 @@ #include "components/ui_label_ext.h" #include "components/ui_image_view.h" #include "components/ui_label_button_ext.h" +#include "ModelListenerSample.h" +#include "iostream" namespace OHOS { class DnotDisturbPresenter; @@ -27,7 +29,8 @@ namespace OHOS static DnotDisturbView *GetInstance(void); UILabelButtonExt *GetButtonOn(void); UILabelButtonExt *GetButtonOff(void); - + void UpdataTime(); + void OnStart() override; void OnSetUpView() override; void OnTearDownView() override; @@ -38,9 +41,10 @@ namespace OHOS void ClearAll(void); UIScrollView *scrollView = nullptr; UILabelExt *showTimeLabel{nullptr}; // 显示系统时间的标签 + UIImageView *background{nullptr}; UIImageView *DnotDisturbImage{nullptr}; UILabelExt *AttentionLabel{nullptr}; - UILabelButtonExt *ButtonOn; + UILabelButtonExt *ButtonOn; UILabelButtonExt *ButtonOff; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbModel.cpp new file mode 100644 index 000000000..d0711a63a --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbModel.cpp @@ -0,0 +1,25 @@ +#include "dnotdisturb/include/DnotDisturbModel.h" + +namespace OHOS +{ + + DnotDisturbModel::DnotDisturbModel() {} + + DnotDisturbModel::~DnotDisturbModel() {} + + DnotDisturbModel &DnotDisturbModel::GetInstance() + { + static DnotDisturbModel instance; + return instance; + } + + void DnotDisturbModel::SetDoNotDisturbModeEnabled(bool enabled) + { + isDoNotDisturbModeEnabled = enabled; + } + + bool DnotDisturbModel::GetDoNotDisturbModeEnabled() const + { + return isDoNotDisturbModeEnabled; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp index 7eaa0db40..5c21d5f7e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp @@ -2,13 +2,14 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-10 11:58:37 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-10 15:29:22 + * @LastEditTime: 2024-04-10 16:45:23 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbPresenter.cpp */ #include "AppViewIDs.h" #include "NativeAbility.h" #include "dnotdisturb/include/DnotDisturbView.h" #include "dnotdisturb/include/DnotDisturbPresenter.h" +#include "dnotdisturb/include/DnotDisturbModel.h" #include "common/key_code.h" #include namespace OHOS @@ -77,11 +78,15 @@ namespace OHOS } if (&view == p_DnotDisturbView->GetButtonOn()) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " DnotDisturb enable!!"); + DnotDisturbModel::GetInstance().SetDoNotDisturbModeEnabled(true); + uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + NativeAbility::GetInstance().ChangeSlice(preSlice); } else if (&view == p_DnotDisturbView->GetButtonOff()) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " DnotDisturb disable!!"); + DnotDisturbModel::GetInstance().SetDoNotDisturbModeEnabled(false); + uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + NativeAbility::GetInstance().ChangeSlice(preSlice); } return true; } @@ -100,4 +105,9 @@ namespace OHOS } return true; } + + void DnotDisturbPresenter::Notify() + { + DnotDisturbView::GetInstance()->UpdataTime(); + } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp index edd355391..6b2733a30 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-10 11:58:21 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-10 15:21:47 + * @LastEditTime: 2024-04-10 17:16:44 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/dnotdisturb/src/DnotDisturbView.cpp */ #include "dnotdisturb/include/DnotDisturbView.h" @@ -39,12 +39,19 @@ namespace OHOS if (scrollView != nullptr) { scrollView->RemoveAll(); + if (showTimeLabel != nullptr) { delete showTimeLabel; showTimeLabel = nullptr; } + if (background != nullptr) + { + delete background; + background = nullptr; + } + if (DnotDisturbImage != nullptr) { delete DnotDisturbImage; @@ -77,7 +84,7 @@ namespace OHOS if (scrollView == nullptr) { scrollView = new UIScrollView(); - if (scrollView != nullptr) + if (scrollView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DnotDisturbView::scrollView new fail!!"); return; @@ -91,14 +98,22 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DnotDisturbView::showTimeLabel new fail!!"); return; } - showTimeLabel->SetPosition(83, 52, 300, 40); - showTimeLabel->SetStyle(STYLE_TEXT_FONT, 30); - showTimeLabel->SetStyle(STYLE_LINE_HEIGHT, 35); - showTimeLabel->SetText("23:00"); + showTimeLabel->SetPosition(83, 52, 300, 46); + showTimeLabel->SetStyle(STYLE_TEXT_FONT, 40); + showTimeLabel->SetStyle(STYLE_LINE_HEIGHT, 46); showTimeLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); showTimeLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); showTimeLabel->SetRollSpeed(40); - showTimeLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + showTimeLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40); + /* -------------------------------------------------------------------------- */ + background = new UIImageView(); + if (background == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DnotDisturbView::background new fail!!"); + return; + } + background->SetPosition(186, 116); + ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, background, DROPDOWN_ICONELLIPSEPURPLE); /* -------------------------------------------------------------------------- */ DnotDisturbImage = new UIImageView(); if (DnotDisturbImage == nullptr) @@ -109,7 +124,6 @@ namespace OHOS DnotDisturbImage->SetPosition(186, 116, 94, 94); DnotDisturbImage->SetAutoEnable(false); DnotDisturbImage->SetResizeMode(UIImageView::CENTER); - DnotDisturbImage->SetStyle(STYLE_BACKGROUND_COLOR, 0xff8e20e2); ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, DnotDisturbImage, DROPDOWN_DNOTDISTURB); /* -------------------------------------------------------------------------- */ AttentionLabel = new UILabelExt(); @@ -122,7 +136,7 @@ namespace OHOS AttentionLabel->SetStyle(STYLE_TEXT_FONT, 30); AttentionLabel->SetStyle(STYLE_LINE_HEIGHT, 35); AttentionLabel->SetText("开启勿扰模式,手表将不会发出震动与铃声,是否开启"); - AttentionLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + AttentionLabel->SetLineBreakMode(UILabelExt::LINE_BREAK_WRAP); AttentionLabel->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff)); AttentionLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); AttentionLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); @@ -133,10 +147,10 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DnotDisturbView::ButtonOn new fail!!"); return; } - ButtonOn->SetPosition(111, 320, 120, 120); + ButtonOn->SetPosition(256, 320, 120, 120); ButtonOn->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); ButtonOn->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - const char *ButtonOnImgSrc = "/user/res/SYSTEM_CheckOff.bin"; + const char *ButtonOnImgSrc = "/user/res/SYSTEM_CheckOn.bin"; ButtonOn->SetImageSrc(ButtonOnImgSrc, ButtonOnImgSrc); ButtonOn->SetImagePosition(10, 10); ButtonOn->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED); @@ -150,10 +164,10 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DnotDisturbView::ButtonOff new fail!!"); return; } - ButtonOff->SetPosition(256, 320, 120, 120); + ButtonOff->SetPosition(111, 320, 120, 120); ButtonOff->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); ButtonOff->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - const char *ButtonOffImgSrc = "/user/res/SYSTEM_CheckOn.bin"; + const char *ButtonOffImgSrc = "/user/res/SYSTEM_CheckOff.bin"; ButtonOff->SetImageSrc(ButtonOffImgSrc, ButtonOffImgSrc); ButtonOff->SetImagePosition(10, 10); ButtonOff->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED); @@ -163,6 +177,24 @@ namespace OHOS } } + /*更新当前时间*/ + void DnotDisturbView::UpdataTime() + { + // 获取当前时间 + struct tm pTM; + time_t seconds; + time(&seconds); + localtime_r(&seconds, &pTM); + + // 解析时间 + int hour = pTM.tm_hour; + int minute = pTM.tm_min; + + // 将时间和日期转换为字符串 + std::string stringtime = (hour < 10 ? "0" : "") + std::to_string(hour) + ":" + (minute < 10 ? "0" : "") + std::to_string(minute); + showTimeLabel->SetText(stringtime.c_str()); + } + UILabelButtonExt *DnotDisturbView::GetButtonOn(void) { return ButtonOn; @@ -177,12 +209,17 @@ namespace OHOS { View::OnStart(); DnotDisturbViewInit(); + + // 增加按键监听 + RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::DnotDisturbPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); } void DnotDisturbView::OnSetUpView() { View::OnSetUpView(); scrollView->Add(showTimeLabel); + scrollView->Add(background); scrollView->Add(DnotDisturbImage); scrollView->Add(AttentionLabel); scrollView->Add(ButtonOn); diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h index c375d34e8..160db5f08 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-01 15:10:34 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-03-27 10:40:38 + * @LastEditTime: 2024-04-10 15:48:47 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h */ @@ -37,7 +37,7 @@ namespace OHOS static constexpr const char *DROPDOWN_CLICK_BRIGHTENSCREEN = "dropdownclickbrightscreen"; static constexpr const char *DROPDOWN_CLICK_SETTING = "dropdownclicksetting"; // 设置 - static constexpr const char *DROPDOWN_CLICK_LIGHTING = "dropdownclicklighting"; // 亮屏 + static constexpr const char *DROPDOWN_CLICK_LIGHTING = "dropdownclicklighting"; // 手电筒 static constexpr const char *DROPDOWN_CLICK_DNOTDISTURB = "dropdownclickdnotdisturb"; // 勿扰 static constexpr const char *DROPDOWN_CLICK_SAVEELE = "dropdownclicksaveele"; // 省电 static constexpr const char *DROPDOWN_CLICK_FINDMYPHONE = "dropdownclickfindmyphone"; // 找手机 diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp index 4fb797e58..8fd7d41c1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp @@ -36,9 +36,10 @@ namespace OHOS map g_jumpView = { {DROPDOWN_CLICK_SETTING, VIEW_SETTING}, // 设置 - //{DROPDOWN_CLICK_DNOTDISTURB, VIEW_FIND_PHONE}, // 勿扰 - {DROPDOWN_CLICK_SAVEELE, VIEW_SAVEELE}, // 省电模式 - {DROPDOWN_CLICK_FINDMYPHONE, VIEW_FIND_PHONE}, + //{DROPDOWN_CLICK_LIGHTING, VIEW_FLASHLIGH}, // 手电筒 + {DROPDOWN_CLICK_DNOTDISTURB, VIEW_DNOTDISTURB}, // 勿扰 + {DROPDOWN_CLICK_SAVEELE, VIEW_SAVEELE}, // 省电模式 + {DROPDOWN_CLICK_FINDMYPHONE, VIEW_FIND_PHONE}, // 查找手机 }; static MainPresenterSample *g_pMainPresenterSample = nullptr; diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp index 791637bb7..ce32050d9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp @@ -13,15 +13,23 @@ #include "ScreenModels.h" #include "SettingModel.h" #include "ui_resource_image.h" - +#include "dnotdisturb/include/DnotDisturbModel.h" 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 SETTING_IMG_Y = 186; - // 亮屏 + // 手电筒 constexpr int16_t LIGHTING_IMG_X = 76; constexpr int16_t LIGHTING_IMG_Y = 76; @@ -90,7 +98,7 @@ namespace OHOS { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::~PullUpDownView"); RemoveAll(); - for (int i = 0; i < 5; i++) + for (int i = 0; i < MAX_INDEX; i++) { delete dropIconBackground[i]; dropIconBackground[i] = nullptr; @@ -146,7 +154,7 @@ namespace OHOS /// @param void void PullUpDownView::InitViewImgBackGround(void) { - for (int i = 0; i < 5; i++) + for (int i = 0; i < MAX_INDEX; i++) { dropIconBackground[i] = new UIImageView(); if (dropIconBackground[i] == nullptr) @@ -155,14 +163,21 @@ namespace OHOS return; } } - dropIconBackground[0]->SetPosition(SETTING_IMG_X, SETTING_IMG_Y); - dropIconBackground[1]->SetPosition(LIGHTING_IMG_X, LIGHTING_IMG_Y); - dropIconBackground[2]->SetPosition(DNOTDISTURB_IMG_X, DNOTDISTURB_IMG_Y); - dropIconBackground[3]->SetPosition(SAVEPOWER_IMG_X, SAVEPOWER_IMG_Y); - dropIconBackground[4]->SetPosition(FINDPHONE_IMG_X, FINDPHONE_IMG_Y); - for (int i = 0; i < 5; i++) + dropIconBackground[SETTING_INDEX]->SetPosition(SETTING_IMG_X, SETTING_IMG_Y); + dropIconBackground[LIGHTING_INDEX]->SetPosition(LIGHTING_IMG_X, LIGHTING_IMG_Y); + dropIconBackground[DNOTDISTURB_INDEX]->SetPosition(DNOTDISTURB_IMG_X, DNOTDISTURB_IMG_Y); + dropIconBackground[SAVEPOWER_INDEX]->SetPosition(SAVEPOWER_IMG_X, SAVEPOWER_IMG_Y); + dropIconBackground[FINDPHONE_INDEX]->SetPosition(FINDPHONE_IMG_X, FINDPHONE_IMG_Y); + for (int i = 0; i < MAX_INDEX; i++) { - ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, dropIconBackground[i], DROPDOWN_ICONELLIPSEBLACK); + if (i == DNOTDISTURB_INDEX && DnotDisturbModel::GetInstance().GetDoNotDisturbModeEnabled() == true) + { + ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, dropIconBackground[i], DROPDOWN_ICONELLIPSEPURPLE); + } + else + { + ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, dropIconBackground[i], DROPDOWN_ICONELLIPSEBLACK); + } Add(dropIconBackground[i]); } }