实现表盘切换
authorCaisking <3449750381@qq.com>
Fri, 12 Jan 2024 08:01:22 +0000 (16:01 +0800)
committerCaisking <3449750381@qq.com>
Fri, 12 Jan 2024 08:01:22 +0000 (16:01 +0800)
21 files changed:
code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h
code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp
code/sdk/application/wearable/nativeapp/nativeui/clock/src/MainClockView.cpp
code/sdk/application/wearable/nativeapp/nativeui/dial/include/DialPresenter.h
code/sdk/application/wearable/nativeapp/nativeui/dial/include/DialView.h
code/sdk/application/wearable/nativeapp/nativeui/dial/include/Digital_clockView.h
code/sdk/application/wearable/nativeapp/nativeui/dial/src/DialPresenter.cpp
code/sdk/application/wearable/nativeapp/nativeui/dial/src/DialView.cpp
code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp
code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp
code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h
code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp
code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/KUMI.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/flowerbud.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/maliao.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/maomao.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/momo.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/default.json [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/maliao.json
code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_image_view.cpp

index af94125..1b969e5 100755 (executable)
@@ -55,7 +55,7 @@ public:
     void InitBloodErrorSlice(void);\r
     void InitBloodNoteSlice(void);\r
        void InitDialSlice(void);\r
-\r
+    \r
     void InitHeartRemindSlice(void);\r
        void InitPhoneSlice(void);\r
        void InitPhoneCallSlice(void);\r
index 26265f6..74cf394 100755 (executable)
@@ -21,7 +21,7 @@ namespace OHOS
 {\r
  const AppItem g_nativeAppList[] = {\r
     {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "系统设置", nullptr},\r
-    {VIEW_DIGITAL, PNG_APPLIST_DIAL_IMAGE, PNG_APPLIST_DIAL_IMAGE, "表盘设置", nullptr},\r
+    {VIEW_DIAL, PNG_APPLIST_DIAL_IMAGE, PNG_APPLIST_DIAL_IMAGE, "表盘设置", nullptr},\r
     {VIEW_COMPASS, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_COMPASS_IMAGE, "指南针", nullptr},\r
     {VIEW_WEATHER, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_WEATHER_IMAGE, "天气", nullptr},\r
     {VIEW_MUSIC, PNG_APPLIST_MUSIC_IMAGE, PNG_APPLIST_MUSIC_IMAGE, "音乐", nullptr},\r
index c93c7ee..31179d2 100755 (executable)
@@ -12,7 +12,6 @@
 #include "ui_resource_image.h"\r
 #include "common/image_cache_manager.h"\r
 #include <time.h>\r
-\r
 namespace OHOS\r
 {\r
     static MainClockView *g_pMainClockView = nullptr;\r
@@ -112,24 +111,26 @@ namespace OHOS
 \r
     void MainClockView::InitStepValue()\r
     {\r
-#if 0\r
-    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue");\r
-    uint32_t stepValue;\r
-    int weekToday = ActivityModel::GetInstance()->GetWeekToday();\r
-    ActivityModel::GetInstance()->GetStepData((StepDataDistribute)weekToday, &stepValue);\r
-    char stepChar[STEP_CHAR_NUM] = {0};\r
-    if (sprintf_s(stepChar, STEP_CHAR_NUM, "%d", stepValue) == -1) {\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue error");\r
-        return;\r
-    }\r
-    if (stepLabel == nullptr) {\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue nullptr");\r
-        return;\r
-    }\r
-    stepLabel->SetText(stepChar);\r
-    stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::RELEASED);\r
-    stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::PRESSED);\r
-    stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::INACTIVE);\r
+#if 1\r
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue");\r
+        uint32_t stepValue;\r
+        int weekToday = ActivityModel::GetInstance()->GetWeekToday();\r
+        ActivityModel::GetInstance()->GetStepData((StepDataDistribute)weekToday, &stepValue);\r
+        char stepChar[STEP_CHAR_NUM] = {0};\r
+        if (sprintf_s(stepChar, STEP_CHAR_NUM, "%d", stepValue) == -1)\r
+        {\r
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue error");\r
+            return;\r
+        }\r
+        if (stepLabel == nullptr)\r
+        {\r
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue nullptr");\r
+            return;\r
+        }\r
+        stepLabel->SetText(stepChar);\r
+        stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::RELEASED);\r
+        stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::PRESSED);\r
+        stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::INACTIVE);\r
 #endif\r
     }\r
 \r
@@ -194,7 +195,7 @@ namespace OHOS
 \r
     bool MainClockView::InitCenterCircleView(void)\r
     {\r
-#if 0\r
+#if 1\r
         bigCircle = new Image();\r
         if (bigCircle == nullptr)\r
         {\r
@@ -316,14 +317,13 @@ namespace OHOS
         }\r
         curFace->SetPosition(0, 0);\r
 \r
-        \r
         if (LoadClockImage(curFace, CLOCK_MAIN_FACE_IMAGE) == false)\r
         {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "curFace LoadClockImage CLOCK_MAIN_FACE_IMAGE fail");\r
             return false;\r
         }\r
 \r
-#if 0\r
+#if 1\r
         if (InitLabelView() == false)\r
         {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLabelView() fail");\r
@@ -401,7 +401,6 @@ namespace OHOS
             return false;\r
         }\r
 \r
-\r
         // UIView::OnLongPressListener* longPressListener = (UIView::OnLongPressListener*)OHOS::MainPresenterSample::GetInstance();\r
         // mainSweepClock->SetOnLongPressListener(longPressListener);\r
 \r
@@ -412,15 +411,14 @@ namespace OHOS
 \r
         mainSweepClock->Add(button1_);\r
         mainSweepClock->Add(curFace);\r
-        /*\r
-            mainSweepClock->Add(stepLabel);\r
-            mainSweepClock->Add(heartRate);\r
-            mainSweepClock->Add(weekLabel);\r
-            mainSweepClock->Add(heartRateLabel);\r
-            mainSweepClock->Add(weekDay);\r
-            mainSweepClock->Add(progress);\r
-            mainSweepClock->Add(batteryLabel);\r
-        */\r
+\r
+        mainSweepClock->Add(stepLabel);\r
+        mainSweepClock->Add(heartRate);\r
+        mainSweepClock->Add(weekLabel);\r
+        mainSweepClock->Add(heartRateLabel);\r
+        mainSweepClock->Add(weekDay);\r
+        mainSweepClock->Add(progress);\r
+        mainSweepClock->Add(batteryLabel);\r
 \r
         Add(mainSweepClock);\r
 \r
@@ -465,7 +463,7 @@ namespace OHOS
 \r
     void MainClockView::RefreshStep(int step)\r
     {\r
-#if 0\r
+#if 1\r
         char stepChar[STEP_CHAR_NUM] = {0};\r
 \r
         (void)sprintf_s(stepChar, STEP_CHAR_NUM, "%d", step);\r
@@ -475,7 +473,7 @@ namespace OHOS
 \r
     void MainClockView::RefreshHeartRate(int value)\r
     {\r
-#if 0\r
+#if 1\r
         if (value == 0)\r
         {\r
             heartRateLabel->SetText("--");\r
index bf688dc..09b2bc0 100755 (executable)
@@ -3,14 +3,15 @@
 \r
 #include "Presenter.h"\r
 #include "DialView.h"\r
+#include "dial/include/Digital_clockView.h"\r
 \r
 namespace OHOS\r
 {\r
     class DialView;\r
 \r
     class DialPresenter : public Presenter<DialView>,\r
-                               public UIView::OnClickListener,\r
-                               public UIView::OnDragListener\r
+                          public UIView::OnClickListener,\r
+                          public UIView::OnDragListener\r
     {\r
     public:\r
         DialPresenter();\r
@@ -24,6 +25,7 @@ namespace OHOS
         static DialPresenter *GetInstance();\r
 \r
     private:\r
+        Digital_clockView *g_pDigital_clockView{nullptr};\r
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;\r
         bool OnClick(UIView &view, const ClickEvent &event) override;\r
         bool OnDrag(UIView &view, const DragEvent &event) override;\r
index ad03e96..8dd700d 100755 (executable)
@@ -1,3 +1,13 @@
+/*** \r
+ * @Author: Caisking 3449750381@qq.com\r
+ * @Date: 2024-01-11 18:56:47\r
+ * @LastEditors: Caisking 3449750381@qq.com\r
+ * @LastEditTime: 2024-01-12 15:12:59\r
+ * @FilePath: /1.FD230/FD230/code/sdk/application/wearable/nativeapp/nativeui/dial/include/DialView.h\r
+ * @Description: \r
+ * @\r
+ * @Copyright (c) 2024 by Caisking , All Rights Reserved. \r
+ */\r
 #ifndef _Dial_VIEW_H\r
 #define _Dial_VIEW_H\r
 \r
@@ -40,10 +50,11 @@ namespace OHOS
 \r
         UIViewGroup *container_ = nullptr;\r
         UIScrollView *scrollView1_ = nullptr;\r
+\r
+        UIButton *button5_ = nullptr;\r
+        UIButton *button4_ = nullptr;\r
         UIButton *button3_ = nullptr;\r
-        UIImageView *image2_ = nullptr;\r
         UIButton *button2_ = nullptr;\r
-        UIImageView *image1_ = nullptr;\r
         UIButton *button1_ = nullptr;\r
     };\r
 } // namespace OHOS\r
index 25e5347..60b6556 100644 (file)
@@ -31,6 +31,8 @@ extern uint8_t battery_get_voltage(float *voltage);
 
 namespace OHOS
 {
+
+#define CHANGEBUTTON "changebutton" // 切换表盘按键
     class SweepClockCallback : public AnimatorCallback
     {
     public:
@@ -216,22 +218,23 @@ namespace OHOS
         void FreeImagePathsArray(const char **imagePaths);
         const char **CreateImagePathsArray(const char *basePath, const char *fileExtension, int numImages);
         void addImageView(int left, int top, const char *imagePath, const char *viewId, int offsetX, int offsetY);
-
-        void Initbackground(); // 初始化背景
-        void Initpointer();    // 初始化表盘指针
-        void Initdigit();      // 初始化数字表盘
-        void Initdata();       // 初始化日期
-        void Initweek();       // 初始化星期
-        void Initbattery();    // 初始化电量
+        bool Initbackground();
+        bool Initpointer();
+        bool Initdigit();
+        bool Initdata();
+        bool Initweek();
+        bool Initbattery();
+        bool AddButton();
         void PreLoad(void) override;
         void UnLoad(void) override;
+
     private:
         TraingWinView *p_TraingWinView{nullptr};
         UIView::OnDragListener *draglistener{nullptr};
         Digital_clockView(Digital_clockView &&) = delete;
         Digital_clockView &operator=(Digital_clockView &&) = delete;
 
-        UIViewGroup *container_ = nullptr;
+        // UIViewGroup *container_ = nullptr;
         UIImageView *background = nullptr;
         UIImageView *hour1 = nullptr;
         UIImageView *hour2 = nullptr;
@@ -242,6 +245,7 @@ namespace OHOS
         UILabel *dateLable = nullptr;
         UILabel *weekLable = nullptr;
         UILabel *batteryLable = nullptr;
+        UIButton *changebutton = nullptr;
         UIBoxProgress *progress = nullptr;
         UISweepClock *sweepClock1_ = nullptr;
         UIImageAnimatorView *backgroundAnimator = nullptr;
@@ -258,7 +262,7 @@ namespace OHOS
         const char **imagePaths;
         std::string digitspath;
         std::string stringtime;
-        std::string JosnfilePath = "/user/res/clocks/KUMI.json";
+        std::string JosnfilePath = "/user/res/clocks/default.json";
     };
 } // namespace OHOS
 #endif // Digital_clock_PRESENTER_H
index acd7e9e..0cb1920 100755 (executable)
@@ -65,12 +65,43 @@ namespace OHOS
 \r
     bool DialPresenter::OnClick(UIView &view, const ClickEvent &event)\r
     {\r
-        // // 根据控件id查找是哪个控件触发了点击回调\r
-        // if (strcmp(view.GetViewId(), "labelButton1") == 0)\r
-        // {\r
-        //     NativeAbility::GetInstance().ChangeSlice(VIEW_BLOOD);\r
-        // }\r
-\r
+        // 根据控件id查找是哪个控件触发了点击回调\r
+        if (strcmp(view.GetViewId(), "kumibutton") == 0)\r
+        {\r
+            printf("join click\n");\r
+            const std::string jsonPath = "/user/res/clocks/KUMI.json";\r
+            g_pDigital_clockView->setJsonFilePath(jsonPath);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+        }\r
+        if (strcmp(view.GetViewId(), "flowerbudbutton") == 0)\r
+        {\r
+            printf("join click\n");\r
+            const std::string jsonPath = "/user/res/clocks/flowerbud.json";\r
+            g_pDigital_clockView->setJsonFilePath(jsonPath);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+        }\r
+        if (strcmp(view.GetViewId(), "maomaobutton") == 0)\r
+        {\r
+            printf("join click\n");\r
+            const std::string jsonPath = "/user/res/clocks/maomao.json";\r
+            g_pDigital_clockView->setJsonFilePath(jsonPath);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+        }\r
+        if (strcmp(view.GetViewId(), "momobutton") == 0)\r
+        {\r
+            printf("join click\n");\r
+            const std::string jsonPath = "/user/res/clocks/momo.json";\r
+            g_pDigital_clockView->setJsonFilePath(jsonPath);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+        }\r
+        if (strcmp(view.GetViewId(), "maliaobutton") == 0)\r
+        {\r
+            printf("join click\n");\r
+            const std::string jsonPath = "/user/res/clocks/maliao.json";\r
+            g_pDigital_clockView->setJsonFilePath(jsonPath);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE);\r
+        }\r
         return true;\r
     }\r
+\r
 }
\ No newline at end of file
index 32bf0c3..d8f36a0 100755 (executable)
@@ -53,28 +53,70 @@ namespace OHOS
         container_->Add(scrollView1_);\r
         scrollView1_->SetVisible(true);\r
 \r
+        // Add Button to App\r
+        if (button5_ == nullptr)\r
+        {\r
+            button5_ = new UIButton();\r
+        }\r
+        button5_->SetPosition(-480, 103);    // widget's left position and top position\r
+        button5_->Resize(260, 260);          // widget's width and height\r
+        button5_->SetViewId("maliaobutton"); // Set style\r
+        button5_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);\r
+        button5_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
+        // Set additional property\r
+        char *button5defaultImgSrc = "/user/res/clocks/Reducedgraph/maliao.bin";\r
+        char *button5triggeredImgSrc = nullptr;\r
+        button5_->SetImageSrc(button5defaultImgSrc, button5triggeredImgSrc);\r
+        button5_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);\r
+        button5_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
+\r
+        // Add the CallBack about events\r
+        UIView::OnClickListener *button5Click = static_cast<UIView::OnClickListener *>(DialPresenter::GetInstance());\r
+        button5_->SetOnClickListener(button5Click);\r
+        // Add to scrollView1\r
+        scrollView1_->Add(button5_);\r
+        button5_->SetVisible(true);\r
+\r
+        // Add Button to App\r
+        if (button4_ == nullptr)\r
+        {\r
+            button4_ = new UIButton();\r
+        }\r
+        button4_->SetPosition(680, 103);   // widget's left position and top position\r
+        button4_->Resize(260, 260);        // widget's width and height\r
+        button4_->SetViewId("momobutton"); // Set style\r
+        button4_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);\r
+        button4_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
+        // Set additional property\r
+        char *button4defaultImgSrc = "/user/res/clocks/Reducedgraph/momo.bin";\r
+        char *button4triggeredImgSrc = nullptr;\r
+        button4_->SetImageSrc(button4defaultImgSrc, button4triggeredImgSrc);\r
+        button4_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);\r
+        button4_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
+\r
+        // Add the CallBack about events\r
+        UIView::OnClickListener *button4Click = static_cast<UIView::OnClickListener *>(DialPresenter::GetInstance());\r
+        button4_->SetOnClickListener(button4Click);\r
+        // Add to scrollView1\r
+        scrollView1_->Add(button4_);\r
+        button4_->SetVisible(true);\r
+\r
         // Add Button to App\r
         if (button3_ == nullptr)\r
         {\r
             button3_ = new UIButton();\r
         }\r
-        button3_->SetPosition(390, 103); // widget's left position and top position\r
-        button3_->Resize(260, 260);      // widget's width and height\r
-        button3_->SetViewId("button3");  // Set style\r
+        button3_->SetPosition(390, 103);     // widget's left position and top position\r
+        button3_->Resize(260, 260);          // widget's width and height\r
+        button3_->SetViewId("maomaobutton"); // Set style\r
         button3_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);\r
         button3_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
-\r
         // Set additional property\r
-#ifdef _WIN32\r
-        char *button3defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Dial/dog.bin";\r
-#else\r
-        char *button3defaultImgSrc = "/user/res/Dial/dog.bin";\r
-#endif\r
+        char *button3defaultImgSrc = "/user/res/clocks/Reducedgraph/maomao.bin";\r
         char *button3triggeredImgSrc = nullptr;\r
         button3_->SetImageSrc(button3defaultImgSrc, button3triggeredImgSrc);\r
         button3_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);\r
         button3_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
-\r
         // Add the CallBack about events\r
         UIView::OnClickListener *button3Click = static_cast<UIView::OnClickListener *>(DialPresenter::GetInstance());\r
         button3_->SetOnClickListener(button3Click);\r
@@ -82,43 +124,23 @@ namespace OHOS
         scrollView1_->Add(button3_);\r
         button3_->SetVisible(true);\r
 \r
-        // Add ImageView to App\r
-        if (image2_ == nullptr)\r
-        {\r
-            image2_ = new UIImageView();\r
-        }\r
-        image2_->SetPosition(691, 172); // widget's left position and top position\r
-        image2_->Resize(100, 100);      // widget's width and height\r
-        image2_->SetViewId("image2");   // Set style\r
-\r
-        // Set additional property\r
-\r
-        // Add to scrollView1\r
-        scrollView1_->Add(image2_);\r
-        image2_->SetVisible(true);\r
-\r
         // Add Button to App\r
         if (button2_ == nullptr)\r
         {\r
             button2_ = new UIButton();\r
         }\r
-        button2_->SetPosition(-190, 103); // widget's left position and top position\r
-        button2_->Resize(260, 260);       // widget's width and height\r
-        button2_->SetViewId("button2");   // Set style\r
+        button2_->SetPosition(-190, 103);       // widget's left position and top position\r
+        button2_->Resize(260, 260);             // widget's width and height\r
+        button2_->SetViewId("flowerbudbutton"); // Set style\r
         button2_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);\r
         button2_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
 \r
         // Set additional property\r
-#ifdef _WIN32\r
-        char *button2defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Dial/Malio.bin";\r
-#else\r
-        char *button2defaultImgSrc = "/user/res/Dial/Malio.bin";\r
-#endif\r
+        char *button2defaultImgSrc = "/user/res/clocks/Reducedgraph/flowerbud.bin";\r
         char *button2triggeredImgSrc = nullptr;\r
         button2_->SetImageSrc(button2defaultImgSrc, button2triggeredImgSrc);\r
         button2_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);\r
         button2_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
-\r
         // Add the CallBack about events\r
         UIView::OnClickListener *button2Click = static_cast<UIView::OnClickListener *>(DialPresenter::GetInstance());\r
         button2_->SetOnClickListener(button2Click);\r
@@ -126,38 +148,18 @@ namespace OHOS
         scrollView1_->Add(button2_);\r
         button2_->SetVisible(true);\r
 \r
-        // Add ImageView to App\r
-        if (image1_ == nullptr)\r
-        {\r
-            image1_ = new UIImageView();\r
-        }\r
-        image1_->SetPosition(-343, 183); // widget's left position and top position\r
-        image1_->Resize(100, 100);       // widget's width and height\r
-        image1_->SetViewId("image1");    // Set style\r
-\r
-        // Set additional property\r
-\r
-        // Add to scrollView1\r
-        scrollView1_->Add(image1_);\r
-        image1_->SetVisible(true);\r
-\r
         // Add Button to App\r
         if (button1_ == nullptr)\r
         {\r
             button1_ = new UIButton();\r
         }\r
-        button1_->SetPosition(103, 103); // widget's left position and top position\r
-        button1_->Resize(260, 260);      // widget's width and height\r
-        button1_->SetViewId("button1");  // Set style\r
+        button1_->SetPosition(103, 103);   // widget's left position and top position\r
+        button1_->Resize(260, 260);        // widget's width and height\r
+        button1_->SetViewId("kumibutton"); // Set style\r
         button1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);\r
         button1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);\r
-\r
         // Set additional property\r
-#ifdef _WIN32\r
-        char *button1defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Dial/KUMI.bin";\r
-#else\r
-        char *button1defaultImgSrc = "/user/res/Dial/KUMI.bin";\r
-#endif\r
+        char *button1defaultImgSrc = "/user/res/clocks/Reducedgraph/KUMI.bin";\r
         char *button1triggeredImgSrc = nullptr;\r
         button1_->SetImageSrc(button1defaultImgSrc, button1triggeredImgSrc);\r
         button1_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);\r
@@ -165,6 +167,7 @@ namespace OHOS
 \r
         // Add the CallBack about events\r
         UIView::OnClickListener *button1Click = static_cast<UIView::OnClickListener *>(DialPresenter::GetInstance());\r
+        button1_->SetOnClickListener(button1Click);\r
         // Add to scrollView1\r
         scrollView1_->Add(button1_);\r
         button1_->SetVisible(true);\r
@@ -183,26 +186,26 @@ namespace OHOS
             delete scrollView1_;\r
             scrollView1_ = nullptr;\r
         }\r
+        if (button5_ != nullptr)\r
+        {\r
+            delete button5_;\r
+            button5_ = nullptr;\r
+        }\r
+        if (button4_ != nullptr)\r
+        {\r
+            delete button4_;\r
+            button4_ = nullptr;\r
+        }\r
         if (button3_ != nullptr)\r
         {\r
             delete button3_;\r
             button3_ = nullptr;\r
         }\r
-        if (image2_ != nullptr)\r
-        {\r
-            delete image2_;\r
-            image2_ = nullptr;\r
-        }\r
         if (button2_ != nullptr)\r
         {\r
             delete button2_;\r
             button2_ = nullptr;\r
         }\r
-        if (image1_ != nullptr)\r
-        {\r
-            delete image1_;\r
-            image1_ = nullptr;\r
-        }\r
         if (button1_ != nullptr)\r
         {\r
             delete button1_;\r
index ef58e1a..7dbc6cd 100644 (file)
@@ -1,16 +1,15 @@
-/*
+/***
  * @Author: Caisking 3449750381@qq.com
  * @Date: 2024-01-02 11:23:34
  * @LastEditors: Caisking 3449750381@qq.com
- * @LastEditTime: 2024-01-11 10:08:21
+ * @LastEditTime: 2024-01-11 10:48:05
  * @FilePath: /1.FD230/FD230/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp
- * @Description: 
- * 
- * Copyright (c) 2024 by Caisking , All Rights Reserved. 
+ * @Description:
+ * @
+ * @Copyright (c) 2024 by Caisking , All Rights Reserved.
  */
 
 #include "dial/include/Digital_clockView.h"
-
 #include "common/image_cache_manager.h"
 #include "components/ui_view_group.h"
 #include "UiConfig.h"
 namespace OHOS
 {
     cJSON *cjson_json = NULL;
+    /***
+     * @description:
+     * @param {string} &filePath
+     * @return 设置json文件
+     */
     void Digital_clockView::setJsonFilePath(const std::string &filePath)
     {
-        JosnfilePath = filePath;
+        PRINT_DEBUG_INFO
+        std::string defaultFile = "/user/res/clocks/default.json";
+        std::ifstream sourceFile(filePath, std::ios::binary);                      // 打开源文件
+        std::ofstream targetFile(defaultFile, std::ios::binary | std::ios::trunc); // 打开目标文件,使用trunc标志来覆盖目标文件
+        printf("%s|%s\n", defaultFile.c_str(), filePath.c_str());                  // 使用c_str()将std::string转换为C风格字符串
+        if (sourceFile && targetFile)
+        {
+            char buffer[1024]; // 缓冲区
+            while (sourceFile.read(buffer, sizeof(buffer)) || sourceFile.gcount())
+            {
+                targetFile.write(buffer, sourceFile.gcount());
+            }
+            if (sourceFile.eof())
+            {
+                printf("File overwrite success\n"); // 使用printf打印成功消息
+                return;                             // 返回true表示文件拷贝成功
+            }
+            else
+            {
+                fprintf(stderr, "File overwrite failed\n"); // 使用fprintf打印错误消息
+            }
+        }
+        else
+        {
+            fprintf(stderr, "Unable to open file\n"); // 使用fprintf打印错误消息
+        }
+        sourceFile.close();
+        targetFile.close();
     }
     /**
      * @description: 加载json文件
      * @param {string} &filePath
-     * @return {*}
-     */      
+     * @return 加载json文件是否成功
+     */
     bool loadJsonData(const std::string &filePath)
     {
 
@@ -82,7 +113,7 @@ namespace OHOS
      * @param {char} *basePath
      * @param {char} *fileExtension
      * @param {int} numImages
-     * @return {*}
+     * @return 动画的资源路径数组
      */
     const char **Digital_clockView::CreateImagePathsArray(const char *basePath, const char *fileExtension, int numImages)
     {
@@ -98,10 +129,10 @@ namespace OHOS
         imagePaths[numImages] = reinterpret_cast<const char *>(numImages); // 将数组大小信息存储在最后一个元素中
         return imagePaths;
     }
-    /**
-     * @description: 释放动画路径数组
-     * @param {char} *
-     * @return {*}
+    /***
+     * @description: 删除动画资源路径数组
+     * @param {char} *imagePaths 动画资源路径数组
+     * @return
      */
     void Digital_clockView::FreeImagePathsArray(const char **imagePaths)
     {
@@ -115,7 +146,7 @@ namespace OHOS
     /**
      * @description: 判断路径是否为文件夹
      * @param {string} &path
-     * @return {*}
+     * @return 路径是否为文件夹
      */
     bool isDirectory(const std::string &path)
     {
@@ -127,9 +158,9 @@ namespace OHOS
     }
     /**
      * @description: 初始化背景
-     * @return {*}
+     * @return 初始化背景是否成功
      */
-    void Digital_clockView::Initbackground()
+    bool Digital_clockView::Initbackground()
     {
         // 初始化背景
         if (background == nullptr)
@@ -180,10 +211,11 @@ namespace OHOS
             }
         }
         // 增加背景
-        container_->Add(background);
-        background->SetVisible(true);
+        Add(background);
+        return true;
+        // background->SetVisible(true);
     }
-    
+
     /**
      * @description: 初始化数字图片
      * @param {int} left
@@ -192,8 +224,8 @@ namespace OHOS
      * @param {char} *viewId
      * @param {int} offsetX
      * @param {int} offsetY
-     * @return {*}
-     */  
+     * @return
+     */
     void Digital_clockView::addImageView(int left, int top, const char *imagePath, const char *viewId, int offsetX, int offsetY)
     {
         UIImageView *imageView = new UIImageView();
@@ -201,22 +233,22 @@ namespace OHOS
         imageView->Resize(100, 100);
         imageView->SetViewId(viewId);
         imageView->SetSrc(imagePath);
-        container_->Add(imageView);
-        imageView->SetVisible(true);
+        Add(imageView);
+        // imageView->SetVisible(true);
     }
     /**
      * @description: 初始化数字表盘
-     * @return {*}
-     */    
-    void Digital_clockView ::Initdigit()
+     * @return 初始化数字表盘是否成功
+     */
+    bool Digital_clockView ::Initdigit()
     {
         cJSON *background_cjson = cJSON_GetObjectItem(cjson_json, "background");
         std::string backgroundimagesPath = cJSON_GetObjectItem(background_cjson, "backgroundimagesPath")->valuestring;
         if (isDirectory(backgroundimagesPath))
         {
             backgroundAnimator->Start();
-            container_->Add(backgroundAnimator);
-            backgroundAnimator->SetVisible(true);
+            Add(backgroundAnimator);
+            // backgroundAnimator->SetVisible(true);
         }
         stringtime = "11:54";
         // updateClockTime(stringtime);
@@ -237,8 +269,11 @@ namespace OHOS
             addImageView(hour1_left, hour1_top, (digitspath + stringtime.substr(3, 1) + ".bin").c_str(), "minute1", digitsize * 3, 0);
             addImageView(hour1_left, hour1_top, (digitspath + stringtime.substr(4, 1) + ".bin").c_str(), "minute2", digitsize * 4, 0);
             printf("--%s--\n", digitspath.c_str());
-            mytimeimageCallback_ = new mytimeimageCallback(hour1, hour2, minute1, minute2, digitspath, stringtime);
-            timeimageanimator_ = new Animator(mytimeimageCallback_, container_, 10000, true);
+            if (mytimeimageCallback_ == nullptr)
+            {
+                mytimeimageCallback_ = new mytimeimageCallback(hour1, hour2, minute1, minute2, digitspath, stringtime);
+                timeimageanimator_ = new Animator(mytimeimageCallback_, minute2, 10000, true);
+            }
             // callback.mytimeimageCallback("14:57");
             // timeimageanimator_->Start();
         }
@@ -267,19 +302,23 @@ namespace OHOS
             timeLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, digitsize);
 
             // Add to rootView
-            container_->Add(timeLable);
-            timeLable->SetVisible(true);
+            Add(timeLable);
+            // timeLable->SetVisible(true);
 
-            timeLableCallback_ = new timeLableCallback(timeLable, stringtime);
-            timeLableanimator_ = new Animator(timeLableCallback_, timeLable, 1000, true);
+            if (timeLableCallback_ == nullptr)
+            {
+                timeLableCallback_ = new timeLableCallback(timeLable, stringtime);
+                timeLableanimator_ = new Animator(timeLableCallback_, timeLable, 1000, true);
+            }
             timeLableanimator_->Start();
         }
+        return true;
     }
     /**
      * @description: 初始化指针表盘
-     * @return {*}
-     */    
-    void Digital_clockView::Initpointer()
+     * @return: 初始化指针表盘是否成功
+     */
+    bool Digital_clockView::Initpointer()
     {
         cJSON *hands = cJSON_GetObjectItem(cjson_json, "hands");
         cJSON *hourHand = cJSON_GetObjectItem(hands, "hourHand");
@@ -339,14 +378,15 @@ namespace OHOS
         sweepClock1animator_ = new Animator(sweepClock1callback_, sweepClock1_, 0, true);
         sweepClock1animator_->Start();
         // Add to rootView
-        container_->Add(sweepClock1_);
-        sweepClock1_->SetVisible(true);
+        Add(sweepClock1_);
+        return true;
+        // sweepClock1_->SetVisible(true);
     }
     /**
      * @description: 获取格式化日期,根据不同的日期格式获取
      * @param {string} &dateStr
      * @param {string} &displayformat
-     * @return {*}
+     * @return 格式化日期
      */
     std::string FormatDate(const std::string &dateStr, const std::string &displayformat)
     {
@@ -371,14 +411,13 @@ namespace OHOS
         }
 
         // 添加其他显示格式的处理逻辑
-
         return formattedDate;
     }
     /**
      * @description: 初始化日期
-     * @return {*}
-     */    
-    void Digital_clockView ::Initdata()
+     * @return 初始化日期是否成功
+     */
+    bool Digital_clockView ::Initdata()
     {
         // loadJsonData(JosnfilePath);
         cJSON *date = cJSON_GetObjectItem(cjson_json, "date");
@@ -412,14 +451,15 @@ namespace OHOS
         dateLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, fontsize);
 
         // Add to rootView
-        container_->Add(dateLable);
-        dateLable->SetVisible(true);
+        Add(dateLable);
+        return true;
+        // dateLable->SetVisible(true);
     };
     /**
      * @description: 初始化星期
-     * @return {*}
-     */    
-    void Digital_clockView ::Initweek()
+     * @return 初始化星期是否成功
+     */
+    bool Digital_clockView ::Initweek()
     {
         // loadJsonData(JosnfilePath);
         cJSON *week = cJSON_GetObjectItem(cjson_json, "week");
@@ -458,14 +498,15 @@ namespace OHOS
         weekLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, fontsize);
 
         // Add to rootView
-        container_->Add(weekLable);
-        weekLable->SetVisible(true);
+        Add(weekLable);
+        return true;
+        // weekLable->SetVisible(true);
     };
     /**
      * @description: 初始化电量
-     * @return {*}
-     */    
-    void Digital_clockView ::Initbattery()
+     * @return 初始化电量是否成功
+     */
+    bool Digital_clockView ::Initbattery()
     {
         // loadJsonData(JosnfilePath);
         cJSON *battery = cJSON_GetObjectItem(cjson_json, "battery");
@@ -508,8 +549,8 @@ namespace OHOS
         char *progress1BackImageSrc = nullptr;
         progress->SetImage(progress1ForeImageSrc, progress1BackImageSrc);
         // Add to rootView
-        container_->Add(progress);
-        progress->SetVisible(true);
+        Add(progress);
+        // progress->SetVisible(true);
 
         // Add Label to App
         if (batteryLable == nullptr)
@@ -529,23 +570,51 @@ namespace OHOS
         batteryLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, fontsize);
 
         // Add to rootView
-        container_->Add(batteryLable);
-        batteryLable->SetVisible(true);
+        Add(batteryLable);
+        // batteryLable->SetVisible(true);
 
         progress1callback_ = new myProgressCallback(progress, batteryLable);
         progress1animator_ = new Animator(progress1callback_, progress, 10000, true);
         progress1animator_->Start();
+        return true;
     };
+    /***
+     * @description: 添加切换界面按键
+     * @return 添加按键是否成功
+     */
+    bool Digital_clockView ::AddButton()
+    {
+        PRINT_DEBUG_INFO
+        // Add Button to App
+        if (changebutton == nullptr)
+        {
+            changebutton = new UIButton();
+        }
+        changebutton->SetPosition(0, 0);       // widget's left position and top position
+        changebutton->Resize(466, 466);        // widget's width and height
+        changebutton->SetViewId(CHANGEBUTTON); // Set style
+        changebutton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
+        changebutton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+        PRINT_DEBUG_INFO
+        // Set additional property
+        changebutton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);
+        changebutton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+        PRINT_DEBUG_INFO
+        // Add the CallBack about events
+        UIView::OnLongPressListener *buttonLongPress = static_cast<UIView::OnLongPressListener *>(MainPresenterSample::GetInstance());
+        changebutton->SetOnLongPressListener(buttonLongPress);
+        // Add to rootView
+        Add(changebutton);
+        PRINT_DEBUG_INFO
+        return true;
+    }
     /**
      * @description: 初始化页面
-     * @return {*}
-     */   
+     * @return 初始化页面是否成功
+     */
     bool Digital_clockView ::InitView()
     {
-        container_ = new UIViewGroup();
-        container_->SetPosition(0, 0);
-        container_->SetWidth(Screen::GetInstance().GetWidth());
-        container_->SetHeight(Screen::GetInstance().GetHeight());
+        PRINT_DEBUG_INFO
         if (loadJsonData(JosnfilePath))
         {
             std::string Dialtype = cJSON_GetObjectItem(cjson_json, "Dialtype")->valuestring;
@@ -562,31 +631,44 @@ namespace OHOS
             Initdata();
             Initweek();
             Initbattery();
+            AddButton();
             cJSON_Delete(cjson_json);
         }
-
-        Add(container_);
-
+        // Add(container_);
         SetCoverable(true);
         PRINT_DEBUG_INFO
         return true;
     }
-    /* DeInit:删除组件*/
+    /**
+     * @description: 删除组件
+     * @return {*}
+     */
     void Digital_clockView::DeInit()
     {
-        UIView *view = static_cast<UIViewGroup *>(container_)->GetChildrenHead();
-        while (view != nullptr)
-        {
-
-            UIView *tempView = view;
-            view = view->GetNextSibling();
-            if (tempView->GetParent())
-            {
-                static_cast<UIViewGroup *>(tempView->GetParent())->Remove(tempView);
-            }
-            delete tempView;
-        }
-        /********************************************/
+        /* -------------------------------------------------------------------------- */
+        delete background;
+        background = nullptr;
+        delete hour1;
+        hour1 = nullptr;
+        delete hour2;
+        hour2 = nullptr;
+        delete colon;
+        colon = nullptr;
+        delete minute1;
+        minute1 = nullptr;
+        delete minute2;
+        minute2 = nullptr;
+        delete timeLable;
+        timeLable = nullptr;
+        delete dateLable;
+        dateLable = nullptr;
+        delete weekLable;
+        weekLable = nullptr;
+        delete batteryLable;
+        batteryLable = nullptr;
+        delete progress;
+        progress = nullptr;
+        /* -------------------------------------------------------------------------- */
         if (timeLableanimator_ != nullptr)
         {
             timeLableanimator_->Stop();
@@ -598,7 +680,7 @@ namespace OHOS
             delete timeLableCallback_;
             timeLableCallback_ = nullptr;
         }
-        /********************************************/
+        /* -------------------------------------------------------------------------- */
         if (mytimeimageCallback_ != nullptr)
         {
             delete mytimeimageCallback_;
@@ -610,7 +692,7 @@ namespace OHOS
             delete timeimageanimator_;
             timeimageanimator_ = nullptr;
         }
-        /********************************************/
+        /* -------------------------------------------------------------------------- */
         if (progress1callback_ != nullptr)
         {
             delete progress1callback_;
@@ -622,7 +704,7 @@ namespace OHOS
             delete progress1animator_;
             progress1animator_ = nullptr;
         }
-        /********************************************/
+        /* -------------------------------------------------------------------------- */
         if (sweepClock1callback_ != nullptr)
         {
             delete sweepClock1callback_;
@@ -634,15 +716,13 @@ namespace OHOS
             delete sweepClock1animator_;
             sweepClock1animator_ = nullptr;
         }
-        /********************************************/
+        /* -------------------------------------------------------------------------- */
         if (backgroundAnimator != nullptr)
         {
             backgroundAnimator->Stop();
             delete backgroundAnimator;
             backgroundAnimator = nullptr;
         }
-        delete container_;
-        container_ = nullptr;
     }
 
     void Digital_clockView::PreLoad(void)
@@ -656,4 +736,5 @@ namespace OHOS
     void Digital_clockView::UnLoad(void)
     {
     }
+
 }
index fc30038..c393ecb 100755 (executable)
@@ -143,7 +143,7 @@ namespace OHOS
         string curViewId = view.GetViewId();\r
         //int page = MainViewSample::GetInstance()->GetHorCurrentPage();\r
         //callback_->OnSwipe(view);\r
-        if(curViewId== "button1")\r
+        if(curViewId== CHANGEBUTTON)\r
         {\r
             NativeAbility::GetInstance().ChangeSlice(VIEW_DIAL);\r
             return true;\r
index 21b7103..a56a701 100755 (executable)
@@ -253,7 +253,6 @@ void MainViewSample::OnStop()
 \r
 UICardPage *MainViewSample::InitWatchFacePage(void)\r
 {\r
-\r
     mainClockView = new MainClockView();\r
     if (mainClockView == nullptr) {\r
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView new fail");\r
index 16dbd20..0763f73 100755 (executable)
@@ -1,3 +1,13 @@
+/*** \r
+ * @Author: Caisking 3449750381@qq.com\r
+ * @Date: 2023-12-15 14:33:22\r
+ * @LastEditors: Caisking 3449750381@qq.com\r
+ * @LastEditTime: 2024-01-11 19:29:58\r
+ * @FilePath: /1.FD230/FD230/code/sdk/application/wearable/nativeapp/nativeui/screensetting/include/ScreenModels.h\r
+ * @Description: \r
+ * @\r
+ * @Copyright (c) 2024 by Caisking , All Rights Reserved. \r
+ */\r
 /*\r
  * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved.\r
  * Description: ScreenModels\r
index 19b4d6b..cffb643 100755 (executable)
@@ -176,7 +176,7 @@ bool ScreenModels::LoadAppImages(std::string file, UIImageView *view, uint32_t r
 void ScreenModels::PreLoadAppimages(void)\r
 {\r
     LoadAppMultiImages(PLAYER_IAMGES, PLAYER_BACKGROUND, PLAYER_PLAYING);\r
-    LoadAppMultiImages(DIAL_CLOCK, CLOCK_HAND24HOUR_IMAGE_PATH, CLOCK_TUESDAY_IMAGE_PATH);\r
+    //LoadAppMultiImages(DIAL_CLOCK, CLOCK_HAND24HOUR_IMAGE_PATH, CLOCK_TUESDAY_IMAGE_PATH);\r
     //LoadAppMultiImages(CLOCK_IAMGES, CLOCK_HAND24HOUR_IMAGE_PATH, CLOCK_TUESDAY_IMAGE_PATH);\r
     LoadAppMultiImages(COMPASS_IAMGES, COMPASS_COMPASS0, COMPASS_START_PATH_RECORD);\r
     LoadAppMultiImages(DROPDOWN_IAMGES, DROPDOWN_DROPDOWN_BLUETOOTH, DROPDOWN_DROPDOWN_BRI_SCREEN_B);\r
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/KUMI.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/KUMI.bin
new file mode 100644 (file)
index 0000000..6c62605
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/KUMI.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/flowerbud.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/flowerbud.bin
new file mode 100644 (file)
index 0000000..330cf7c
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/flowerbud.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/maliao.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/maliao.bin
new file mode 100644 (file)
index 0000000..3c2ba11
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/maliao.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/maomao.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/maomao.bin
new file mode 100644 (file)
index 0000000..784adbe
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/maomao.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/momo.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/momo.bin
new file mode 100644 (file)
index 0000000..f84214c
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/Reducedgraph/momo.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/default.json b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/clocks/default.json
new file mode 100644 (file)
index 0000000..23fb794
--- /dev/null
@@ -0,0 +1,71 @@
+{\r
+    "Dialtype": "digits",\r
+    "digitspath": "/user/res/clocks/KUMI/",\r
+    "digits": {\r
+        "timeformat": "24format",\r
+        "digitsize": 60,\r
+        "playformat": "textdisplay",\r
+        "fontsize": 55,\r
+        "textdisplay": {\r
+            "coordinates": {\r
+                "left": 161,\r
+                "top": 293\r
+            }\r
+        }\r
+    },\r
+    "date": {\r
+        "textdisplay": {\r
+            "displayformat": "dd",\r
+            "font": "STYLE_TEXT_FONT",\r
+            "fontsize": 35,\r
+            "coordinates": {\r
+                "left": 250,\r
+                "top": 365\r
+            }\r
+        }\r
+    },\r
+    "week": {\r
+        "textdisplay": {\r
+            "displayformat": {\r
+                "weekformat": [\r
+                    "Mon ",\r
+                    "Tue ",\r
+                    "Wed ",\r
+                    "Thu ",\r
+                    "Fri ",\r
+                    "Sat ",\r
+                    "Sun"\r
+                ]\r
+            },\r
+            "fontsize": 35,\r
+            "coordinates": {\r
+                "left": 181,\r
+                "top": 365\r
+            }\r
+        }\r
+    },\r
+    "battery": {\r
+        "progress": {\r
+            "size": {\r
+                "width": 31,\r
+                "height": 19\r
+            },\r
+            "coordinates": {\r
+                "left": 180,\r
+                "top": 30\r
+            }\r
+        },\r
+        "textdisplay": {\r
+            "fontsize": 28,\r
+            "coordinates": {\r
+                "left": 220,\r
+                "top": 25\r
+            }\r
+        }\r
+    },\r
+    "heartrate": {},\r
+    "step": {},\r
+    "background": {\r
+        "backgroundimagesPath": "/user/res/clocks/KUMI/background.bin"\r
+    }\r
+}
\ No newline at end of file
index 4e02537..5de64a6 100644 (file)
@@ -3,8 +3,7 @@
     "digitspath": "/user/res/clocks/maliao/",\r
     "digits": {\r
         "timeformat": "24format",\r
-        "displayformat": "picturesdisplay",\r
-        "digitspath": "/user/res/clocks/maliao/",\r
+        "playformat": "picturesdisplay",\r
         "digitsize": 40,\r
         "picturesdisplay": {\r
             "coordinates": {\r
index 9e18ed2..16a5cbb 100755 (executable)
@@ -476,7 +476,7 @@ void UIImageView::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea)
 
 void UIImageView::SetSrc(const char* src)
 {
-    printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__);
+    //printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__);
 #ifndef VERSION_LITE
     if (src == nullptr) {
         return;