From 6036a7f93f255f2f1cef1528068e11a03fa39385 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Tue, 3 Dec 2024 16:32:10 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96debug=E7=94=B5=E6=B1=A0?= =?utf8?q?=E4=BF=A1=E6=81=AFui=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../debug_output_notification.cpp | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) 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); -- 2.17.1