修改defult表盘
authorCaisking <3449750381@qq.com>
Mon, 8 Apr 2024 09:31:15 +0000 (17:31 +0800)
committerCaisking <3449750381@qq.com>
Mon, 8 Apr 2024 09:31:15 +0000 (17:31 +0800)
code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h
code/sdk/application/wearable/fd230app/nativeui/clock/src/MainClockView.cpp
code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp

index bd5bc82..8da3798 100644 (file)
@@ -62,7 +62,7 @@ namespace OHOS
 #define APP_DIAL_PATH "/user/dial"
     /* ---------------------------------- 卡片管理 --------------------------------- */
     static constexpr const char *CARD_CONFIG_PATH = "/user/cardconfig.bin";
-    static constexpr const char *DEFAULT_DIAL_PATH = APP_RES_PATH "KUMI.bin";
+    static constexpr const char *DEFAULT_DIAL_PATH = APP_RES_PATH "/KUMI.bin";
     static constexpr const char *PNG_SET_CARD_ADD = APP_RES_PATH "/MainCard/CARD_ADD.bin";
     static constexpr const char *PNG_SET_CARD_DEL = APP_RES_PATH "/MainCard/CARD_DEL.bin";
     static constexpr const char *PNG_SET_CARD_HEART = APP_RES_PATH "/MainCard/HeartCrad.bin";
index 974434b..f720ce0 100644 (file)
@@ -109,6 +109,7 @@ namespace OHOS
 
     void MainClockView::InitStepValue()
     {
+#if 0
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue");
         uint32_t stepValue;
         int weekToday = ActivityModel::GetInstance()->GetWeekToday();
@@ -128,6 +129,7 @@ namespace OHOS
         stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::RELEASED);
         stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::PRESSED);
         stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::INACTIVE);
+#endif
     }
 
     bool MainClockView::InitLabelView(void)
@@ -187,6 +189,7 @@ namespace OHOS
 
     bool MainClockView::InitCenterCircleView(void)
     {
+#if 0
         bigCircle = new Image();
         if (bigCircle == nullptr)
         {
@@ -219,11 +222,13 @@ namespace OHOS
         {
             return false;
         }
+#endif
         return true;
     }
 
     bool MainClockView::InitHandView(void)
     {
+#if 0
         secondHand = new Image();
         if (secondHand == nullptr)
         {
@@ -266,11 +271,13 @@ namespace OHOS
         {
             return false;
         }
+#endif
         return true;
     }
 
     bool MainClockView::LoadClockImage(Image *view, uint32_t resId)
     {
+#if 0
         std::string file = CLOCK_IAMGES;
         ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId, file);
         if (image == nullptr)
@@ -279,11 +286,13 @@ namespace OHOS
             return false;
         }
         view->SetSrc(image);
+#endif
         return true;
     }
 
     bool MainClockView::LoadClockImage(UIImageView *view, uint32_t resId)
     {
+#if 0
         std::string file = CLOCK_IAMGES;
         ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId, file);
         if (image == nullptr)
@@ -292,6 +301,7 @@ namespace OHOS
             return false;
         }
         view->SetSrc(image);
+#endif
         return true;
     }
 
@@ -383,7 +393,7 @@ namespace OHOS
         {
             return false;
         }
-
+#if 0
         mainSweepClock->Add(curFace);
         mainSweepClock->Add(stepLabel);
         mainSweepClock->Add(heartRate);
@@ -414,20 +424,24 @@ namespace OHOS
         mainSweepClock->SetInitTime24Hour(0, 0, 0);
         mainSweepClock->SetWorkMode(UISweepClock::WorkMode::NORMAL);
         InitDateTime();
+#endif
         SetCoverable(true);
         return true;
     }
 
     void MainClockView::RefreshStep(int step)
     {
+#if 0
         char stepChar[STEP_CHAR_NUM] = {0};
 
         (void)sprintf_s(stepChar, STEP_CHAR_NUM, "%d", step);
         stepLabel->SetText(stepChar);
+#endif
     }
 
     void MainClockView::RefreshHeartRate(int value)
     {
+#if 0
         if (value == 0)
         {
             heartRateLabel->SetText("--");
@@ -437,6 +451,7 @@ namespace OHOS
 
         (void)sprintf_s(heartRateChar, STEP_CHAR_NUM, "%d", value);
         heartRateLabel->SetText(heartRateChar);
+#endif
     }
 
     void MainClockView::InitDateTime(void)
index aa8af4c..7c5fe66 100644 (file)
@@ -319,6 +319,7 @@ namespace OHOS
     {
         DialViewGroup *dial = new DialViewGroup();
         dial->SetDial(setting.dialFullName);
+        // dial->SetDial(DEFAULT_DIAL_PATH);
         return dial;
     }
     UICardPage *MainViewSample::InitWathDial(DialSetting &setting)
@@ -327,9 +328,7 @@ namespace OHOS
         {
         case DIAL_CLOCK:
         {
-            DialViewGroup *dial = new DialViewGroup();
-            dial->SetDial(DEFAULT_DIAL_PATH);
-            return dial;
+            return new MainClockView();
         }
         break; // 添加 break 语句
         default:
@@ -347,7 +346,6 @@ namespace OHOS
         {
             mainClockView = InitWathDial(setting);
         }
-
         if (mainClockView == nullptr)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView new fail");