Code review from 罗正
* refs/changes/962/head: (18 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上设计保持一致
- 优化弧形列表,调整应用之间间隔,调整文字对齐为左对齐
- Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/
64191456b9581d62e8f81ac0/FD230 into sdk602patch0626
- Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/
64191456b9581d62e8f81ac0/FD230 into sdk602patch0626
- #663,解决:手表,APP开启消息提醒后,手表喝水提醒不弹窗bug
- Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/
64191456b9581d62e8f81ac0/FD230 into sdk602patch0626
- #644,解决,计时器显示问题bug
#645,解决, 计时器显示错误bug
- Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/
64191456b9581d62e8f81ac0/FD230 into sdk602patch0626
- #661,解决,手表,天气天气图标显示多云,文字显示中雨bug
Signed-off-by: 罗正 <1732036298@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/962
* @Author: luozheng 1732036298@qq.com\r
* @Date: 2024-04-07 18:15:53\r
* @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-09-07 17:12:44\r
+ * @LastEditTime: 2024-09-13 09:41:37\r
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/countdown/src/CountDownModel.cpp\r
*/\r
#include "countdown/include/CountDownModel.h"\r
*/\r
int CountDownModel::StopRingtonePlaybackAndReleaseResources(void)\r
{\r
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CountDownModel::StopRingtonePlaybackAndReleaseResources");\r
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CountDownModel::StopRingtonePlaybackAndReleaseResources");\r
int32_t ret = 0;\r
int32_t state = 0;\r
AudioManager &amIntance = AudioManager::GetInstance();\r
CountDownModel::GetInstance()->SetRingTime(timePicker->GetSelectValue()); // 设置响铃时间\r
}\r
\r
- if (strcmp(CountDownModel::GetInstance()->GetCountDownTime().c_str(), "00:00:00") == 0)\r
+ if (strcmp(CountDownModel::GetInstance()->GetCountDownTime().c_str(), "00:00:00") == 0) // 如果自定义时间设置为0\r
{\r
p_MainCountDownView->ChangeView(TIMECONFIG_COUNTDOWN, COUNTDOWN_TIMENOTNULL);\r
return true;\r
}\r
else\r
{\r
- if (p_MainCountDownView->GetStartCountDownView() != nullptr)\r
+ p_MainCountDownView->ChangeView(TIMECONFIG_COUNTDOWN, START_COUNTDOWN);\r
+ if (p_StartCountDownView != nullptr)\r
{\r
- p_MainCountDownView->GetStartCountDownView()->GetShowCountDownTimelabel()->SetText(CountDownModel::GetInstance()->GetCountDownTime().c_str());\r
- p_MainCountDownView->GetStartCountDownView()->GetShowTheRingTimelabel()->SetText(CountDownModel::GetInstance()->GetRingTime().c_str());\r
- p_MainCountDownView->GetStartCountDownView()->GetPlayOrPauseToggleButton()->SetVisible(true);\r
- p_MainCountDownView->GetStartCountDownView()->GetRepeatButton()->SetVisible(false);\r
+ std::string CountDownTime = CountDownModel::GetInstance()->GetCountDownTime();\r
+ std::string RingTime = CountDownModel::GetInstance()->GetRingTime();\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CountDownTime = %s RingTime = %s", CountDownTime.c_str(),RingTime.c_str());\r
+ p_StartCountDownView->GetShowCountDownTimelabel()->SetText(CountDownTime.c_str());\r
+ p_StartCountDownView->GetShowTheRingTimelabel()->SetText(RingTime.c_str());\r
+ p_StartCountDownView->GetPlayOrPauseToggleButton()->SetVisible(true);\r
+ p_StartCountDownView->GetRepeatButton()->SetVisible(false);\r
}\r
\r
- p_MainCountDownView->ChangeView(TIMECONFIG_COUNTDOWN, START_COUNTDOWN);\r
return true;\r
}\r
}\r
CountDownModel::GetInstance()->SetCountDownTime("00:00:00");\r
CountDownModel::GetInstance()->SetRingTime("00:00:00");\r
CountDownModel::GetInstance()->StopRingtonePlaybackAndReleaseResources();\r
- MainCountDownView::GetInstance()->GetStartCountDownView()->GetPlayOrPauseToggleButton()->SetTouchable(true);\r
- MainCountDownView::GetInstance()->GetStartCountDownView()->GetPlayOrPauseToggleButton()->SetState(false);\r
+ p_StartCountDownView->GetPlayOrPauseToggleButton()->SetTouchable(true);\r
+ p_StartCountDownView->GetPlayOrPauseToggleButton()->SetState(false);\r
p_MainCountDownView->ChangeView(START_COUNTDOWN, MAIN_COUNTDOWN);\r
+ p_StartCountDownView->ShowEndView(false);\r
\r
return true;\r
}\r
button->SetLabelPosition(0, 61);\r
button->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);\r
button->SetStyle(STYLE_LINE_HEIGHT, 35);\r
- button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffa800, UIButton::PRESSED);\r
+ button->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);\r
button->SetStyleForState(STYLE_BORDER_RADIUS, 50, UIButton::PRESSED);\r
return button;\r
}\r
\r
+ //获取开始倒计时视图\r
StartCountDownView *MainCountDownView::GetStartCountDownView(void)\r
{\r
return p_StartCountDownView;\r
\r
vectorbigImage->SetVisible(state);\r
showTheEndRingTime->SetVisible(state);\r
+ showTheEndRingTime->SetText(showTheRingTime->GetText());\r
}\r
void StartCountDownView::UpdateimageAndLabelPosition(void)\r
{\r
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-04-08 18:40:20
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-07-23 14:41:27
+ * @LastEditTime: 2024-09-13 10:25:12
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h
*/
#ifndef WEATHER_MODEL_H
/* -------------------------------------------------------------------------- */
void UpdateMainWeatherData(void);
void UpdateWeatherCurTime(void);
+ /* -------------------------------------------------------------------------- */
+ bool IsNightTime();
private:
WeatherModel();
WeatherModel(const WeatherModel &) = delete;
/*
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-04-08 18:40:09
- * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-08-28 17:12:21
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-09-13 10:43:56
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp
*/
#include "weather/include/WeatherModel.h"
#include "weather/include/WeatherControlView.h"
#include "DialModelWeather.h"
#include "DialModelWeatherStr.h"
+#include "ConfigModel.h"
namespace OHOS
{
#if __cplusplus
return weatherTime;
}
+ //判断当前时间是否在晚上
+ bool WeatherModel::IsNightTime()
+ {
+ struct tm pTM;
+ time_t seconds;
+ time(&seconds);
+ localtime_r(&seconds, &pTM);
+
+ int hour = pTM.tm_hour;
+
+ // 假设晚上是从 18 点到次日 6 点
+ return hour >= 18 || hour < 6;
+ }
+
// 获取天气图片
std::string WeatherModel::GetWeatherImage()
{
// int index = Weather_data_t_now.iconNight;//夜晚天气图标
- int index = Weather_data_seven_data[0].iconDay; // 白天天气图标
+ int index;
+ if (IsNightTime())
+ {
+ index = Weather_data_t_now.iconNight; // 夜晚天气图标
+ }
+ else
+ {
+ index = Weather_data_seven_data[0].iconDay; // 白天天气图标
+ }
return weather65x65[index];
}
// 获取天气描述
std::string WeatherModel::GetWeatherDescription()
{
- std::string WeatherDescription = Weather_data_t_now.textNight;
+ std::string WeatherDescription;
+ if (IsNightTime())
+ {
+ WeatherDescription = Weather_data_t_now.textNight;
+ }
+ else
+ {
+ WeatherDescription = Weather_data_seven_data[0].textDay;
+ }
return WeatherDescription;
}
{
int maxtemperature = Weather_data_seven_data[0].tempMax;
int mintemperature = Weather_data_seven_data[0].tempMin;
- std::string MaxandMinTemperature = "最高" + std::to_string(maxtemperature) + "°" + " " + "最低" + std::to_string(mintemperature) + "°";
+ int language = ConfigModel::GetInstance()->GetLanguage();
+ std::string MaxandMinTemperature;
+ if (language == 0) // 如果系统语言为中文
+ {
+ MaxandMinTemperature = "最高" + std::to_string(maxtemperature) + "°" + " " + "最低" + std::to_string(mintemperature) + "°";
+ }
+ else
+ {
+ MaxandMinTemperature = "Max" + std::to_string(maxtemperature) + "°" + " " + "Min" + std::to_string(mintemperature) + "°";
+ }
return MaxandMinTemperature;
}
/* -------------------------------------------------------------------------- */
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "p_WeatherControlView");
p_WeatherControlView->UpdateWeatherControlViewVisibility();
}
- if(DialModelWeather::GetInstance()){
- DialModelWeather::GetInstance()->UpdateWeather(Weather_data_seven_data[0].iconDay); //更新主界面天气图标
+ if (DialModelWeather::GetInstance())
+ {
+ DialModelWeather::GetInstance()->UpdateWeather(Weather_data_seven_data[0].iconDay); // 更新主界面天气图标
// const std::string str = GetWeatherTemperature() + " "+GetWeatherDescription();
const std::string str = GetWeatherTemperature();
DialModelWeatherStr::GetInstance()->UpdateWeatherStr(str);
}
-
}
/*更新天气界面的时间显示*/
#endif
{TOPIC_EVENT_FIND_WATCH,PRIORITY_TWO},// 找手表 [2]
{TOPIC_EVENT_CANCEL_FIND_WATCH,PRIORITY_TWO},// 取消找手表 [2]
- {TOPIC_EVENT_DRINKREMINDER,PRIORITY_THREE},//喝水提醒 [3]
+ {TOPIC_EVENT_DRINKREMINDER,PRIORITY_TWO},//喝水提醒 [2]
{TOPIC_EVENT_MESSAGENOTE,PRIORITY_THREE},//消息提醒 [3]
{TOPIC_EVENT_MESSAGE_UPDATA,PRIORITY_TWO},//消息更新提醒 [3]
{TOPIC_EVENT_SLEEPNOTE,PRIORITY_THREE},//睡眠弹窗 [3]
// unused(topic);
unused(req);
WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyDrinkReminderProc !");
- DrinkReminderViewEventListener::GetInstance().set_screen_on_and_vibration();
+ // DrinkReminderViewEventListener::GetInstance().set_screen_on_and_vibration();
if (CheckPriority(topic))
{
NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
#include <custom_utils.h>
#include "vibrator_service.h"
#include "../../../../../../../drivers/peripheral/utils/custom_runtime.h"
-
+#include <ui_service.h>
+#include "../../../../../../drivers/peripheral/vibrator/service/vibrator_service.h"
namespace OHOS
{
DrinkReminderGroupView->Add(DrinkReminderButton);
DrinkReminderGroupView->Add(DrinkReminderLabel);
+ /* -------------------------------------------------------------------------- */
+ if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
+ {
+ ui_api_vibrate_once_func(); // 震动一次
+ }
+
+ ScreenTurnOn(10 * 1000); // 亮屏操作 10秒关闭
+ /* -------------------------------------------------------------------------- */
+
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Create DrinkReminderView succeed!!");
}