From: penglei <1624952103@qq.com> Date: Tue, 3 Dec 2024 08:32:10 +0000 (+0800) Subject: 优化debug电池信息ui显示 X-Git-Tag: fd230_release_V1.3.102~3^2~8^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=6036a7f93f255f2f1cef1528068e11a03fa39385;p=mirrors%2FFD230.git 优化debug电池信息ui显示 --- diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp index 1e1837cd5..0bf26fa02 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp @@ -495,8 +495,6 @@ namespace OHOS if(get_battery_percent_flag == 1) { - nextorprepageLabelButton->SetText("第二页"); - get_battery_percent_flag = 2; if(len >= 120) { index = 60; @@ -509,8 +507,6 @@ namespace OHOS } else if(get_battery_percent_flag == 2) { - nextorprepageLabelButton->SetText("第三页"); - get_battery_percent_flag = 3; if(len >= 120) index = 120; else @@ -518,10 +514,8 @@ namespace OHOS } else { - nextorprepageLabelButton->SetText("第一页"); - get_battery_percent_flag = 1; if(len >= 60) - len = 90; + len = 60; } for(int i = index; i < len; i++) { @@ -555,6 +549,7 @@ namespace OHOS <<", ["<(data[i].percent) << "%\n"; + // << static_cast(i) << "%\n"; result += oss.str(); // result += std::to_string(i*10) + " min , " + std::to_string(data[i].voltage) + "V , "+ std::to_string(data[i].percent) + "%" + "\n"; @@ -821,6 +816,22 @@ namespace OHOS // std::string str; viewIndex = GetCurViewIndex(); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"111111 viewIndex : %d",viewIndex); + + if(get_battery_percent_flag == 1) + { + nextorprepageLabelButton->SetText("第三页"); + get_battery_percent_flag = 2; + } + else if(get_battery_percent_flag == 2) + { + nextorprepageLabelButton->SetText("第一页"); + get_battery_percent_flag = 3; + } + else + { + nextorprepageLabelButton->SetText("第二页"); + get_battery_percent_flag = 1; + } // if(nextorprepageLabelButton) // { // if(get_battery_percent_flag == 0) @@ -1060,6 +1071,7 @@ namespace OHOS delete nextorprepageLabelButton; nextorprepageLabelButton = nullptr; + get_battery_percent_flag = 0; delete toggleButtonOffline; toggleButtonOffline = nullptr; @@ -1145,7 +1157,7 @@ namespace OHOS nextorprepageLabelButton->Resize(100, 100); nextorprepageLabelButton->SetViewId(NEXTORPREPAGELABELBUTTON); nextorprepageLabelButton->SetStyle(STYLE_BACKGROUND_COLOR, Color::Blue().full); - nextorprepageLabelButton->SetText("下一页"); + nextorprepageLabelButton->SetText("第一页"); nextorprepageLabelButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 30); nextorprepageLabelButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffff0000, UIButton::PRESSED); nextorprepageLabelButton->SetVisible(false);