From 0dfd785784d0610220f4d088004f15ae26700a60 Mon Sep 17 00:00:00 2001 From: tongkai0808fh Date: Tue, 7 May 2024 02:39:39 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9launcher/launcher/src/main/cp?= =?UTF-8?q?p/time=5Fweather=5Fview.cpp=E6=96=87=E4=BB=B6=EF=BC=8C=E6=B6=88?= =?UTF-8?q?=E9=99=A4=E5=87=BD=E6=95=B0=E8=A1=8C=E6=95=B0=E8=BF=87=E5=A4=9A?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=20=E4=BF=AE=E6=94=B9TimeWeatherView::SetUpTi?= =?UTF-8?q?meView=E5=87=BD=E6=95=B0=E5=86=85=E5=AE=B9=EF=BC=8C=E6=B6=88?= =?UTF-8?q?=E9=99=A4=E5=87=BD=E6=95=B0=E8=A1=8C=E6=95=B0=E8=BF=87=E5=A4=9A?= =?UTF-8?q?=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tongkai0808fh --- .../src/main/cpp/time_weather_view.cpp | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/launcher/launcher/src/main/cpp/time_weather_view.cpp b/launcher/launcher/src/main/cpp/time_weather_view.cpp index 2d6699e..c855bde 100755 --- a/launcher/launcher/src/main/cpp/time_weather_view.cpp +++ b/launcher/launcher/src/main/cpp/time_weather_view.cpp @@ -63,22 +63,14 @@ void TimeWeatherView::SetUpTimeView() const int16_t commonYear = 1970; time_t t = time(nullptr); struct tm* st = localtime(&t); - if (st == nullptr) { - return; - } + if (st == nullptr) { return; } int ret = sprintf_s(hour_min, sizeof(hour_min), "%02d : %02d", st->tm_hour, st->tm_min); - if (ret == LAUNCHER_PARAMERROR) { - return; - } + if (ret == LAUNCHER_PARAMERROR) { return; } ret = sprintf_s(mont_day, sizeof(mont_day), "%02d月%02d日", st->tm_mon + january, st->tm_mday); - if (ret == LAUNCHER_PARAMERROR) { - return; - } + if (ret == LAUNCHER_PARAMERROR) { return; } GetWeekdayByYearday(st->tm_year + commonYear, st->tm_mon + january, st->tm_mday, week_day, sizeof(week_day)); ret = sprintf_s(date, sizeof(date), "%s %s", mont_day, week_day); - if (ret == LAUNCHER_PARAMERROR) { - return; - } + if (ret == LAUNCHER_PARAMERROR) { return; } if (viewTime_ == nullptr) { viewTime_ = new UIViewGroup(); viewTime_->SetPosition(BLANK_TW, BLANK_H, viewGroup_->GetWidth() - BLANK_W, @@ -111,13 +103,9 @@ void TimeWeatherView::SetUpTimeView() } else { UILabel* label = nullptr; label = static_cast(viewTime_->GetChildById("labletime")); - if (label) { - label->SetText(hour_min); - } + if (label) { label->SetText(hour_min); } label = static_cast(viewTime_->GetChildById("labledate")); - if (label) { - label->SetText(date); - } + if (label) { label->SetText(date); } viewTime_->Invalidate(); } }