From 781f6a809b902814bfe7847856a8f247b90f8e48 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sun, 7 Apr 2024 17:24:37 +0800 Subject: [PATCH] =?utf8?q?1.=E5=AE=9E=E7=8E=B0=E7=A7=92=E8=A1=A8=E5=8A=9F?= =?utf8?q?=E8=83=BD=EF=BC=8C=E5=88=B6=E5=AE=9A=E8=AE=A1=E6=97=B6=E6=97=B6?= =?utf8?q?=E9=97=B4=E5=A6=82"99:59.99"=E4=B8=8D=E7=9F=A5=E9=81=93=E5=A6=82?= =?utf8?q?=E4=BD=95=E5=AE=9E=E7=8E=B0=202.=E5=9C=A8UiConfig.h=E6=9B=B4?= =?utf8?q?=E6=96=B0=E4=BA=86=E4=B8=A4=E5=BC=A0=E9=80=9A=E7=94=A8=E5=9B=BE?= =?utf8?q?=E7=89=87=EF=BC=8C=E5=B0=86=E4=B9=8B=E5=89=8D=E9=81=97=E7=95=99?= =?utf8?q?=E7=9A=84=E9=87=8D=E5=A4=8D=E5=9B=BE=E7=89=87=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativelauncher/include/UiConfig.h | 3 +- .../nativeui/findphone/src/FindPhoneView.cpp | 6 +- .../src/FastTrainingAttentionView.cpp | 2 +- .../include/MainStopWatchPresenter.h | 10 +- .../stopwatch/include/MainStopWatchView.h | 24 +- .../stopwatch/include/StopWatchModel.h | 19 +- .../include/StopWatchRecordCycleToLimitView.h | 25 +- .../include/StopWatchRecordTimeToLimitView.h | 25 +- .../stopwatch/src/MainStopWatchPresenter.cpp | 110 ++++- .../stopwatch/src/MainStopWatchView.cpp | 459 +++++++++--------- .../nativeui/stopwatch/src/StopWatchModel.cpp | 219 ++++++++- .../src/StopWatchRecordCycleToLimitView.cpp | 182 +++---- .../src/StopWatchRecordTimeToLimitView.cpp | 194 ++++---- .../src/notify/charge_notification.cpp | 2 +- .../src/notify/pairing_notification.cpp | 2 +- ...iningAttentionVector.bin => Attention.bin} | Bin .../fs/user/res/OrangeAttentionVector.bin | Bin 4504 -> 0 bytes .../res/countdown/COUNTDOWN_ATTENTION.bin | Bin 4504 -> 0 bytes .../user/res/countdown/COUNTDOWN_BUTTON.bin | Bin 31224 -> 0 bytes 19 files changed, 789 insertions(+), 493 deletions(-) rename code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/{FastTrainingAttentionVector.bin => Attention.bin} (100%) delete mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/OrangeAttentionVector.bin delete mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/countdown/COUNTDOWN_ATTENTION.bin delete mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/countdown/COUNTDOWN_BUTTON.bin diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h index 757e573d4..61bea2d6f 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h @@ -265,8 +265,9 @@ namespace OHOS static constexpr const char *PNG_SYSTEM_CHECK_OFF_IMAGE = APP_RES_PATH "/SYSTEM_CheckOff.bin"; // 叉 static constexpr const char *PNG_TOGGLEBUTTON_OFF_IMAGE = APP_RES_PATH "/TOGGLEBUTTON_OFF.bin"; // togglebuttton未选中图片 static constexpr const char *PNG_TOGGLEBUTTON_ON_IMAGE = APP_RES_PATH "/TOGGLEBUTTON_ON.bin"; // togglebuttton选中图片 + static constexpr const char *PNG_ATTENTION_IMAGE = APP_RES_PATH "/Attention.bin"; // 注意 + static constexpr const char *PNG_466x100BUTTON_IMAGE = APP_RES_PATH "/466x100button.bin"; // 466x100button图片 - static constexpr const char *PNG_ORANGE_ATTENTION_VECTOR_IMAGE = APP_RES_PATH "/OrangeAttentionVector.bin"; // 橘黄色感叹号图标 /* -------------------------------- 已删除的不必要图片 ------------------------------- */ static constexpr const char *PNG_APPLIST_UI_SAMPLE_IMAGE = APP_RES_PATH "/APPLIST_UI_SAMPLE.bin"; // Applist图标 static constexpr const char *PNG_APPLIST_TEMP_IMAGE = APP_RES_PATH "/TEMP_IMAGE.bin"; diff --git a/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp b/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp index 527843111..b98408148 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp @@ -2,13 +2,14 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-27 10:47:46 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-03-27 19:39:53 + * @LastEditTime: 2024-04-07 16:57:52 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhoneView.cpp */ #include "findphone/include/FindPhoneView.h" #include "findphone/include/FindPhonePresenter.h" #include "wearable_log.h" #include "findphone/include/FindPhoneModel.h" +#include "UiConfig.h" namespace OHOS { @@ -142,8 +143,7 @@ namespace OHOS return; } FindPhoneImageView->SetPosition(193, 140, 80, 80); - const char *imagesPath = "/user/res/FastTrainingAttentionVector.bin"; - FindPhoneImageView->SetSrc(imagesPath); + FindPhoneImageView->SetSrc(PNG_ATTENTION_IMAGE); /* ----------------------------- FindPhoneLabel ----------------------------- */ FindPhoneLabel = new UILabelExt(); if (FindPhoneLabel == nullptr) diff --git a/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingAttentionView.cpp b/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingAttentionView.cpp index 35d0b96ef..7ef2532ef 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingAttentionView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingAttentionView.cpp @@ -77,7 +77,7 @@ namespace OHOS } image7_->SetPosition(193, 121); image7_->Resize(80, 80); - image7_->SetSrc(PNG_ORANGE_ATTENTION_VECTOR_IMAGE); + image7_->SetSrc(PNG_ATTENTION_IMAGE); // Add to scrollView1 scrollView1_->Add(image7_); diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchPresenter.h index ccb4d9e7c..253b6a2c7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchPresenter.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-04 15:13:51 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-04 16:05:17 + * @LastEditTime: 2024-04-07 17:22:21 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchPresenter.h */ #ifndef MAIN_STOPWATCH_PRESENTER_H @@ -15,6 +15,9 @@ /*秒表主视图*/ namespace OHOS { + static constexpr int STOPWATCH_TIMER_DURATION = 10; // 定时器周期,每10毫秒定时器会触发一次 + static constexpr int MAX_RECORD_LOOPS = 99; // 最大记录圈数为99 + static const char *MAX_RECORD_TIME = "99:59.99"; // 最高记录时间为99:59.99 typedef enum { MAIN_STOPWATCH = 0, // 秒表主视图 @@ -42,6 +45,7 @@ namespace OHOS void SetShowTimeLableStyle(UILabel *label, int x, int y, int TextFont, int LineHeight); void SetList(UIList *list, TextAdapter *listadapter, List *listdata); void SetImage(UIImageView *image); + private: // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承; bool OnClick(UIView &view, const ClickEvent &event) override; @@ -57,8 +61,8 @@ namespace OHOS UIList *m_list = nullptr; TextAdapter *m_listadapter = nullptr; List *m_listdata = nullptr; - int RecordCycleNumber{0}; // 用来记录点击计时按钮("Mark")的次数 - std::string RecordMaxTime{"99:59.59"}; // 计时时间最高为99:59.59 + uint64_t lastRecordTime = 0; // 上次记录时间 + int RecordCycleNumber{0}; // 用来记录计时圈数 }; } // namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchView.h b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchView.h index 3af8a0e0b..e65e9b7ad 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchView.h @@ -1,3 +1,10 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-04 15:13:51 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-07 10:04:54 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/MainStopWatchView.h + */ #ifndef MAIN_STOPWATCH_VIEW_H #define MAIN_STOPWATCH_VIEW_H @@ -5,7 +12,7 @@ #include "View.h" #include "components/ui_view_group.h" #include "components/ui_scroll_view.h" -#include "components/ui_label.h" +#include "components/ui_label_ext.h" #include "components/ui_checkbox.h" #include "components/ui_button.h" #include "components/ui_list.h" @@ -46,31 +53,26 @@ namespace OHOS bool ChangeMainStopWatch(int16_t thisView); bool ChangeStopWatchRecordCycleLimit(int16_t thisView); bool ChangeMainStopWatchRecordTimeLimit(int16_t thisView); - + UILabelExt *GetShowTimelabel(void); private: void InitMainStopWatchView(void); - void DeInitView(void); - void PreLoad(void); + void ClearAll(void); private: StopWatchRecordCycleToLimitView *p_StopWatchRecordCycleToLimitView{nullptr}; // 圈数到达上限后弹出该视图 StopWatchRecordTimeToLimitView *p_StopWatchRecordTimeToLimitView{nullptr}; // 计时时间到达上限后弹出该视图 private: - UIViewGroup *container_ = nullptr; + UIViewGroup *group = nullptr; UIScrollView *scrollView[3] = {nullptr}; - UILabel *stopWatchlabel = nullptr; // 内容为“秒表”的标签 - UILabel *showTimelabel = nullptr; // 用来显示计时时间 + UILabelExt *stopWatchlabel = nullptr; // 内容为“秒表”的标签 + UILabelExt *showTimelabel = nullptr; // 用来显示计时时间 UICheckBox *PlayOrPausecheckBox = nullptr; // 播放或暂停复选框 UIButton *ResetOrMarkbutton = nullptr; // 重置或标记按钮 UIImageView *LineImage{nullptr}; UIList *list = nullptr; TextAdapter *listadapter = nullptr; List *listdata = nullptr; - UIView::OnDragListener *draglistener{nullptr}; - UICheckBox::OnChangeListener *PlayOrPausecheckBoxChangeListener{nullptr}; - UIView::OnClickListener *ResetOrMarkbuttonClick{nullptr}; - bool viewInitStatus{false}; }; } // namespace OHOS #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchModel.h b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchModel.h index 66baa6de1..2eb3ba26f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchModel.h @@ -1,3 +1,10 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-04 15:13:51 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-07 10:35:43 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchModel.h + */ #ifndef STOP_WATCH_MODEL_H #define STOP_WATCH_MODEL_H @@ -7,12 +14,18 @@ namespace OHOS { + class StopWatchModel { public: static std::shared_ptr GetInstance(); // shared_ptr:当没有引用指向这个实例时会自动释放内存 ~StopWatchModel() {} - char *DisplayMotionDuration(); + char *DisplayStopWatchDuration(); + void StopWatch_StartTimer(uint32_t interval); + void StopWatch_StopTimer(void); + void StopWatch_PauseTimer(); + void StopWatch_ResumeTimer(uint32_t interval); + private: // 将构造函数、拷贝构造函数和赋值操作符私有化 @@ -21,9 +34,7 @@ namespace OHOS StopWatchModel &operator=(const StopWatchModel &) = delete; private: - static int oneDaySec; // 一天的秒数 - static int oneHourSec; // 一个小时的秒数 - static int oneMinuteSec; // 一分钟秒数 + std::string stopwatchDuration; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchRecordCycleToLimitView.h b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchRecordCycleToLimitView.h index 390fa0c36..1ccd6aa29 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchRecordCycleToLimitView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchRecordCycleToLimitView.h @@ -1,3 +1,10 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-04 15:13:51 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-07 16:07:11 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchRecordCycleToLimitView.h + */ #ifndef STOPWATCH_RECORD_CYCLE_TO_LIMIT_VIEW_H #define STOPWATCH_RECORD_CYCLE_TO_LIMIT_VIEW_H @@ -5,9 +12,9 @@ #include "View.h" #include "components/ui_view_group.h" #include "components/ui_scroll_view.h" -#include "components/ui_label.h" +#include "components/ui_label_ext.h" #include "components/ui_image_view.h" -#include "components/ui_button.h" +#include "components/ui_label_button_ext.h" /*弹窗视图:到达最高圈数99时弹出*/ namespace OHOS { @@ -16,19 +23,17 @@ namespace OHOS public: StopWatchRecordCycleToLimitView(); - void DeInitView(void); + void ClearAll(void); virtual ~StopWatchRecordCycleToLimitView(); static StopWatchRecordCycleToLimitView *GetInstance(void); UIScrollView *InitStopWatchRecordCycleToLimitView(void); private: - UIViewGroup *container_ = nullptr; - UIScrollView *scrollView1_ = nullptr; - UILabel *label1_ = nullptr; - UIImageView *image1_ = nullptr; - UILabel *label3_ = nullptr; - UIButton *button1_ = nullptr; - bool viewInitStatus{false}; + UIScrollView *scrollView = nullptr; + UILabelExt *Title = nullptr; + UIImageView *AttentionImage = nullptr; + UILabelExt *AttentionLabel = nullptr; + UILabelButtonExt *button = nullptr; }; } // namespace OHOS #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchRecordTimeToLimitView.h b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchRecordTimeToLimitView.h index 22495f27c..98c3ecc5d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchRecordTimeToLimitView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchRecordTimeToLimitView.h @@ -1,3 +1,10 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-04 15:13:51 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-07 16:28:41 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/stopwatch/include/StopWatchRecordTimeToLimitView.h + */ #ifndef STOPWATCH_RECORD_TIME_TO_LIMIT_VIEW_H #define STOPWATCH_RECORD_TIME_TO_LIMIT_VIEW_H @@ -5,9 +12,9 @@ #include "View.h" #include "components/ui_view_group.h" #include "components/ui_scroll_view.h" -#include "components/ui_label.h" +#include "components/ui_label_ext.h" #include "components/ui_image_view.h" -#include "components/ui_button.h" +#include "components/ui_label_button_ext.h" /*弹窗视图:到达最高时间99:59.99时弹出*/ namespace OHOS { @@ -18,15 +25,15 @@ namespace OHOS virtual ~StopWatchRecordTimeToLimitView(); static StopWatchRecordTimeToLimitView *GetInstance(void); UIScrollView *InitStopWatchRecordTimeToLimitView(void); - void DeInitView(void); + void ClearAll(void); private: - UIScrollView *scrollView1_ = nullptr; - UILabel *label1_ = nullptr; - UIImageView *image1_ = nullptr; - UILabel *label3_ = nullptr; - UIButton *button1_ = nullptr; - bool viewInitStatus{false}; + UIScrollView *scrollView = nullptr; + UILabelExt *Title = nullptr; + UIImageView *AttentionImage = nullptr; + UILabelExt *AttentionLabel_1 = nullptr; + UILabelExt *AttentionLabel_2 = nullptr; + UILabelButtonExt *button = nullptr; }; } // namespace OHOS #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/MainStopWatchPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/MainStopWatchPresenter.cpp index 4c5e74255..8b4c1c6e3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/MainStopWatchPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/MainStopWatchPresenter.cpp @@ -1,6 +1,7 @@ #include "AppViewIDs.h" #include "NativeAbility.h" #include "stopwatch/include/MainStopWatchPresenter.h" +#include "stopwatch/include/StopWatchModel.h" #include "common/key_code.h" #include /*秒表主视图*/ @@ -18,7 +19,7 @@ namespace OHOS MainStopWatchPresenter::~MainStopWatchPresenter() { - + StopWatchModel::GetInstance()->StopWatch_StopTimer(); // 退出删除并清理定时器资源 g_pMainStopWatchPresenter = nullptr; } @@ -30,8 +31,8 @@ namespace OHOS void MainStopWatchPresenter::OnStart() { - Presenter::OnStart(); + ScreenAlwaysOnCtr(1); // 长亮屏 } void MainStopWatchPresenter::OnPause(void) @@ -48,8 +49,8 @@ namespace OHOS void MainStopWatchPresenter::OnStop(void) { - Presenter::OnStop(); + ScreenAlwaysOnCtr(0); // 取消长亮屏 } /// @brief 设置复选框和按钮 @@ -108,6 +109,45 @@ namespace OHOS return true; } + /* + * Converts a time string in the format "mm:ss.ms" to milliseconds. + * + * @param timeStr The time string to convert. + * @return The time in milliseconds. + */ + static unsigned long TimeStrToMilliseconds(const char *timeStr) + { + unsigned minutes, seconds, milliseconds; + + // Assuming the format is "mm:ss.ms" + if (sscanf(timeStr, "%u:%u.%u", &minutes, &seconds, &milliseconds) == 3) + { + // 将分钟转换为毫秒,将秒转换为毫秒,并将它们相加 + unsigned long totalMilliseconds = (minutes * 60 * 1000) + (seconds * 1000) + (milliseconds * 10); + return totalMilliseconds; + } + else + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Error: Invalid time format."); + return 0; + } + } + + /*将毫秒级数转成格式为"mm:ss.ms"*/ + static void MillisecondsToTimeStr(unsigned long milliseconds, char *buffer) + { + unsigned minutes = milliseconds / (60 * 1000); + milliseconds %= (60 * 1000); // Remaining milliseconds after converting to minutes + unsigned seconds = milliseconds / 1000; + unsigned ms = milliseconds % 1000; // Remaining milliseconds after converting to seconds + + // Assuming ms needs to be in hundredths of a second for the ".ms" format + unsigned msHundredths = ms / 10; // Convert to hundredths of a second + + // Write the formatted time string to the buffer + sprintf(buffer, "%02u:%02u.%02u", minutes, seconds, msHundredths); + } + bool MainStopWatchPresenter::OnClick(UIView &view, const ClickEvent &event) { UNUSED(view); @@ -115,39 +155,67 @@ namespace OHOS const char *clickedViewId = view.GetViewId(); if (strcmp(clickedViewId, ResetOrMarkButton_MARK_VIEWID) == 0) { - RecordCycleNumber += 1; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RecordCycleNumber:%d\n",RecordCycleNumber); - if (RecordCycleNumber >= 99) + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RecordCycleNumber:%d\n", RecordCycleNumber); + if (RecordCycleNumber >= MAX_RECORD_LOOPS) // 到达最高记录圈数 { + m_checkbox->SetState(UICheckBox::UNSELECTED); mainStopWatchView->ChangeView(MAIN_STOPWATCH, STOPWATCH_RECORD_CYCLE_TO_LIMIT); return true; } else { - mainStopWatchView->SetViewIsVisible(m_stopWatchlabel, false); - SetShowTimeLableStyle(m_showTimelabel, 93, 60, 65, 78); - mainStopWatchView->SetViewIsVisible(m_list, true); - mainStopWatchView->SetViewIsVisible(m_image, true); + RecordCycleNumber += 1; } + mainStopWatchView->SetViewIsVisible(m_stopWatchlabel, false); + SetShowTimeLableStyle(m_showTimelabel, 93, 60, 65, 78); + mainStopWatchView->SetViewIsVisible(m_list, true); + mainStopWatchView->SetViewIsVisible(m_image, true); + + uint64_t currentRecordTime = TimeStrToMilliseconds(MainStopWatchView::GetInstance()->GetShowTimelabel()->GetText()); // 获取当前时间 + uint64_t timeDifference = 0; // 时间差值 + if (lastRecordTime > 0) + { + // 如果不是第一次标记,则计算与上一次记录的时间差 + timeDifference = currentRecordTime - lastRecordTime; + } + // 将时间和时间差格式化为字符串,更新到UI + const char *formattedTime = MainStopWatchView::GetInstance()->GetShowTimelabel()->GetText(); + char formattedDiff[64] = {0}; + MillisecondsToTimeStr(timeDifference, formattedDiff); char *PickerData = (char *)malloc(128); - sprintf(PickerData, "0%d %s %s", RecordCycleNumber, "00:08:09", "+00:08:09"); - m_listdata->PushFront(static_cast(PickerData)); + if (lastRecordTime == 0) // 如果是第一次标记 + { + sprintf(PickerData, "0%d %s +%s", RecordCycleNumber, formattedTime, formattedTime); + } + else + { + sprintf(PickerData, "0%d %s +%s", RecordCycleNumber, formattedTime, formattedDiff); + } + m_listdata->PushFront(const_cast(PickerData)); m_listadapter->SetData(m_listdata); m_list->SetAdapter(m_listadapter); m_list->SetStartIndex(RecordCycleNumber - 1); m_list->SetSelectPosition(RecordCycleNumber); m_list->RefreshList(); + // 保存当前时间为“上一次记录时间”,为下一次标记做准备 + lastRecordTime = currentRecordTime; return true; } else if (strcmp(clickedViewId, ResetOrMarkButton_RESET2_VIEWID) == 0) { + StopWatchModel::GetInstance()->StopWatch_StopTimer(); // 停止定时器 + mainStopWatchView->GetShowTimelabel()->SetText("00:00.00"); + lastRecordTime = 0; + m_button->SetViewId(ResetOrMarkButton_RESET1_VIEWID); m_button->SetImageSrc(ResetOrMarkButtonImg_Reset1, ResetOrMarkButtonImg_Reset1); m_button->Invalidate(); mainStopWatchView->SetViewIsVisible(m_stopWatchlabel, true); - SetShowTimeLableStyle(m_showTimelabel, 63, 160, 80, 94); + SetShowTimeLableStyle(m_showTimelabel, 68, 160, 84, 94); mainStopWatchView->SetViewIsVisible(m_image, false); + mainStopWatchView->SetViewIsVisible(m_list, false); + if (m_listdata != nullptr) { for (int i = 0; i < m_listdata->Size(); i++) @@ -157,8 +225,11 @@ namespace OHOS } m_listdata->Clear(); } - mainStopWatchView->SetViewIsVisible(m_list, false); - m_list->Invalidate(); + else + { + // Handle error or log the issue + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Error: m_listdata is nullptr"); + } RecordCycleNumber = 0; } else if (strcmp(clickedViewId, CycleToLimitReturnButton_VIEWID) == 0) @@ -174,14 +245,19 @@ namespace OHOS bool MainStopWatchPresenter::OnChange(UICheckBox::UICheckBoxState state) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainStopWatchPresenter::OnChange"); if (state == UICheckBox::UICheckBoxState::SELECTED) { + StopWatchModel::GetInstance()->StopWatch_StartTimer(STOPWATCH_TIMER_DURATION); // 开启定时器,如果定时器存在会直接返回 + StopWatchModel::GetInstance()->StopWatch_ResumeTimer(STOPWATCH_TIMER_DURATION); // 恢复定时器 + m_button->SetViewId(ResetOrMarkButton_MARK_VIEWID); - m_button->SetImageSrc(ResetOrMarkButtonImg_Mark, nullptr); + m_button->SetImageSrc(ResetOrMarkButtonImg_Mark, ResetOrMarkButtonImg_Mark); m_button->Invalidate(); // 图片重新赋值要刷新该区域 } else { + StopWatchModel::GetInstance()->StopWatch_PauseTimer(); // 暂停定时器 m_button->SetViewId(ResetOrMarkButton_RESET2_VIEWID); m_button->SetImageSrc(ResetOrMarkButtonImg_Reset2, nullptr); m_button->Invalidate(); @@ -192,7 +268,7 @@ namespace OHOS // 增加按键事件 bool MainStopWatchPresenter::OnKeyAct(UIView &view, const KeyEvent &event) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainStopWatchPresenter::OnKeyAct"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainStopWatchPresenter::OnKeyAct"); uint16_t keyID = event.GetKeyId(); uint16_t keyState = event.GetState(); // 如果是power键就返回上一级 diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/MainStopWatchView.cpp b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/MainStopWatchView.cpp index 6c31fdcf8..abfe10889 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/MainStopWatchView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/MainStopWatchView.cpp @@ -3,6 +3,7 @@ #include "UiConfig.h" #include "NativeAbility.h" #include "AppViewIDs.h" +#include "wearable_log.h" /*秒表主视图*/ namespace OHOS { @@ -11,25 +12,101 @@ namespace OHOS MainStopWatchView::MainStopWatchView() { - + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainStopWatchView::MainStopWatchView"); g_pMainStopWatchView = this; } MainStopWatchView::~MainStopWatchView() { - if (viewInitStatus == true) - { - DeInitView(); - } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainStopWatchView::~MainStopWatchView"); + ClearAll(); g_pMainStopWatchView = nullptr; } MainStopWatchView *MainStopWatchView::GetInstance() { - return g_pMainStopWatchView; } + void MainStopWatchView::ClearAll() + { + group->RemoveAll(); + scrollView[MAIN_STOPWATCH]->RemoveAll(); + + if (stopWatchlabel != nullptr) + { + delete stopWatchlabel; + stopWatchlabel = nullptr; + } + + if (showTimelabel != nullptr) + { + delete showTimelabel; + showTimelabel = nullptr; + } + + if (PlayOrPausecheckBox != nullptr) + { + delete PlayOrPausecheckBox; + PlayOrPausecheckBox = nullptr; + } + + if (ResetOrMarkbutton != nullptr) + { + delete ResetOrMarkbutton; + ResetOrMarkbutton = nullptr; + } + + if (LineImage != nullptr) + { + delete LineImage; + LineImage = nullptr; + } + + if (list != nullptr) + { + delete list; + list = nullptr; + } + + if (listadapter != nullptr) + { + delete listadapter; + listadapter = nullptr; + } + + if (listdata != nullptr) + { + listdata->Clear(); + delete listdata; + listdata = nullptr; + } + + if (scrollView[MAIN_STOPWATCH] != nullptr) + { + delete scrollView[MAIN_STOPWATCH]; + scrollView[MAIN_STOPWATCH] = nullptr; + } + + if (p_StopWatchRecordCycleToLimitView != nullptr) + { + delete p_StopWatchRecordCycleToLimitView; + p_StopWatchRecordCycleToLimitView = nullptr; + } + + if (p_StopWatchRecordTimeToLimitView != nullptr) + { + delete p_StopWatchRecordTimeToLimitView; + p_StopWatchRecordTimeToLimitView = nullptr; + } + + if (group != nullptr) + { + delete group; + group = nullptr; + } + } + /// @brief 设置视图是否可见 /// @param view 具体视图 /// @param status true 可见 false 不可见 @@ -46,19 +123,23 @@ namespace OHOS view->Invalidate(); } - // 切换到秒表主视图 + // 1.切换到秒表主视图 bool MainStopWatchView::ChangeMainStopWatch(int16_t thisView) { - container_->Add(scrollView[thisView]); + if (scrollView[thisView] == nullptr) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainStopWatchView::ChangeMainStopWatch"); + group->Add(scrollView[thisView]); + } return true; } - // 切换到秒表到达最高圈数视图 + // 2.切换到秒表到达最高圈数视图 bool MainStopWatchView::ChangeStopWatchRecordCycleLimit(int16_t thisView) { if (scrollView[thisView] == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainAlarmView::StopWatchRecordCycleToLimitView"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainStopWatchView::StopWatchRecordCycleToLimitView"); p_StopWatchRecordCycleToLimitView = new StopWatchRecordCycleToLimitView(); if (p_StopWatchRecordCycleToLimitView == nullptr) { @@ -66,17 +147,17 @@ namespace OHOS return false; } scrollView[thisView] = p_StopWatchRecordCycleToLimitView->InitStopWatchRecordCycleToLimitView(); - container_->Add(scrollView[thisView]); + group->Add(scrollView[thisView]); } return true; } - // 切换到秒表到达最大时间计时视图 + // 3.切换到秒表到达最大时间计时视图 bool MainStopWatchView::ChangeMainStopWatchRecordTimeLimit(int16_t thisView) { if (scrollView[thisView] == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainAlarmView::ChangeMainStopWatchRecordTimeLimit"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainStopWatchView::ChangeMainStopWatchRecordTimeLimit"); p_StopWatchRecordTimeToLimitView = new StopWatchRecordTimeToLimitView(); if (p_StopWatchRecordTimeToLimitView == nullptr) { @@ -84,7 +165,7 @@ namespace OHOS return false; } scrollView[thisView] = p_StopWatchRecordTimeToLimitView->InitStopWatchRecordTimeToLimitView(); - container_->Add(scrollView[thisView]); + group->Add(scrollView[thisView]); } return true; } @@ -97,11 +178,11 @@ namespace OHOS }; // 2.ViewMapper[] 是一个静态的视图映射数组,将视图ID与MainStopWatchView类中的特定成员函数指针进行了绑定。 - static const MainStopWatchViewMapper ViewMapper[] = - { - {MAIN_STOPWATCH, &MainStopWatchView::ChangeMainStopWatch}, - {STOPWATCH_RECORD_CYCLE_TO_LIMIT, &MainStopWatchView::ChangeStopWatchRecordCycleLimit}, - {STOPWATCH_RECORD_TIME_TO_LIMIT, &MainStopWatchView::ChangeMainStopWatchRecordTimeLimit}}; + static const MainStopWatchViewMapper ViewMapper[] = { + {MAIN_STOPWATCH, &MainStopWatchView::ChangeMainStopWatch}, + {STOPWATCH_RECORD_CYCLE_TO_LIMIT, &MainStopWatchView::ChangeStopWatchRecordCycleLimit}, + {STOPWATCH_RECORD_TIME_TO_LIMIT, &MainStopWatchView::ChangeMainStopWatchRecordTimeLimit}, + }; // 3.根据传入的interface参数执行相应视图ID关联的成员函数。 bool MainStopWatchView::ClickFunc(int16_t interface) @@ -139,231 +220,165 @@ namespace OHOS // 初始化秒表主视图 void MainStopWatchView::InitMainStopWatchView() { - if (scrollView[MAIN_STOPWATCH] == nullptr) - { - scrollView[MAIN_STOPWATCH] = new UIScrollView(); - } - scrollView[MAIN_STOPWATCH]->SetPosition(0, 0); - scrollView[MAIN_STOPWATCH]->Resize(466, 466); - scrollView[MAIN_STOPWATCH]->SetViewId("scrollView1"); - scrollView[MAIN_STOPWATCH]->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - container_->Add(scrollView[MAIN_STOPWATCH]); - scrollView[MAIN_STOPWATCH]->SetVisible(true); - /* -------------------------------------------------------------------------- */ - if (stopWatchlabel == nullptr) - { - stopWatchlabel = new UILabel(); - } - stopWatchlabel->SetPosition(203, 52); - stopWatchlabel->Resize(60, 35); - stopWatchlabel->SetViewId("label1"); - stopWatchlabel->SetStyle(STYLE_TEXT_FONT, 30); - stopWatchlabel->SetStyle(STYLE_LINE_HEIGHT, 35); - stopWatchlabel->SetText("秒表"); - stopWatchlabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - stopWatchlabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - stopWatchlabel->SetRollSpeed(0); - stopWatchlabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - scrollView[MAIN_STOPWATCH]->Add(stopWatchlabel); - stopWatchlabel->SetVisible(true); - /* -------------------------------------------------------------------------- */ - if (showTimelabel == nullptr) - { - showTimelabel = new UILabel(); - } - showTimelabel->SetPosition(63, 160); - showTimelabel->Resize(200, 60); - showTimelabel->SetViewId("showTimelabel"); - showTimelabel->SetStyle(STYLE_TEXT_FONT, 80); - showTimelabel->SetStyle(STYLE_LINE_HEIGHT, 94); - showTimelabel->SetText("00:00.00"); - showTimelabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - showTimelabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - showTimelabel->SetRollSpeed(0); - showTimelabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 80); - scrollView[MAIN_STOPWATCH]->Add(showTimelabel); - showTimelabel->SetVisible(true); - /* -------------------------------------------------------------------------- */ - if (LineImage == nullptr) + if (group == nullptr) { + /* ---------------------------------- group --------------------------------- */ + group = new UIViewGroup(); + if (group == nullptr) + { + return; + } + group->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + UIView::OnDragListener *draglistener = static_cast(MainStopWatchPresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + group->SetOnDragListener(draglistener); + group->SetTouchable(true); + group->SetDraggable(true); + /* ----------------------- scrollView[MAIN_STOPWATCH] ----------------------- */ + if (scrollView[MAIN_STOPWATCH] == nullptr) + { + scrollView[MAIN_STOPWATCH] = new UIScrollView(); + } + scrollView[MAIN_STOPWATCH]->SetPosition(0, 0, 466, 466); + scrollView[MAIN_STOPWATCH]->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + /* ----------------------------- stopWatchlabel ----------------------------- */ + stopWatchlabel = new UILabelExt(); + if (stopWatchlabel == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "stopWatchlabel new fail!!"); + return; + } + stopWatchlabel->SetPosition(83, 52, 300, 40); + stopWatchlabel->SetStyle(STYLE_TEXT_FONT, 30); + stopWatchlabel->SetStyle(STYLE_LINE_HEIGHT, 35); + stopWatchlabel->SetText("秒表"); + stopWatchlabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + stopWatchlabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + stopWatchlabel->SetRollSpeed(40); + stopWatchlabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + stopWatchlabel->SetVisible(true); + /* ------------------------------ showTimelabel ----------------------------- */ + showTimelabel = new UILabelExt(); + if (showTimelabel == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showTimelabel new fail!!"); + return; + } + showTimelabel->SetPosition(68, 160); + showTimelabel->SetStyle(STYLE_TEXT_FONT, 84); + showTimelabel->SetStyle(STYLE_LINE_HEIGHT, 94); + showTimelabel->SetText("00:00.00"); + showTimelabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + showTimelabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + showTimelabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 84); + /* -------------------------------- LineImage ------------------------------- */ LineImage = new UIImageView(); - } - LineImage->SetPosition(53, 150); - char *imageimagesPath = "/user/res/stopwatch/STOPWATCH_LINE.bin"; - LineImage->SetSrc(imageimagesPath); - scrollView[MAIN_STOPWATCH]->Add(LineImage); - LineImage->SetVisible(false); - /* -------------------------------------------------------------------------- */ - if (list == nullptr) - { + if (LineImage == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LineImage new fail!!"); + return; + } + LineImage->SetPosition(53, 150); + const char *imageimagesPath = "/user/res/stopwatch/STOPWATCH_LINE.bin"; + LineImage->SetSrc(imageimagesPath); + LineImage->SetVisible(false); + /* ---------------------------------- list ---------------------------------- */ list = new UIList(); - } - list->SetPosition(56, 170, 360, 100); - list->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); - list->SetReboundSize(30); - if (listadapter == nullptr) - { + if (list == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "list new fail!!"); + return; + } + list->SetPosition(56, 170, 360, 100); + list->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + list->SetReboundSize(30); + list->SetVisible(false); + /* ------------------------------- listadapter ------------------------------ */ listadapter = new TextAdapter(); - } - listadapter->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28); - if (listdata == nullptr) - { + if (listadapter == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "listadapter new fail!!"); + return; + } + listadapter->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28); + /* -------------------------------- listdata -------------------------------- */ listdata = new List(); - } - scrollView[MAIN_STOPWATCH]->Add(list); - list->SetVisible(false); - /* -------------------------------------------------------------------------- */ - // Add CheckBox to App - if (PlayOrPausecheckBox == nullptr) - { + if (listdata == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "listdata new fail!!"); + return; + } + /* --------------------------- PlayOrPausecheckBox -------------------------- */ PlayOrPausecheckBox = new UICheckBox(); - } - PlayOrPausecheckBox->SetPosition(118, 321); - PlayOrPausecheckBox->Resize(120, 120); - PlayOrPausecheckBox->SetViewId(PlayOrPausecheckBoxVIEWID); - PlayOrPausecheckBox->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); - PlayOrPausecheckBox->SetStyle(STYLE_BORDER_RADIUS, 51); - PlayOrPausecheckBox->SetImages(checkBox1selectedImg, checkBox1unSelectedImg); - // Add to scrollView1 - scrollView[MAIN_STOPWATCH]->Add(PlayOrPausecheckBox); - PlayOrPausecheckBox->SetVisible(true); - /* -------------------------------------------------------------------------- */ - // Add Button to App - if (ResetOrMarkbutton == nullptr) - { + if (PlayOrPausecheckBox == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PlayOrPausecheckBox new fail!!"); + return; + } + PlayOrPausecheckBox->SetPosition(118, 321, 120, 120); + PlayOrPausecheckBox->SetViewId(PlayOrPausecheckBoxVIEWID); + PlayOrPausecheckBox->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + PlayOrPausecheckBox->SetStyle(STYLE_BORDER_RADIUS, 51); + PlayOrPausecheckBox->SetImages(checkBox1selectedImg, checkBox1unSelectedImg); + PlayOrPausecheckBox->SetVisible(true); + /* ---------------------------- ResetOrMarkbutton --------------------------- */ ResetOrMarkbutton = new UIButton(); + if (ResetOrMarkbutton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ResetOrMarkbutton new fail!!"); + return; + } + ResetOrMarkbutton->SetPosition(256, 333, 100, 100); + ResetOrMarkbutton->SetViewId(ResetOrMarkButton_RESET1_VIEWID); + ResetOrMarkbutton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + ResetOrMarkbutton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + ResetOrMarkbutton->SetImageSrc(ResetOrMarkButtonImg_Reset1, ResetOrMarkButtonImg_Reset1); + ResetOrMarkbutton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffbfbfb, UIButton::PRESSED); + ResetOrMarkbutton->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); + ResetOrMarkbutton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + ResetOrMarkbutton->SetVisible(true); + /* -------------------------------------------------------------------------- */ + MainStopWatchPresenter::GetInstance()->SetCheckBoxAndButton(PlayOrPausecheckBox, ResetOrMarkbutton); + MainStopWatchPresenter::GetInstance()->SetLable(stopWatchlabel, showTimelabel); + MainStopWatchPresenter::GetInstance()->SetImage(LineImage); + MainStopWatchPresenter::GetInstance()->SetList(list, listadapter, listdata); + // Add the CallBack about events + UICheckBox::OnChangeListener *PlayOrPausecheckBoxChangeListener = static_cast(MainStopWatchPresenter::GetInstance()); + PlayOrPausecheckBox->SetOnChangeListener(PlayOrPausecheckBoxChangeListener); + UIView::OnClickListener *ResetOrMarkbuttonClick = static_cast(MainStopWatchPresenter::GetInstance()); + ResetOrMarkbutton->SetOnClickListener(ResetOrMarkbuttonClick); } - ResetOrMarkbutton->SetPosition(256, 333); - ResetOrMarkbutton->Resize(100, 100); - ResetOrMarkbutton->SetViewId(ResetOrMarkButton_RESET1_VIEWID); - ResetOrMarkbutton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); - ResetOrMarkbutton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - ResetOrMarkbutton->SetImageSrc(ResetOrMarkButtonImg_Reset1, nullptr); - ResetOrMarkbutton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffbfbfb, UIButton::PRESSED); - ResetOrMarkbutton->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); - ResetOrMarkbutton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - scrollView[MAIN_STOPWATCH]->Add(ResetOrMarkbutton); - ResetOrMarkbutton->SetVisible(true); - /* -------------------------------------------------------------------------- */ - MainStopWatchPresenter::GetInstance()->SetCheckBoxAndButton(PlayOrPausecheckBox, ResetOrMarkbutton); - MainStopWatchPresenter::GetInstance()->SetLable(stopWatchlabel, showTimelabel); - MainStopWatchPresenter::GetInstance()->SetImage(LineImage); - MainStopWatchPresenter::GetInstance()->SetList(list, listadapter, listdata); - // Add the CallBack about events - PlayOrPausecheckBoxChangeListener = static_cast(MainStopWatchPresenter::GetInstance()); - PlayOrPausecheckBox->SetOnChangeListener(PlayOrPausecheckBoxChangeListener); - ResetOrMarkbuttonClick = static_cast(MainStopWatchPresenter::GetInstance()); - ResetOrMarkbutton->SetOnClickListener(ResetOrMarkbuttonClick); } - void MainStopWatchView::DeInitView() + UILabelExt *MainStopWatchView::GetShowTimelabel(void) { - if (stopWatchlabel != nullptr) - { - delete stopWatchlabel; - stopWatchlabel = nullptr; - } - if (showTimelabel != nullptr) - { - delete showTimelabel; - showTimelabel = nullptr; - } - if (PlayOrPausecheckBox != nullptr) - { - delete PlayOrPausecheckBox; - PlayOrPausecheckBox = nullptr; - } - if (ResetOrMarkbutton != nullptr) - { - delete ResetOrMarkbutton; - ResetOrMarkbutton = nullptr; - } - if (LineImage != nullptr) - { - delete LineImage; - LineImage = nullptr; - } - if (list != nullptr) - { - delete list; - list = nullptr; - } - if (listadapter != nullptr) - { - delete listadapter; - listadapter = nullptr; - } - if (listdata != nullptr) - { - listdata->Clear(); - delete listdata; - listdata = nullptr; - } - if (draglistener != nullptr) - { - delete draglistener; - draglistener = nullptr; - } - if (PlayOrPausecheckBoxChangeListener != nullptr) - { - delete PlayOrPausecheckBoxChangeListener; - PlayOrPausecheckBoxChangeListener = nullptr; - } - if (ResetOrMarkbuttonClick != nullptr) - { - delete ResetOrMarkbuttonClick; - ResetOrMarkbuttonClick = nullptr; - } - if (scrollView[MAIN_STOPWATCH] != nullptr) - { - delete scrollView[MAIN_STOPWATCH]; - scrollView[MAIN_STOPWATCH] = nullptr; - } - if (container_ != nullptr) - { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } - } - void MainStopWatchView::PreLoad(void) - { - if (!viewInitStatus) - { - InitMainStopWatchView(); - viewInitStatus = true; - } + return showTimelabel; } + void MainStopWatchView::OnStart() { - // container_容器属性 new - container_ = new UIViewGroup(); - if (container_ == nullptr) - { - return; - } - // container_容器属性 扩展 - container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - draglistener = static_cast(MainStopWatchPresenter::GetInstance()); - if (draglistener == nullptr) - { - return; - } - container_->SetOnDragListener(draglistener); - container_->SetTouchable(true); - container_->SetDraggable(true); - PreLoad(); - RootView::GetInstance()->Add(container_); + View::OnStart(); + InitMainStopWatchView(); // 增加按键监听 RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::MainStopWatchPresenter::GetInstance(); RootView::GetInstance()->SetOnKeyActListener(keyactListener); - RootView::GetInstance()->SetIntercept(true); } void MainStopWatchView::OnSetUpView() { View::OnSetUpView(); + scrollView[MAIN_STOPWATCH]->Add(stopWatchlabel); + scrollView[MAIN_STOPWATCH]->Add(showTimelabel); + scrollView[MAIN_STOPWATCH]->Add(LineImage); + scrollView[MAIN_STOPWATCH]->Add(list); + scrollView[MAIN_STOPWATCH]->Add(PlayOrPausecheckBox); + scrollView[MAIN_STOPWATCH]->Add(ResetOrMarkbutton); + group->Add(scrollView[MAIN_STOPWATCH]); + RootView::GetInstance()->Add(group); Draw(); } @@ -378,7 +393,7 @@ namespace OHOS { View::OnStop(); - RootView::GetInstance()->ClearOnKeyActListener(); + RootView::GetInstance()->ClearOnKeyActListener(); RootView::GetInstance()->RemoveAll(); return; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchModel.cpp index bb4f2be89..00d39948c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchModel.cpp @@ -1,12 +1,14 @@ #include "stopwatch/include/StopWatchModel.h" #include "cmsis_os2.h" #include "cmsis_os.h" - +#include +#include +#include "custom_utils.h" +#include "wearable_log.h" +#include +#include "stopwatch/include/MainStopWatchView.h" namespace OHOS { - int StopWatchModel::oneDaySec = 86400; // 一天的秒数 - int StopWatchModel::oneHourSec = 3600; // 一个小时的秒数 - int StopWatchModel::oneMinuteSec = 60; // 一分钟秒数 std::shared_ptr StopWatchModel::GetInstance() // shared_ptr:当没有引用指向这个实例时会自动释放内存 { @@ -14,8 +16,213 @@ namespace OHOS return instance; } - /* 时间显示 */ - char *StopWatchModel::DisplayMotionDuration() + /* ----------------------------------- 定时器 ---------------------------------- */ + // 声明定时器变量 + static osTimerId_t g_timer = NULL; + static int g_StopWatchTimes = {0}; + static constexpr int32 NUM_TEN = 10; + static constexpr int16 ERROR = 0; + static constexpr int16 SUCCESS = 1; + static constexpr int16 NUM_TIME_MIN = 60; + static constexpr int16 NUM_TIME_HOUR = 3600; + static constexpr int32 NUM_TIME_DAY = 86400; + static uint64_t g_timerStartTimestamp = 0; // 添加一个全局变量来存储定时器开始的时间戳 + /* + * @brief 显示倒计时(分钟、秒、毫秒),毫秒显示为两位数 + */ + char *StopWatchModel::DisplayStopWatchDuration() + { + stopwatchDuration.erase(); + std::string minute; + std::string seconds; + std::string milliseconds; + + // 假设 g_StopWatchTimes 是毫秒数 + int min = g_StopWatchTimes / (60 * 1000); // 60,000 毫秒 = 1 分钟 + int sec = (g_StopWatchTimes % (60 * 1000)) / 1000; // 1,000 毫秒 = 1 秒 + int msec = (g_StopWatchTimes % 1000) / 10; // 获得两位数的毫秒,最大值为99 + + if (min < 10) + { + minute = "0" + std::to_string(min); + } + else + { + minute = std::to_string(min); + } + + if (sec < 10) + { + seconds = "0" + std::to_string(sec); + } + else + { + seconds = std::to_string(sec); + } + + // 格式化毫秒为两位数 + if (msec < 10) + { + milliseconds = "0" + std::to_string(msec); + } + else + { + milliseconds = std::to_string(msec); + } + + // 拼接分钟、秒和毫秒 + stopwatchDuration = minute + ":" + seconds + "." + milliseconds; + + return (char *)stopwatchDuration.c_str(); + } + + /* + * @brief 在这里添加定时器到期后的处理逻辑 + */ + static void StopWatch_TimerCallbackProc(int data) + { + g_StopWatchTimes += 10; // 每次回调增加10毫秒 + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "g_StopWatchTimes:%d\n", g_StopWatchTimes); + + if (MainStopWatchView::GetInstance() == nullptr) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[StopWatch_TimerCallbackProc] GetInstance is NULL"); + return; + } + + if (MainStopWatchView::GetInstance()->GetShowTimelabel() == nullptr) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[StopWatch_TimerCallbackProc] GetInstance()->GetShowTimelabel is NULL"); + return; + } + + if (StopWatchModel::GetInstance()->DisplayStopWatchDuration() == nullptr) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[StopWatch_TimerCallbackProc] DisplayStopWatchDuration is NULL"); + return; + } + + MainStopWatchView::GetInstance()->GetShowTimelabel()->SetText(StopWatchModel::GetInstance()->DisplayStopWatchDuration()); + } + + /* + * @brief 倒计时回调函数 + */ + static void StopWatch_TimerCallback(int data) + { +#if 0 + uint64_t currentTimestamp = GetCurrentTimestamp(); + if ((currentTimestamp - g_timerStartTimestamp) >= 5999099) // 99分59秒99的毫秒数 + { + if (g_timer != NULL) + { + osTimerStop(g_timer); // 停止定时器 + osTimerDelete(g_timer); // 删除定时器 + g_timer = NULL; + g_timerStartTimestamp = 0; // 重置时间戳 + // 可以在这里添加额外的逻辑,比如更新界面显示等 + } + } + else + { + GraphicService::GetInstance()->PostGraphicEvent(std::bind(StopWatch_TimerCallbackProc, data)); + } +#endif + GraphicService::GetInstance()->PostGraphicEvent(std::bind(StopWatch_TimerCallbackProc, data)); + } + + /* + * @brief 开启定时器函数 + * @param interval 时间间隔,单位ms + */ + void StopWatchModel::StopWatch_StartTimer(uint32_t interval) + { + /* -------------------------- 1.检查定时器是否已经存在,如果存在则返回 ------------------------- */ + if (g_timer != NULL) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "StopWatchModel::StopWatch_StartTimer Timer already exists!!"); + return; + } + + /* --------------------------------- 2.创建定时器 -------------------------------- */ + g_timer = osTimerNew((osTimerFunc_t)StopWatch_TimerCallback, osTimerPeriodic, NULL, NULL); + // 检查定时器创建是否成功 + if (g_timer == NULL) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StopWatchModel::StopWatch_StartTimer Timer create failed!!"); + return; + } + + /* ----------------------------- 3.将毫秒转换为系统时钟节拍数 ---------------------------- */ + int tick = osMs2Tick(interval); + + /* --------------------------------- 4.启动定时器 -------------------------------- */ + //g_timerStartTimestamp = GetCurrentTimestamp(); // 假设GetCurrentTimestamp()是获取当前时间戳的函数 + osStatus_t ret = osTimerStart(g_timer, tick); + /* -------------------- 5.检查定时器启动是否成功,如果启动失败,删除定时器并置为 NULL -------------------- */ + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanTimerCallback osTimerDelete failed, ret = %lx!!", ret); + if (g_timer != NULL) + { + ret = osTimerDelete(g_timer); + return; + } + g_timer = NULL; + } + return; + } + + /* + * @brief 停止定时器 + */ + void StopWatchModel::StopWatch_StopTimer(void) + { + // 检查定时器是否存在 + if (g_timer != NULL) + { + // 删除定时器并置为 NULL + osStatus_t ret = osTimerDelete(g_timer); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanTimerCallback osTimerDelete failed, ret = %lx!!", ret); + } + g_timer = NULL; + g_StopWatchTimes = 0; + } + } + /* + * @brief 暂停定时器 + */ + void StopWatchModel::StopWatch_PauseTimer(void) + { + // 检查定时器是否存在 + if (g_timer != NULL) + { + // 暂停定时器,但不删除它 + osStatus_t ret = osTimerStop(g_timer); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StopWatch_PauseTimer osTimerStop failed, ret = %lx!!", ret); + } + } + } + + /* + * @brief 恢复定时器 + */ + void StopWatchModel::StopWatch_ResumeTimer(uint32_t interval) { + // 检查定时器是否存在 + if (g_timer != NULL) + { + int tick = osMs2Tick(interval); + // 恢复定时器 + osStatus_t ret = osTimerStart(g_timer, tick); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StopWatch_ResumeTimer osTimerStart failed, ret = %lx!!", ret); + } + } } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchRecordCycleToLimitView.cpp b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchRecordCycleToLimitView.cpp index 24318e8e0..feca45ee8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchRecordCycleToLimitView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchRecordCycleToLimitView.cpp @@ -1,5 +1,6 @@ #include "stopwatch/include/StopWatchRecordCycleToLimitView.h" #include "stopwatch/include/MainStopWatchPresenter.h" +#include "UiConfig.h" /*弹窗视图:到达最高圈数99时弹出*/ namespace OHOS { @@ -14,10 +15,7 @@ namespace OHOS StopWatchRecordCycleToLimitView::~StopWatchRecordCycleToLimitView() { - if (viewInitStatus == true) - { - DeInitView(); - } + ClearAll(); g_pStopWatchRecordCycleToLimitView = nullptr; } @@ -29,118 +27,98 @@ namespace OHOS // 初始化秒表到达最高圈数时弹出的视图 UIScrollView *StopWatchRecordCycleToLimitView::InitStopWatchRecordCycleToLimitView() { - if (scrollView1_ == nullptr) - { - scrollView1_ = new UIScrollView(); - } - scrollView1_->SetPosition(0, 0); - scrollView1_->Resize(466, 466); - scrollView1_->SetViewId("scrollView1"); - scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView1_->SetVisible(true); - /* -------------------------------------------------------------------------- */ - if (label1_ == nullptr) + if (scrollView == nullptr) { - label1_ = new UILabel(); - } - label1_->SetPosition(203, 52); - label1_->Resize(60, 35); - label1_->SetViewId("label1"); - label1_->SetStyle(STYLE_TEXT_FONT, 30); - label1_->SetStyle(STYLE_LINE_HEIGHT, 35); - label1_->SetText("秒表"); - label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label1_->SetRollSpeed(0); - label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - scrollView1_->Add(label1_); - label1_->SetVisible(true); - /* -------------------------------------------------------------------------- */ - if (image1_ == nullptr) - { - image1_ = new UIImageView(); - } - image1_->SetPosition(193, 121); - image1_->Resize(100, 100); - image1_->SetViewId("image1"); - image1_->SetStyle(STYLE_BORDER_RADIUS, 100); - char *image1imagesPath = "/user/res/countdown/COUNTDOWN_ATTENTION.bin"; - image1_->SetSrc(image1imagesPath); - scrollView1_->Add(image1_); - image1_->SetVisible(true); - /* -------------------------------------------------------------------------- */ - // Add Label to App - if (label3_ == nullptr) - { - label3_ = new UILabel(); - } - label3_->SetPosition(83, 253); - label3_->Resize(300, 35); - label3_->SetViewId("label3"); - label3_->SetStyle(STYLE_TEXT_FONT, 30); - label3_->SetStyle(STYLE_LINE_HEIGHT, 35); - label3_->SetText("当前已达到了最高圈数"); - label3_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label3_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label3_->SetRollSpeed(0); - label3_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - // Add to scrollView1 - scrollView1_->Add(label3_); - label3_->SetVisible(true); - /* -------------------------------------------------------------------------- */ - // Add Button to App - if (button1_ == nullptr) - { - button1_ = new UIButton(); - } - button1_->SetPosition(0, 366); - button1_->Resize(466, 100); - button1_->SetViewId(CycleToLimitReturnButton_VIEWID); - button1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); - button1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - char *button1defaultImgSrc = "/user/res/countdown/COUNTDOWN_BUTTON.bin"; - button1_->SetImageSrc(button1defaultImgSrc, nullptr); - button1_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffbfbfb, UIButton::PRESSED); - button1_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); - button1_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + scrollView = new UIScrollView(); - // Add the CallBack about events - UIView::OnClickListener *button1Click = static_cast(MainStopWatchPresenter::GetInstance()); - button1_->SetOnClickListener(button1Click); - // Add to scrollView1 - scrollView1_->Add(button1_); - button1_->SetVisible(true); - viewInitStatus == true; - return scrollView1_; + scrollView->SetPosition(0, 0, 466, 466); + scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + /* -------------------------------------------------------------------------- */ + if (Title == nullptr) + { + Title = new UILabelExt(); + } + Title->SetPosition(83, 52, 300, 40); + Title->SetStyle(STYLE_TEXT_FONT, 30); + Title->SetStyle(STYLE_LINE_HEIGHT, 35); + Title->SetText("秒表"); + Title->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + Title->SetRollSpeed(40); + Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + /* -------------------------------------------------------------------------- */ + if (AttentionImage == nullptr) + { + AttentionImage = new UIImageView(); + } + AttentionImage->SetPosition(193, 121, 100, 100); + AttentionImage->SetStyle(STYLE_BORDER_RADIUS, 100); + AttentionImage->SetSrc(PNG_ATTENTION_IMAGE); + /* -------------------------------------------------------------------------- */ + if (AttentionLabel == nullptr) + { + AttentionLabel = new UILabelExt(); + } + AttentionLabel->SetPosition(83, 253, 300, 40); + AttentionLabel->SetStyle(STYLE_TEXT_FONT, 30); + AttentionLabel->SetStyle(STYLE_LINE_HEIGHT, 35); + AttentionLabel->SetText("当前已达到了最高圈数"); + AttentionLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + AttentionLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + AttentionLabel->SetTextColor(Color::GetColorFromRGBA(0xaa, 0xaa, 0xaa, 0xff)); + AttentionLabel->SetRollSpeed(40); + AttentionLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + /* -------------------------------------------------------------------------- */ + if (button == nullptr) + { + button = new UILabelButtonExt(); + } + button->SetPosition(0, 366, 466, 100); + button->SetViewId(CycleToLimitReturnButton_VIEWID); + button->SetImageSrc(PNG_466x100BUTTON_IMAGE, PNG_466x100BUTTON_IMAGE); + button->SetText("知道了"); + button->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + button->SetStyle(STYLE_LINE_HEIGHT, 35); + button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED); + UIView::OnClickListener *buttonClick = static_cast(MainStopWatchPresenter::GetInstance()); + button->SetOnClickListener(buttonClick); + /* ----------------------------------- Add ---------------------------------- */ + scrollView->Add(Title); + scrollView->Add(AttentionImage); + scrollView->Add(AttentionLabel); + scrollView->Add(button); + } + return scrollView; } - void StopWatchRecordCycleToLimitView::DeInitView() + void StopWatchRecordCycleToLimitView::ClearAll() { - if (scrollView1_ != nullptr) + scrollView->RemoveAll(); + + if (Title != nullptr) { - scrollView1_->RemoveAll(); - delete scrollView1_; - scrollView1_ = nullptr; + delete Title; + Title = nullptr; } - if (label1_ != nullptr) + if (AttentionImage != nullptr) { - delete label1_; - label1_ = nullptr; + delete AttentionImage; + AttentionImage = nullptr; } - if (image1_ != nullptr) + if (AttentionLabel != nullptr) { - delete image1_; - image1_ = nullptr; + delete AttentionLabel; + AttentionLabel = nullptr; } - if (label3_ != nullptr) + if (button != nullptr) { - delete label3_; - label3_ = nullptr; + delete button; + button = nullptr; } - if (button1_ != nullptr) + if (scrollView != nullptr) { - delete button1_; - button1_ = nullptr; + delete scrollView; + scrollView = nullptr; } } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchRecordTimeToLimitView.cpp b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchRecordTimeToLimitView.cpp index eaf3cb638..241bd2cbb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchRecordTimeToLimitView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/stopwatch/src/StopWatchRecordTimeToLimitView.cpp @@ -10,16 +10,12 @@ namespace OHOS StopWatchRecordTimeToLimitView::StopWatchRecordTimeToLimitView() { - g_pStopWatchRecordTimeToLimitView = this; } StopWatchRecordTimeToLimitView::~StopWatchRecordTimeToLimitView() { - if (viewInitStatus == true) - { - DeInitView(); - } + ClearAll(); g_pStopWatchRecordTimeToLimitView = nullptr; } @@ -31,117 +27,111 @@ namespace OHOS UIScrollView *StopWatchRecordTimeToLimitView::InitStopWatchRecordTimeToLimitView() { - if (scrollView1_ == nullptr) - { - scrollView1_ = new UIScrollView(); - } - scrollView1_->SetPosition(0, 0); - scrollView1_->Resize(466, 466); - scrollView1_->SetViewId("scrollView1"); - scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView1_->SetVisible(true); - /* -------------------------------------------------------------------------- */ - if (label1_ == nullptr) - { - label1_ = new UILabel(); - } - label1_->SetPosition(203, 52); - label1_->Resize(60, 35); - label1_->SetViewId("label1"); - label1_->SetStyle(STYLE_TEXT_FONT, 30); - label1_->SetStyle(STYLE_LINE_HEIGHT, 35); - label1_->SetText("秒表"); - label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label1_->SetRollSpeed(0); - label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - scrollView1_->Add(label1_); - label1_->SetVisible(true); - /* -------------------------------------------------------------------------- */ - if (image1_ == nullptr) - { - image1_ = new UIImageView(); - } - image1_->SetPosition(193, 121); - image1_->Resize(100, 100); - image1_->SetViewId("image1"); - image1_->SetStyle(STYLE_BORDER_RADIUS, 100); - char *image1imagesPath = "/user/res/countdown/COUNTDOWN_ATTENTION.bin"; - image1_->SetSrc(image1imagesPath); - scrollView1_->Add(image1_); - image1_->SetVisible(true); - /* -------------------------------------------------------------------------- */ - // Add Label to App - if (label3_ == nullptr) - { - label3_ = new UILabel(); - } - label3_->SetPosition(53, 235); - label3_->Resize(300, 35); - label3_->SetViewId("label3"); - label3_->SetStyle(STYLE_TEXT_FONT, 30); - label3_->SetStyle(STYLE_LINE_HEIGHT, 35); - label3_->SetText("当前已达到了最长时间\n表秒自动暂停,请重新开始"); - label3_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - label3_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label3_->SetRollSpeed(0); - label3_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - // Add to scrollView1 - scrollView1_->Add(label3_); - label3_->SetVisible(true); - /* -------------------------------------------------------------------------- */ - // Add Button to App - if (button1_ == nullptr) + if (scrollView == nullptr) { - button1_ = new UIButton(); + scrollView = new UIScrollView(); + scrollView->SetPosition(0, 0, 466, 466); + scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + /* -------------------------------------------------------------------------- */ + if (Title == nullptr) + { + Title = new UILabelExt(); + } + Title->SetPosition(83, 52, 300, 40); + Title->SetStyle(STYLE_TEXT_FONT, 30); + Title->SetStyle(STYLE_LINE_HEIGHT, 35); + Title->SetText("秒表"); + Title->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + Title->SetRollSpeed(40); + Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + /* -------------------------------------------------------------------------- */ + if (AttentionImage == nullptr) + { + AttentionImage = new UIImageView(); + } + AttentionImage->SetPosition(193, 121, 100, 100); + AttentionImage->SetStyle(STYLE_BORDER_RADIUS, 100); + AttentionImage->SetSrc(PNG_ATTENTION_IMAGE); + /* ---------------------------- AttentionLabel_1 ---------------------------- */ + if (AttentionLabel_1 == nullptr) + { + AttentionLabel_1 = new UILabelExt(); + } + AttentionLabel_1->SetPosition(83, 235, 300, 40); + AttentionLabel_1->SetStyle(STYLE_TEXT_FONT, 30); + AttentionLabel_1->SetStyle(STYLE_LINE_HEIGHT, 35); + AttentionLabel_1->SetText("当前已达到了最长时间"); + AttentionLabel_1->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + AttentionLabel_1->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + AttentionLabel_1->SetTextColor(Color::GetColorFromRGBA(0xaa, 0xaa, 0xaa, 0xff)); + AttentionLabel_1->SetRollSpeed(40); + AttentionLabel_1->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + /* ---------------------------- AttentionLabel_2 ---------------------------- */ + if (AttentionLabel_2 == nullptr) + { + AttentionLabel_2 = new UILabelExt(); + } + AttentionLabel_2->SetPosition(33, 279, 400, 40); + AttentionLabel_2->SetStyle(STYLE_TEXT_FONT, 30); + AttentionLabel_2->SetStyle(STYLE_LINE_HEIGHT, 35); + AttentionLabel_2->SetText("表秒自动暂停,请重新开始"); + AttentionLabel_2->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + AttentionLabel_2->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + AttentionLabel_2->SetTextColor(Color::GetColorFromRGBA(0xaa, 0xaa, 0xaa, 0xff)); + AttentionLabel_2->SetRollSpeed(40); + AttentionLabel_2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + /* -------------------------------------------------------------------------- */ + if (button == nullptr) + { + button = new UILabelButtonExt(); + } + button->SetPosition(0, 366, 466, 100); + button->SetViewId(TimeToLimitReturnButton_VIEWID); + button->SetImageSrc(PNG_466x100BUTTON_IMAGE, PNG_466x100BUTTON_IMAGE); + button->SetText("知道了"); + button->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + button->SetStyle(STYLE_LINE_HEIGHT, 35); + button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED); + UIView::OnClickListener *buttonClick = static_cast(MainStopWatchPresenter::GetInstance()); + button->SetOnClickListener(buttonClick); + /* ----------------------------------- Add ---------------------------------- */ + scrollView->Add(Title); + scrollView->Add(AttentionImage); + scrollView->Add(AttentionLabel_1); + scrollView->Add(AttentionLabel_2); + scrollView->Add(button); } - button1_->SetPosition(0, 366); - button1_->Resize(466, 100); - button1_->SetViewId(TimeToLimitReturnButton_VIEWID); - button1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); - button1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - char *button1defaultImgSrc = "/user/res/countdown/COUNTDOWN_BUTTON.bin"; - button1_->SetImageSrc(button1defaultImgSrc, nullptr); - button1_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffbfbfb, UIButton::PRESSED); - button1_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); - button1_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); - // Add the CallBack about events - UIView::OnClickListener *button1Click = static_cast(MainStopWatchPresenter::GetInstance()); - button1_->SetOnClickListener(button1Click); - // Add to scrollView1 - scrollView1_->Add(button1_); - button1_->SetVisible(true); - viewInitStatus = true; - return scrollView1_; + return scrollView; } - void StopWatchRecordTimeToLimitView::DeInitView() + void StopWatchRecordTimeToLimitView::ClearAll() { - if (scrollView1_ != nullptr) + scrollView->RemoveAll(); + if (Title != nullptr) { - scrollView1_->RemoveAll(); - delete scrollView1_; - scrollView1_ = nullptr; + delete Title; + Title = nullptr; } - if (label1_ != nullptr) + if (AttentionImage != nullptr) { - delete label1_; - label1_ = nullptr; + delete AttentionImage; + AttentionImage = nullptr; } - if (image1_ != nullptr) + if (AttentionLabel_1 != nullptr) { - delete image1_; - image1_ = nullptr; + delete AttentionLabel_1; + AttentionLabel_1 = nullptr; } - if (label3_ != nullptr) + if (button != nullptr) { - delete label3_; - label3_ = nullptr; + delete button; + button = nullptr; } - if (button1_ != nullptr) + if (scrollView != nullptr) { - delete button1_; - button1_ = nullptr; + delete scrollView; + scrollView = nullptr; } } } \ No newline at end of file diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp index 1313f14b5..a1c358d66 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/charge_notification.cpp @@ -207,7 +207,7 @@ namespace OHOS alarm_img->SetViewId("image1");// Set style // Set additional property - const char *imageimagesPath = "/user/res/FastTrainingAttentionVector.bin"; + const char *imageimagesPath = "/user/res/Attention.bin"; alarm_img->SetSrc(imageimagesPath); // Add to rootView diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp index e471c2afd..ff79143e1 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp @@ -447,7 +447,7 @@ namespace OHOS return nullptr; } DeviceUnbindingRequestViewImageView->SetPosition(193, 121, 80, 80); - const char *imageimagesPath = "/user/res/FastTrainingAttentionVector.bin"; + const char *imageimagesPath = "/user/res/Attention.bin"; DeviceUnbindingRequestViewImageView->SetSrc(imageimagesPath); /* --------------------- DeviceUnbindingRequestViewLabel[0] -------------------- */ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/FastTrainingAttentionVector.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/Attention.bin similarity index 100% rename from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/FastTrainingAttentionVector.bin rename to code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/Attention.bin diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/OrangeAttentionVector.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/OrangeAttentionVector.bin deleted file mode 100644 index b8120b8579a42d860deb2b2d948d1cfa0d438b52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4504 zcmcInZA@F|6+YKC#^xh-VU&=r*nC8VCeiE?AZZiuwTB9w(qd=Y)*l4u(oidqatW(g zK-_B}3(m&~0WH;N<7iEjkS%T4RISolVj!7e3IUQxYc!OyW?hnYQfw|AW|;f#+)JEw zcRxIf)c$q!o_pT&yyv{nsSSMErfreB_jR)Upqp@aeMa#(=7wRq!>7Q*+StaFP8&En_sm4^x;%Kwa;)9_p6G< zJ+0co05d2s&_)Q$`d5YH5pwWgK>;CF?QDP%zGR@IMIoNq@Ld(2hrVdtMi*%QNr+?Y z7-O>(9PWG)KnwnbW&AD?|Dt#TblE3?)IK7R3ltnC_rJ7Ht#5phD^N9!)LS;T1ellzObGgFHH-EqS!2TYo%@!Fj6dq>KF%ZWclZ3H#YE<$uE&RQS{R>X6!&%6f; zr^R&OLrar9-<8_d+--R++GjvIFt`A8_vZ7u&zn{szn$Uz&BXkYwf|&*NhjDJp_j8LkH1N#z|z1rvq8Hv{>JxImc>BJJf$2iW+TOuuiKniiEuSH zF1J5B|Fo(UGP{juehgjJM&Q&lkPz|w9sR~cm|+G_00$S8qm+2wDXDdP1QwGuVt=`x z6W4c~fNyh34mkP#4)lV((WLheZOfMnEV<#jbwutTt^KI+(Ph8ueq${dTL%_~ zJhu7-yV<#WqzY!<`mO0F%|dZQ@@Vz){l6mKe+5|G2OrKu1DVxje6aUP?58h!uT{la zAm;ng;*tBy@hQGuKS=P({Ug~G`Fm0T0y|GCfJ+07Lf)^HcI6pejJrtH3GmuxwQ}2` zxUaBZ$mMZE;}6bHl$!@i)39~mZ#{Io%B!!6v|pt4M~zRupLwi0Z?a~%RLr?ypK!6# z9ml_PBV?ap8U6tKG-a0VM_ug+oR9S^TYS|WC)M}zI0(RP} z`1m`gxs(3?;uGiI`(oK1lHS*gI8qRQ7~he0P-R7nNA54jx6=6{kAKzt5MRydEhQPx zJeX%txKCF2HV&%tx&D)K9G zTeM>TyAJOmB~35xwd zyMGqYJ>l8J4lK-j2;t3T&3XQ6rB!_372fFi{7U(YJm0MTSj30*|)*6~OG{jo4%Kcv4o@mGF9{(U4nTu<9o)JJ&2R_Cu! zzleNY=Px8nti(?<6e2mjNQ!5P^~3Er4QH|>|?9vd`i?4 zq1V$u`5(O**0=Vvt3>|1S>(^w|uq(#)d1U!76>bkor{8d%ou&S|`^f`5tn1-xtOBjvl&^>BUhJyW-1ed+GT zIkCQji#?#>>X)vKR`Wid;H3VRjzbJ~4)sG?U9C`p{f&2S%8L4=L}7eA$z7VA+1+V( f??XK{L3ET6lK#T7nWh@4J_Nh73cTxAn(w~>)-Cjh diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/countdown/COUNTDOWN_ATTENTION.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/countdown/COUNTDOWN_ATTENTION.bin deleted file mode 100644 index b8120b8579a42d860deb2b2d948d1cfa0d438b52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4504 zcmcInZA@F|6+YKC#^xh-VU&=r*nC8VCeiE?AZZiuwTB9w(qd=Y)*l4u(oidqatW(g zK-_B}3(m&~0WH;N<7iEjkS%T4RISolVj!7e3IUQxYc!OyW?hnYQfw|AW|;f#+)JEw zcRxIf)c$q!o_pT&yyv{nsSSMErfreB_jR)Upqp@aeMa#(=7wRq!>7Q*+StaFP8&En_sm4^x;%Kwa;)9_p6G< zJ+0co05d2s&_)Q$`d5YH5pwWgK>;CF?QDP%zGR@IMIoNq@Ld(2hrVdtMi*%QNr+?Y z7-O>(9PWG)KnwnbW&AD?|Dt#TblE3?)IK7R3ltnC_rJ7Ht#5phD^N9!)LS;T1ellzObGgFHH-EqS!2TYo%@!Fj6dq>KF%ZWclZ3H#YE<$uE&RQS{R>X6!&%6f; zr^R&OLrar9-<8_d+--R++GjvIFt`A8_vZ7u&zn{szn$Uz&BXkYwf|&*NhjDJp_j8LkH1N#z|z1rvq8Hv{>JxImc>BJJf$2iW+TOuuiKniiEuSH zF1J5B|Fo(UGP{juehgjJM&Q&lkPz|w9sR~cm|+G_00$S8qm+2wDXDdP1QwGuVt=`x z6W4c~fNyh34mkP#4)lV((WLheZOfMnEV<#jbwutTt^KI+(Ph8ueq${dTL%_~ zJhu7-yV<#WqzY!<`mO0F%|dZQ@@Vz){l6mKe+5|G2OrKu1DVxje6aUP?58h!uT{la zAm;ng;*tBy@hQGuKS=P({Ug~G`Fm0T0y|GCfJ+07Lf)^HcI6pejJrtH3GmuxwQ}2` zxUaBZ$mMZE;}6bHl$!@i)39~mZ#{Io%B!!6v|pt4M~zRupLwi0Z?a~%RLr?ypK!6# z9ml_PBV?ap8U6tKG-a0VM_ug+oR9S^TYS|WC)M}zI0(RP} z`1m`gxs(3?;uGiI`(oK1lHS*gI8qRQ7~he0P-R7nNA54jx6=6{kAKzt5MRydEhQPx zJeX%txKCF2HV&%tx&D)K9G zTeM>TyAJOmB~35xwd zyMGqYJ>l8J4lK-j2;t3T&3XQ6rB!_372fFi{7U(YJm0MTSj30*|)*6~OG{jo4%Kcv4o@mGF9{(U4nTu<9o)JJ&2R_Cu! zzleNY=Px8nti(?<6e2mjNQ!5P^~3Er4QH|>|?9vd`i?4 zq1V$u`5(O**0=Vvt3>|1S>(^w|uq(#)d1U!76>bkor{8d%ou&S|`^f`5tn1-xtOBjvl&^>BUhJyW-1ed+GT zIkCQji#?#>>X)vKR`Wid;H3VRjzbJ~4)sG?U9C`p{f&2S%8L4=L}7eA$z7VA+1+V( f??XK{L3ET6lK#T7nWh@4J_Nh73cTxAn(w~>)-Cjh diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/countdown/COUNTDOWN_BUTTON.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/countdown/COUNTDOWN_BUTTON.bin deleted file m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