From 2ebf02983aaac40c237db473c54f8470e7f3536c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Thu, 12 Sep 2024 01:53:38 +0000 Subject: [PATCH] Merge #942 into sdk602patch0626 from refs/changes/942/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/942/head: (10 commits squashed) - 闹钟UI优化: 1.#636,解决,手表,闹钟只响铃3次bug 2.闹钟编辑界面优化 3.闹钟界面中星期缩写中文为:一,二...日,其他语言为:Mon,Tue...Sun - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - #534,解决闹钟设置多个闹钟,只响第一个,后续的没有提示闹钟bug - 解决#534,解决闹钟设置多个闹钟,只响第一个,后续的没有提示闹钟bug 修改闹钟弹窗无操作50s后自动关闭 - #642,解决:删除多余闹钟后,界面不能显示剩余闹钟bug - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - #370,解决:下拉状态栏中,开启4G开关,停留在下拉菜单中,信号格状态不刷新(息屏时不会刷新)bug #618,解决:4G开关开启,重启手表,4G开关状态颜色响应比较慢bug - #639,解决:设置-图标不圆,有缺失,勿扰模式,更换卡片,省电模式bug - #154,解决:手表端超时不操作后,绑定请求会继续留在手表界面bug - 6.天气界面UI修改,与figma上设计保持一致 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/942 --- .../nativelauncher/include/UiConfig.h | 4 ++ .../nativeui/alarm/include/MainAlarmView.h | 2 +- .../nativeui/alarm/src/MainAlarmView.cpp | 39 ++++++++++---- .../src/AlarmClockTimerConfig.cpp | 3 +- .../main/include/dropdown/DropDownCardPage1.h | 3 +- .../nativeui/main/src/MainPresenterSample.cpp | 23 ++++---- .../nativeui/main/src/PullUpDownView.cpp | 7 ++- .../main/src/dropdown/DropDownCardPage1.cpp | 8 ++- .../nativeui/settings/src/SettingItemView.cpp | 8 +-- .../nativeui/settings/src/SettingModel.cpp | 12 ++--- .../weather/src/WeatherReportView.cpp | 10 ++-- .../nativeui/weather/src/WeatherView.cpp | 52 ++++++++++--------- .../include/notify/pairing_notification.h | 16 ++---- .../src/notify/pairing_notification.cpp | 29 ++++------- .../fs/user/res/settings/SETTINGS_CARDSET.bin | 3 ++ .../user/res/settings/SETTINGS_CHANGEDIAL.bin | 3 ++ .../fs/user/res/settings/SETTINGS_DISTURB.bin | 3 ++ .../fs/user/res/settings/SETTINGS_SAVEELE.bin | 3 ++ 18 files changed, 130 insertions(+), 98 deletions(-) create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_CARDSET.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_CHANGEDIAL.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_DISTURB.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_SAVEELE.bin diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h index 2005915b5..ea671a861 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h @@ -353,6 +353,10 @@ namespace OHOS static constexpr const char *PNG_SETTINGS_DISPLAY_MODE = APP_RES_PATH "/settings/SETTINGS_DISPLAY_MODE.bin"; // 显示方式 static constexpr const char *PNG_SETTINGS_MOTION_RECOGNITION = APP_RES_PATH "/settings/SETTINGS_MOTION_RECOGNITION.bin"; // 运动识别 static constexpr const char *PNG_SETTINGS_SYSTEM = APP_RES_PATH "/settings/SETTINGS_SYSTEM.bin"; // 系统 + static constexpr const char *PNG_SETTINGS_DISTURB_IMAGE = APP_RES_PATH "/settings/SETTINGS_DISTURB.bin"; // 勿扰 + static constexpr const char *PNG_SETTINGS_CARDSET_IMAGE = APP_RES_PATH "/settings/SETTINGS_CARDSET.bin"; // 卡片管理 + static constexpr const char *PNG_SETTINGS_CHANGEDIAL_IMAGE = APP_RES_PATH "/settings/SETTINGS_CHANGEDIAL.bin"; // 表盘浏览特效 + static constexpr const char *PNG_SETTINGS_SAVEELE_IMAGE = APP_RES_PATH "/settings/SETTINGS_SAVEELE.bin"; // 省电模式 static constexpr const char *PNG_SETTINGS_SHUTDOWN_AND_RESTART = APP_RES_PATH "/settings/SETTINGS_SHUTDOWN_AND_RESTART.bin"; // 关机和重启 static constexpr const char *PNG_SETTINGS_SETTTING_SHUTDOWN = APP_RES_PATH "/settings/SETTTING_SHUTDOWN.bin"; // 关机 static constexpr const char *PNG_SETTINGS_SETTTING_REBOOT = APP_RES_PATH "/settings/SETTTING_REBOOT.bin"; diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarm/include/MainAlarmView.h b/code/sdk/application/wearable/fd230app/nativeui/alarm/include/MainAlarmView.h index 8b8b1e02d..f6ff00df6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarm/include/MainAlarmView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/alarm/include/MainAlarmView.h @@ -35,7 +35,7 @@ namespace OHOS { constexpr int16_t D_CLOCK_Y = 210; constexpr int16_t LABEL_ZERO_Y = 270; -constexpr int16_t ALARM_INTER_ADD = 130; // 130; +constexpr int16_t ALARM_INTER_ADD = 120; // 120; class AlarmPresenter; class MainAlarmView : public View { diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp index 86e00a1d1..7711d2340 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp @@ -215,6 +215,7 @@ void MainAlarmView::AlarmAddButtonCreate(void) } } +//更新闹钟添加按钮的位置 //更新闹钟添加按钮的位置 void MainAlarmView::AlarmAddButtonUpdate(uint8_t count) { @@ -235,14 +236,29 @@ void MainAlarmView::AlarmAddButtonUpdate(uint8_t count) // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]: is_up_drag = %d", __LINE__, is_up_drag); // // group->ScrollBy(0, is_up_drag ? - 120 : 120); // group->Invalidate(); - if(nullptr == AddButton_) + if(nullptr == AddButton_ || TitleLabelExt_ == nullptr) return; - - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]: 0_y=%d", __LINE__, SwipeView_[0]->GetY()); - AddButton_->SetY((0 == count) ? (Screen::GetInstance().GetHeight() / 2 - 50) : (SwipeView_[0]->GetY() + (alarmInterval * count))); - // if(group) { - // group->ScrollBy(0, ADD_BUTTON_Y - AddButton_->GetY()); - // } + int bef_y = 0; + int aft_y = 0; + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]: 0_y=%d", __LINE__, Screen::GetInstance().GetHeight() / 2); + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]: 0_y=%d", __LINE__, TitleLabelExt_->GetHeight()); + bef_y = AddButton_->GetY(); + if((0 == count)) + { + TitleLabelExt_->SetY(50); + AddButton_->SetY(120); + } + else + { + if(SwipeView_[0]) { + AddButton_->SetY(SwipeView_[0]->GetY() + (alarmInterval * count)); + } + } + aft_y = AddButton_->GetY(); + bool is_up_drag = bef_y- aft_y > 0 ? false:true; + if(group) { + group->ScrollBy(0, is_up_drag ? - 120 : 120); + } RootView::GetInstance()->Invalidate(); } @@ -451,14 +467,15 @@ void MainAlarmView::OnStart() // 增加按键监听 RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::AlarmPresenter::GetInstance(); RootView::GetInstance()->SetOnKeyActListener(keyactListener); - group = new UIScrollView(); if (group == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new group fail"); - return; + group = new UIScrollView(); + if (group == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new group fail"); + return; + } } // group->SetPosition(CONTAINER_X, CONTAINER_Y, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); group->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::AlarmPresenter::GetInstance(); group->SetScrollBlankSize(50); // group->SetMaxScrollDistance(1000); // 1000: max scroll distance // group->SetSwipeACCLevel(800); // 800: compensation distance diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp index b0b6aa1ca..23b188859 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp @@ -357,6 +357,7 @@ extern "C" WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Scanning alarms - Current time: %02d:%02d:%02d", curTime.tm_hour, curTime.tm_min, curTime.tm_sec); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "g_alarmCtrA.state = %d,%02d:%02d", g_alarmCtrA.state,g_alarmCtrA.info.hour ,g_alarmCtrA.info.minute); if (g_alarmCtrA.state == ALARM_STATUS_RUNNING) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Checking Alarm A"); @@ -365,8 +366,8 @@ extern "C" (g_alarmCtrA.info.minute == curTime.tm_min)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Alarm A triggered"); - g_alarmCtrA.callback(); g_alarmCtrA.state = ALARM_STATUS_CREATED; + g_alarmCtrA.callback(); } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/dropdown/DropDownCardPage1.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/dropdown/DropDownCardPage1.h index e569d972c..2989d3b63 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/dropdown/DropDownCardPage1.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/dropdown/DropDownCardPage1.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-08-21 11:54:00 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-26 20:21:33 + * @LastEditTime: 2024-09-11 15:28:39 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/include/dropdown/DropDownCardPage1.h */ #ifndef __DROPDOWN_CARD_PAGE1_H__ @@ -53,6 +53,7 @@ namespace OHOS void Updat4GState(bool state); void UpdateDnotdisturbState(bool state); void UpdateSleepModelState(bool state); + void Refresh4GState(); private: UIToggleButton *ToggleButtonInit(ToggleButtonConfig &toggleButtonConfig); 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 4587bdb9f..ba20d7952 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp @@ -319,7 +319,7 @@ namespace OHOS { UpdataBaseData(); PullUpDownView::GetInstance()->UpdateSignalStrengthStatusAndBatteryPosition(); - PullUpDown_StartTimer(1000); + PullUpDown_StartTimer(2000); } else { @@ -687,19 +687,24 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 声明定时器变量 static osTimerId_t g_timer = NULL; - static uint8_t UPDATETIME = 2; // 2秒 + static uint8_t UPDATETIME = 20; // 20秒 uint8_t MainPresenterSample::g_PullUpDownTimes = UPDATETIME; /*定时器到期时的处理*/ static void PullUpDown_TimerCallbackProc(int data) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDown_TimerCallbackProc"); - MainPresenterSample::g_PullUpDownTimes--; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "%d", MainPresenterSample::g_PullUpDownTimes); - if (MainPresenterSample::g_PullUpDownTimes <= 0) + if (uapi_get_screen_state() == 1) // 息屏状态下若停留在下拉界面,20s后无操作停止更新数据 + { + MainPresenterSample::g_PullUpDownTimes -= 2; + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "%d", MainPresenterSample::g_PullUpDownTimes); + if (MainPresenterSample::g_PullUpDownTimes <= 0) { + GraphicService::GetInstance()->PostGraphicEvent(std::bind(&MainPresenterSample::PullUpDown_StopTimer, MainPresenterSample::GetInstance())); + } + } + else //亮屏状态下每2s刷新一次下拉数据 { MainPresenterSample::g_PullUpDownTimes = UPDATETIME; - if (PullUpDownView::GetInstance() != nullptr) { PullUpDownView::GetInstance()->UpdateSignalStrengthStatusAndBatteryPosition(); @@ -709,12 +714,6 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PullUpDownView::GetInstance fail!!"); } } - - if (uapi_get_screen_state() == 1) // 息屏停止更新数据 - { - GraphicService::GetInstance()->PostGraphicEvent(std::bind(&MainPresenterSample::PullUpDown_StopTimer, MainPresenterSample::GetInstance())); - } - return; } 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 aba99e1cd..791aec4b6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-26 18:14:24 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-29 10:16:29 + * @LastEditTime: 2024-09-11 16:16:01 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp */ @@ -659,6 +659,11 @@ namespace OHOS } } } + /*4g开关的状态刷新*/ + if(DropDownCardPage1::GetInstance()) + { + DropDownCardPage1::GetInstance()->Refresh4GState(); + } } // 更新信号强度显示 void PullUpDownView::UpdateSignalBarDisplay(int signalBars, bool state) diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/dropdown/DropDownCardPage1.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/dropdown/DropDownCardPage1.cpp index 6f51b8737..87d6060ad 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/dropdown/DropDownCardPage1.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/dropdown/DropDownCardPage1.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-08-21 11:54:00 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-31 11:05:12 + * @LastEditTime: 2024-09-11 15:29:18 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/src/dropdown/DropDownCardPage1.cpp */ #include "main/include/dropdown/DropDownCardPage1.h" @@ -263,6 +263,12 @@ namespace OHOS } } + //刷新4g开关显示 + void DropDownCardPage1::Refresh4GState() + { + Updat4GState(uapi_cat1_get_power_stat()); + } + void DropDownCardPage1::UpdateDnotdisturbState(bool state) { if (toggleButton[DropDownCardPage1::toggleButton_DNOTDISTURB] != nullptr) diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp index b9e16be58..47064868c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-27 19:48:49 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-24 10:40:42 + * @LastEditTime: 2024-09-11 16:46:26 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp */ @@ -67,9 +67,9 @@ namespace OHOS { Icon.SetPosition(SETTING_ICON_X, SETTING_SICON_Y, SETTING_SICON_W, SETTING_SICON_H); Icon.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); - Icon.SetAutoEnable(false); - Icon.SetResizeMode(UIImageView::SCALE_DOWN); - Icon.SetStyle(STYLE_BORDER_RADIUS, 100); + // Icon.SetAutoEnable(false); + // Icon.SetResizeMode(UIImageView::SCALE_DOWN); + // Icon.SetStyle(STYLE_BORDER_RADIUS, 100); settingLabelExt.SetPosition(SETTINGLABELEXT_X, SETTINGLABELEXT_Y, SETTINGLABELEXT_W, SETTINGLABELEXT_H); settingLabelExt.SetStyle(STYLE_TEXT_FONT, SETTINGLABELEXT_TEXT_FONT); diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp index 9854fed19..d9b0e049b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp @@ -1,8 +1,8 @@ /* * @Author: luozheng 1732036298@qq.com * @Date: 2024-02-18 09:09:13 - * @LastEditors: SnickerSun snickersun@163.com - * @LastEditTime: 2024-09-07 15:17:50 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-09-11 16:52:29 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp */ #include "settings/include/SettingModel.h" @@ -36,10 +36,10 @@ namespace OHOS settings[index++] = {VIEW_SOUND_VIBRATION, PNG_SETTINGS_SOUND_VIBRATION, STR_SOUND_AND_VIBRATION, true}; settings[index++] = {VIEW_THEME_STYLE, PNG_SETTINGS_DISPLAY_MODE, STR_DISPLAY_MODE, true}; settings[index++] = {VIEW_MOTION_RECOGNITION, PNG_SETTINGS_MOTION_RECOGNITION, STR_MOTION_RECOGNITION, true}; - settings[index++] = {VIEW_DNOTDISTURB, PNG_APPLIST_DISTURB_IMAGE, STR_DO_NOT_DISTURB, true}; - settings[index++] = {VIEW_ADD_CARD, PNG_APPLIST_CARDSET_IMAGE, STR_CARD_MANAGEMENT, true}; - settings[index++] = {VIEW_SET_DIAL_STYLE, PNG_APPLIST_CHANGEDIAL_IMAGE, STR_DIAL_BROWSING_SPECIAL_EFFECTS, true}; - settings[index++] = {VIEW_SAVEELE, PNG_APPLIST_SAVEELE_IMAGE, STR_POWER_SAVE_MODE, true}; + settings[index++] = {VIEW_DNOTDISTURB, PNG_SETTINGS_DISTURB_IMAGE, STR_DO_NOT_DISTURB, true}; + settings[index++] = {VIEW_ADD_CARD, PNG_SETTINGS_CARDSET_IMAGE, STR_CARD_MANAGEMENT, true}; + settings[index++] = {VIEW_SET_DIAL_STYLE, PNG_SETTINGS_CHANGEDIAL_IMAGE, STR_DIAL_BROWSING_SPECIAL_EFFECTS, true}; + settings[index++] = {VIEW_SAVEELE, PNG_SETTINGS_SAVEELE_IMAGE, STR_POWER_SAVE_MODE, true}; settings[index++] = {VIEW_SYSTEM, PNG_SETTINGS_SYSTEM, STR_SYSTEM, true}; // settings[index++] = {VIEW_REBOOTANDSHUTDOWN, PNG_SETTINGS_SHUTDOWN_AND_RESTART, STR_SHUTDOWN_AND_RESTART, true}; usedLen = index; diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp index 9405ffc28..a95e8bba9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp @@ -125,7 +125,7 @@ namespace OHOS label->SetText(labelconfig.text.c_str()); // 内容 label->SetLineBreakMode(labelconfig.lineBreakMode); // 断行模式。 label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize); + label->SetFont(GILROY_BOLD_FONT, labelconfig.fontSize); return label; } @@ -157,7 +157,7 @@ namespace OHOS .lineHeigh = 35, //.text = "气象报告", .textId = STR_WEATHER_REPORT, - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; title = SetUpLabelExt(labelconfig); if (title == nullptr) @@ -174,7 +174,7 @@ namespace OHOS .fontSize = 40, .lineHeigh = 50, .text = UVData.c_str(), // 紫外线强度 - .lineBreakMode = UILabel::LINE_BREAK_ELLIPSIS, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; UV_Number = SetUpLabel(labelconfig); if (UV_Number == nullptr) @@ -207,11 +207,11 @@ namespace OHOS .top = 290, .width = 120, .height = 35, - .fontSize = 26, + .fontSize = 30, .lineHeigh = 35, //.text = "紫外线", .textId = STR_ULTRAVIOLET, - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; UV = SetUpLabelExt(labelconfig); if (UV == nullptr) diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp index fae96ec99..49a6c9012 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp @@ -2,13 +2,13 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-12 11:44:04 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-17 16:08:22 + * @LastEditTime: 2024-09-11 19:08:27 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp */ #include "weather/include/WeatherView.h" #include "ConfigModel.h" #include "weather/include/WeatherModel.h" -#include "common/image_cache_manager.h" +#include "graphic_config.h" /* 当至天气界面时,主动获取最新天气数据。 (此操作静默将进行,获取到则立刻更新显示,获取不到则重试 @@ -25,8 +25,8 @@ namespace OHOS static constexpr int16_t WEATHER_BACKGROUND_IMAGE_H = 466; /*天气图片*/ - static constexpr int16_t WEATHER_IMAGE_X = 77; - static constexpr int16_t WEATHER_IMAGE_Y = 124; + static constexpr int16_t WEATHER_IMAGE_X = 100; + static constexpr int16_t WEATHER_IMAGE_Y = 168; static constexpr int16_t WEATHER_IMAGE_W = 130; static constexpr int16_t WEATHER_IMAGE_H = 130; @@ -39,36 +39,36 @@ namespace OHOS static constexpr int16_t CURRENT_TIME_LABEL_LINE_HEIGHT = 47; /*温度标签*/ - static constexpr int16_t TEMPERATURE_LABEL_X = 211; - static constexpr int16_t TEMPERATURE_LABEL_Y = 126; + static constexpr int16_t TEMPERATURE_LABEL_X = 240; + static constexpr int16_t TEMPERATURE_LABEL_Y = 170; static constexpr int16_t TEMPERATURE_LABEL_W = 178; static constexpr int16_t TEMPERATURE_LABEL_H = 125; static constexpr int16_t TEMPERATURE_LABEL_TEXT_FONT = 100; static constexpr int16_t TEMPERATURE_LABEL_LINE_HEIGHT = 125; /*天气描述标签*/ - static constexpr int16_t WEATHER_DESCRIPTION_LABEL_X = 33; - static constexpr int16_t WEATHER_DESCRIPTION_LABEL_Y = 264; - static constexpr int16_t WEATHER_DESCRIPTION_LABEL_W = 400; - static constexpr int16_t WEATHER_DESCRIPTION_LABEL_H = 43; - static constexpr int16_t WEATHER_DESCRIPTION_LABEL_TEXT_FONT = 35; - static constexpr int16_t WEATHER_DESCRIPTION_LABEL_LINE_HEIGHT = 41; + static constexpr int16_t WEATHER_DESCRIPTION_LABEL_X = 53; + static constexpr int16_t WEATHER_DESCRIPTION_LABEL_Y = 316; + static constexpr int16_t WEATHER_DESCRIPTION_LABEL_W = 360; + static constexpr int16_t WEATHER_DESCRIPTION_LABEL_H = 35; + static constexpr int16_t WEATHER_DESCRIPTION_LABEL_TEXT_FONT = 30; + static constexpr int16_t WEATHER_DESCRIPTION_LABEL_LINE_HEIGHT = 35; /*天气地区标签*/ - static constexpr int16_t WEATHER_AREA_LABEL_X = 43; - static constexpr int16_t WEATHER_AREA_LABEL_Y = 330; - static constexpr int16_t WEATHER_AREA_LABEL_W = 380; - static constexpr int16_t WEATHER_AREA_LABEL_H = 33; - static constexpr int16_t WEATHER_AREA_LABEL_TEXT_FONT = 26; - static constexpr int16_t WEATHER_AREA_LABEL_LINE_HEIGHT = 30; + static constexpr int16_t WEATHER_AREA_LABEL_X = 53; + static constexpr int16_t WEATHER_AREA_LABEL_Y = 110; + static constexpr int16_t WEATHER_AREA_LABEL_W = 360; + static constexpr int16_t WEATHER_AREA_LABEL_H = 35; + static constexpr int16_t WEATHER_AREA_LABEL_TEXT_FONT = 30; + static constexpr int16_t WEATHER_AREA_LABEL_LINE_HEIGHT = 35; /*最高与最低气温标签*/ - static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_X = 83; - static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_Y = 368; - static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_W = 300; - static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_H = 33; - static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_TEXT_FONT = 20; - static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_LINE_HEIGHT = 23; + static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_X = 53; + static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_Y = 361; + static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_W = 360; + static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_H = 35; + static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_TEXT_FONT = 30; + static constexpr int16_t MAXANDMIN_TEMPERATURE_LABEL_LINE_HEIGHT = 35; #if IS_USE_IMAGEANIMATOR static constexpr int16_t PULLUP_ANIMATOR_VIEW_X = 213; @@ -186,7 +186,7 @@ namespace OHOS label->SetStyle(STYLE_TEXT_FONT, textfont); label->SetStyle(STYLE_LINE_HEIGHT, lineheight); label->SetText(text); - label->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + label->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, textfont); return label; @@ -223,6 +223,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherView::new showCurrentTimeLabel fail!"); return false; } + showCurrentTimeLabel->SetFont(GILROY_BOLD_FONT, CURRENT_TIME_LABEL_TEXT_FONT); /* -------------------------------------------------------------------------- */ showTemperatureLabel = InitLabelExt(TEMPERATURE_LABEL_X, TEMPERATURE_LABEL_Y, TEMPERATURE_LABEL_W, TEMPERATURE_LABEL_H, Temperature.c_str(), TEMPERATURE_LABEL_TEXT_FONT, TEMPERATURE_LABEL_LINE_HEIGHT); @@ -231,6 +232,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherView::new showTemperatureLabel fail!"); return false; } + // showTemperatureLabel->SetFont(GILROY_REGULAR_FONT, TEMPERATURE_LABEL_TEXT_FONT); /* -------------------------------------------------------------------------- */ showWeatherDescriptionLabel = InitLabelExt(WEATHER_DESCRIPTION_LABEL_X, WEATHER_DESCRIPTION_LABEL_Y, WEATHER_DESCRIPTION_LABEL_W, WEATHER_DESCRIPTION_LABEL_H, WeatherDescription.c_str(), WEATHER_DESCRIPTION_LABEL_TEXT_FONT, WEATHER_DESCRIPTION_LABEL_LINE_HEIGHT); diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/pairing_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/pairing_notification.h index a6cadffc2..152fcc9e4 100644 --- a/code/sdk/application/wearable/service/msg_center/include/notify/pairing_notification.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/pairing_notification.h @@ -2,20 +2,19 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-22 09:48:07 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-02 17:22:48 + * @LastEditTime: 2024-09-11 17:22:48 * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/include/notify/pairing_notification.h */ #ifndef PAIRING_NOTIFICATION_H #define PAIRING_NOTIFICATION_H #include "BaseView.h" -#define NO_LCD_TEST_CONNECT 0 namespace OHOS { UIViewGroup *CreateDeviceBindingView(void); UIViewGroup *CreateDeviceUnBindingView(void); - UIViewGroup * CreateDeviceUnbindingRequestGroupView(void); - + UIViewGroup *CreateDeviceUnbindingRequestGroupView(void); + void FreeDeviceBindingView(void); void FreeDeviceUnBindingView(void); void FreeDeviceUnbindingRequestGroupView(void); @@ -27,20 +26,15 @@ namespace OHOS void SetDeviceName(char *Name); char *GetDeviceName(); void DeviceUnBindingViewIsVisible(bool state); - #if NO_LCD_TEST_CONNECT - void Pairing_StartTimer(uint32_t interval = 1000*5); - #else - void Pairing_StartTimer(uint32_t interval = 1000*30); - #endif - + void Pairing_StartTimer(uint32_t interval = 1000 * 40); void Pairing_StopTimer(void); char DeviceName[50]; + private: PairingViewEventListener(); ~PairingViewEventListener(); PairingViewEventListener(const PairingViewEventListener &) = delete; const PairingViewEventListener &operator=(const PairingViewEventListener &) = delete; - }; } 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 56ead691c..fac9a6c3d 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 @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-22 10:04:36 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-07 17:28:10 + * @LastEditTime: 2024-09-11 17:27:05 * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp */ #include "notification_manager.h" @@ -356,11 +356,9 @@ namespace OHOS DeviceBindingScrollView->Add(DeviceBindingButtonCancel); DeviceBindingScrollView->Add(DeviceBindingButtonOK); DeviceBindingView->Add(DeviceBindingScrollView); -#if NO_LCD_TEST_CONNECT - PairingViewEventListener::GetInstance().Pairing_StartTimer(); -#endif } + //震动一次 if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get())) { ui_api_vibrate_once_func(); @@ -368,6 +366,8 @@ namespace OHOS ScreenTurnOn(40 * 1000); // 亮屏操作 40秒关闭 + PairingViewEventListener::GetInstance().Pairing_StartTimer(); //开启一个40s后弹窗自动销毁定时器 + NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeDeviceBindingView); return DeviceBindingView; } @@ -528,6 +528,8 @@ namespace OHOS } ScreenTurnOn(40 * 1000); // 亮屏操作 40秒关闭 + + PairingViewEventListener::GetInstance().Pairing_StartTimer(); //开启一个40s后弹窗自动销毁定时器 /* -------------------------------------------------------------------------- */ NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeDeviceUnBindingView); @@ -723,6 +725,7 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[FreeDeviceBindingView]"); if (DeviceBindingView != nullptr) { + PairingViewEventListener::GetInstance().Pairing_StopTimer(); DeviceBindingView->RemoveAll(); if (DeviceBindingScrollView != nullptr) { @@ -772,6 +775,7 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[FreeDeviceUnBindingView]"); if (DeviceUnBindingView != nullptr) { + PairingViewEventListener::GetInstance().Pairing_StopTimer(); DeviceUnBindingView->RemoveAll(); if (DeviceUnBindingScrollView != nullptr) { @@ -873,20 +877,7 @@ namespace OHOS static void Pairing_TimerCallbackProc(int data) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Pairing_TimerCallbackProc"); -#ifdef SUPPORT_BLE_SERVICE -#if NO_LCD_TEST_CONNECT - comfirmPaire(1); -#else - comfirmPaire(0); -#endif -#endif - if (NotificationManager::GetInstance()->GetShowingNotifyId() == TOPIC_EVENT_DEVICE_BIND && - NotificationManager::GetInstance()->HasNotifyShowing() == true) - { - NotificationManager::GetInstance()->StopNotify(); - } - - PairingViewEventListener::GetInstance().Pairing_StopTimer(); + NotificationManager::GetInstance()->StopNotify(); } /* @@ -936,7 +927,6 @@ namespace OHOS g_timer = NULL; return; } - uapi_setScreenDuration(interval); return; } @@ -948,6 +938,7 @@ namespace OHOS // 检查定时器是否存在 if (g_timer != NULL) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PairingViewEventListener::Pairing_StopTimer"); osTimerStop(g_timer); // 删除定时器并置为 NULL osStatus_t ret = osTimerDelete(g_timer); diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_CARDSET.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_CARDSET.bin new file mode 100644 index 000000000..f6e18a430 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_CARDSET.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08d22199c7c676b3d3cbafd12e2ca592e7a3d71b9aeb3690bc2c38d847fd72e9 +size 2840 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_CHANGEDIAL.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_CHANGEDIAL.bin new file mode 100644 index 000000000..d78f67d69 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_CHANGEDIAL.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5b68c70a7016cc450caad216afaf57ab41f8eb5907781a14e5793c5e198c4b5 +size 2840 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_DISTURB.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_DISTURB.bin new file mode 100644 index 000000000..73e56e613 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_DISTURB.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cba3f1f44c87e787011f0e6b223a222697020bc740a618cbf996bf0ebdf22dc5 +size 2840 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_SAVEELE.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_SAVEELE.bin new file mode 100644 index 000000000..8c5437bcb --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_SAVEELE.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac7ad9f9f2a993d6596a88bb7468bf9e54f995b6733794b31e88d93ad4c28e06 +size 2840 -- 2.17.1