* @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