取消w9和n9的默认表盘配置 1945/1 1945/head 1946/target/1
authorCaisking <Casiking@zhihuishixun.com>
Wed, 9 Jul 2025 09:47:41 +0000 (17:47 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Wed, 9 Jul 2025 09:47:41 +0000 (17:47 +0800)
code/sdk/application/wearable/fd230app/nativeui/clock/src/MainClockView.cpp

index 183b33d..9a67851 100644 (file)
@@ -401,14 +401,12 @@ namespace OHOS
     */
     bool MainClockView::InitBatteryView(BatteryDisplayType type)
     {
-        #if !(defined(BOARD_W9) || defined(BOARD_N9))// N9和W9需要显示电池
         // 不显示电池 icon
         if (type == BATTERY_DISPLAY_NONE)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "no show battery");
             return false;
         }
-        #endif
 
         // 创建电池框图像
         batteryiamge = new UIImageView();
@@ -584,13 +582,11 @@ namespace OHOS
         struct tm local_time = {0};  
         time_t seconds = time(nullptr);  
 
-        // Get local time  
         if (localtime_r(&seconds, &local_time) == nullptr) {  
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get localtime error!");  
             return;  
         }  
 
-        // Extract hour and minute  
         uint8_t hour = local_time.tm_hour % HOURS_IN_DAY;
         uint8_t minute = local_time.tm_min % MINUTES_IN_HOUR;
         char timebuf[64] = {0};  
@@ -610,11 +606,10 @@ namespace OHOS
             sprintf_s(timebuf, sizeof(timebuf), "%02d:%02d", hour, minute);
         #endif  
 
-        // Update display labels  
         if (timerlabel != nullptr)  
             timerlabel->SetText(timebuf);  
 
-        // Update date and week day  
+        
         std::string weekStr = Cnweekdays[local_time.tm_wday];  
         std::string dateStr = std::to_string(local_time.tm_mon + 1) + "月" +  
                             std::to_string(local_time.tm_mday) + "号 " + weekStr;  
@@ -622,11 +617,11 @@ namespace OHOS
         if (datelabel != nullptr)  
             datelabel->SetText(dateStr.c_str());  
 
-        // Update battery status  
-        #if !(defined(BOARD_W9) || defined(BOARD_N9))// N9和W9需要显示电池
+
+        //电量显示配置
         if (batterySetting == BATTERY_DISPLAY_NONE)  
             return;  
-        #endif
+     
 
         UpdateBatteryColor();