1.采用长按方式,而非点击就进入。
authorCaisking <3449750381@qq.com>
Thu, 29 Feb 2024 12:13:11 +0000 (20:13 +0800)
committerCaisking <3449750381@qq.com>
Thu, 29 Feb 2024 12:13:11 +0000 (20:13 +0800)
    2.applist里也加入这个slice,长按切换可以延后完成
    3.滑动切换缩约图去掉模拟表冠 @袁清梦

26 files changed:
code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp
code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp
code/sdk/application/wearable/fd230app/nativeui/dialupdate/include/DialUpdateModel.h
code/sdk/application/wearable/fd230app/nativeui/dialupdate/include/DialUpdatePresenter.h
code/sdk/application/wearable/fd230app/nativeui/dialupdate/include/DialUpdateView.h
code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdateModel.cpp
code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdatePresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdateView.cpp
code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h
code/sdk/application/wearable/fd230app/nativeui/main/include/MainViewSample.h
code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp
code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/KUMI.bin
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/dial_defult.bin [deleted file]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/dog.bin
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/galaxy.bin
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/defult_dial.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/dial_config.json [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/dog.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/flowerbud.bin [deleted file]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/galaxy.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/maliao.bin [deleted file]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/maomao.bin
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/momo.bin [deleted file]

index 034dabb..8cb7a33 100644 (file)
@@ -226,8 +226,6 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLangues");
         }
 #endif
-        /* -------------------------------------------------------------------------- */
-
         /* ------------------------------- ConfigModel ------------------------------ */
         ConfigModel::GetInstance()->LoadJsonData();
         /* -------------------------------------------------------------------------- */
index 457a9e1..62e2ecf 100644 (file)
@@ -27,7 +27,7 @@ namespace OHOS
         {VIEW_WEATHER, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_WEATHER_IMAGE, "天气", nullptr},
         {VIEW_RECORD, PNG_APPLIST_RECORD_IMAGE, PNG_APPLIST_RECORD_IMAGE, "录音", nullptr},
         {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "设置", nullptr},
-        {VIEW_ROTATE, PNG_APPLIST_UI_SAMPLE_IMAGE, PNG_APPLIST_UI_SAMPLE_IMAGE, "模拟表冠", nullptr},
+        {VIEW_DIALUPDATE, PNG_APPLIST_UI_SAMPLE_IMAGE, PNG_APPLIST_UI_SAMPLE_IMAGE, "表盘切换", nullptr},
 #ifdef SUPPORT_ALIPAY_SEC
         {VIEW_MAIN_ALIPAY, PNG_APPLIST_ALIPAY_IMAGE, PNG_APPLIST_ALIPAY_IMAGE, "支付宝", nullptr},
 #endif
index 85879b0..56f0907 100644 (file)
@@ -3,6 +3,23 @@
 
 #include <string>
 
+#define MAX_DIALNUM 4
+typedef struct
+{
+    const char *title;
+    const char *thumbnailPath;
+    const char *dialPath;
+} DialInfo;
+enum class DialPathType
+{
+    DIAL_KUMI = 0,
+    DIAL_GALAXY,
+    DIAL_DOG,
+    DIAL_MAOMAO,
+    DIAL_DEFAULT
+};
+extern DialInfo dialInfo[MAX_DIALNUM];
+
 namespace OHOS
 {
     class DialUpdateModel
@@ -10,16 +27,16 @@ namespace OHOS
     public:
         static DialUpdateModel *GetInstance();
 
-        std::string GetDialConfigPath();
-        void UpdateDialConfigPath(const std::string &newPath);
-
+        uint8_t GetDialConfigPath();                   // 获取当前表盘信息,方便切换表盘
+        bool LoadDialConfigFromJson();                 // 加载json
+        void UpdateDialConfigPath(uint8_t dialpathid); // 切换表盘接口
     private:
         DialUpdateModel();
         DialUpdateModel(const DialUpdateModel &);
         DialUpdateModel &operator=(const DialUpdateModel &);
         virtual ~DialUpdateModel();
-
-        std::string dialConfigPath = "user/res/dials/galaxy.bin";; // Member variable to store the dial configuration path
+        std::string dialConfigPath = "user/res/dialupdate/dial_config.json"; // JSON文件路径
+        uint8_t Current_dial = 0;                                            // 目前表盘
     };
 }
 
index c4c0454..1c31668 100644 (file)
@@ -33,12 +33,15 @@ namespace OHOS
         void OnStop() override;
         DialViewGroup *dialGroup_ = nullptr;
         static DialUpdatePresenter *GetInstance();
+        uint8_t GetShowId();
 
     private:
         bool OnClick(UIView &view, const ClickEvent &event) override;
         bool OnDrag(UIView &view, const DragEvent &event) override;
+        bool OnDragEnd(UIView &view, const DragEvent &event) override;
         DialUpdateModel *g_pdialupdatemodel;
+        uint8_t showid = 0; // 表盘展示Id,默认从第一个开始
     };
 } // namespace OHOS
 
-#endif // SLEEPDETAIL_PRESENTER_H
\ No newline at end of file
+#endif
\ No newline at end of file
index 79722df..f572a13 100644 (file)
@@ -48,15 +48,19 @@ namespace OHOS
 
         void TestPicker();
         void GetTestView();
+        void SetView();
 
     private:
-
         UIViewGroup *container_ = nullptr;
         UILabel *label1_ = nullptr;
         UIImageView *image1_ = nullptr;
         UIButton *button3_ = nullptr;
         UIButton *button1_ = nullptr;
         UIButton *button2_ = nullptr;
+
+        std::string labelStr; // 表盘名称
+        std::string dialpath; // 展示表盘
+        uint8_t dialId;       // 表盘Id
     };
 }
 
index 23fab3a..377a5ad 100644 (file)
@@ -6,7 +6,19 @@
  */
 
 #include "dialupdate/include/DialUpdateModel.h"
+#include <iostream>
+#include <fstream>
+#include "cJSON.h"
+#include "wearable_log.h"
 
+// 表盘名称||表盘缩约图||表盘路径
+DialInfo dialInfo[MAX_DIALNUM] = {
+    {"KUMI表盘", "user/res/dialupdate/KUMI.bin", "user/res/dials/KUMI.bin"},
+    {"星空表盘", "user/res/dialupdate/galaxy.bin", "user/res/dials/galaxy.bin"},
+    {"小狗表盘", "user/res/dialupdate/dog.bin", "user/res/dials/dog.bin"},
+    {"招财猫", "user/res/dialupdate/maomao.bin", "user/res/dials/maomao.bin"}};
+
+    //{"默认表盘", "user/res/dialupdate/defult_dial.bin", "user/res/dials/defult_dial.bin"}
 namespace OHOS
 {
     DialUpdateModel::DialUpdateModel() {}
@@ -18,12 +30,68 @@ namespace OHOS
         static DialUpdateModel instance;
         return &instance;
     }
-    std::string DialUpdateModel::GetDialConfigPath()
+
+    /**
+     * @brief 获取当前表盘配置Id
+     * @return 当前表盘配置Id
+     */
+    uint8_t DialUpdateModel::GetDialConfigPath()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetDialConfigPath:%d", Current_dial);
+        return Current_dial;
+    }
+
+    /**
+     * @brief 更新表盘配置Id
+     * @param dialpathid 新的表盘Id
+     */
+    void DialUpdateModel::UpdateDialConfigPath(uint8_t dialpathid)
     {
-        return dialConfigPath;
+        Current_dial = dialpathid; // 更新表盘Id
+
+        cJSON *root = cJSON_CreateObject();
+        cJSON_AddNumberToObject(root, "Current_dial", Current_dial);
+        FILE *file = fopen(dialConfigPath.c_str(), "w");
+        if (!file)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to UpdateDial JSON file for writing");
+            cJSON_Delete(root);
+            return;
+        }
+        char *jsonString = cJSON_Print(root);
+        fputs(jsonString, file);
+        fclose(file);
+        cJSON_Delete(root);
+        free(jsonString);
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UpdateDialConfigPath:%d", Current_dial);
     }
-    void DialUpdateModel::UpdateDialConfigPath(const std::string &newPath)
+
+    /**
+     * @brief 从JSON文件中加载表盘配置
+     * @return 加载是否成功
+     */
+    bool DialUpdateModel::LoadDialConfigFromJson()
     {
-        dialConfigPath = newPath;
+        cJSON *cjson_json = NULL;
+        std::ifstream file(dialConfigPath);
+        if (file.is_open())
+        {
+            std::string json_string((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
+            file.close();
+            // 解析JSON数据
+            cjson_json = cJSON_Parse(json_string.c_str());
+            if (!cjson_json)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to parse JSON file");
+                return false;
+            }
+            // 从cJSON对象中提取所需的值
+            Current_dial = cJSON_GetObjectItem(cjson_json, "Current_dial")->valueint;
+            // 删除cJSON对象
+            cJSON_Delete(cjson_json);
+        }
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LoadDialConfigFromJson:%d", Current_dial);
+        return true;
     }
+
 }
index 92f60ca..b677e0e 100644 (file)
@@ -17,86 +17,131 @@ namespace OHOS
 
     DialUpdatePresenter::~DialUpdatePresenter()
     {
-
         g_pDialUpdatePresenter = nullptr;
     }
 
     DialUpdatePresenter *DialUpdatePresenter::GetInstance()
     {
-
-        return g_pDialUpdatePresenter;
-    }
-
-    void DialUpdatePresenter::OnStart()
-    {
-
-        Presenter<DialUpdateView>::OnStart();
-    }
-
-    void DialUpdatePresenter::OnPause(void)
-    {
-
-        Presenter<DialUpdateView>::OnPause();
+        static DialUpdatePresenter instance;
+        return &instance;
     }
 
-    void DialUpdatePresenter::OnResume(void)
+    uint8_t DialUpdatePresenter::GetShowId()
     {
-
-        Presenter<DialUpdateView>::OnResume();
+        return showid;
     }
 
-    void DialUpdatePresenter::OnStop(void)
+    // 退出切换表盘界面
+    bool DialUpdatePresenter::OnDrag(UIView &view, const DragEvent &event)
     {
-
-        Presenter<DialUpdateView>::OnStop();
+        return true;
     }
 
-    bool DialUpdatePresenter::OnDrag(UIView &view, const DragEvent &event)
+    bool DialUpdatePresenter::OnDragEnd(UIView &view, const DragEvent &event)
     {
         if (event.GetDragDirection() == DragEvent::DIRECTION_BOTTOM_TO_TOP)
         {
             NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
         }
+        // 右滑
+        if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT)
+        {
+            if (showid == MAX_DIALNUM - 1)
+            {
+                showid = 0;
+            }
+            else
+            {
+                showid++;
+            }
+            DialUpdateView::GetInstance()->SetView();
+            RootView::GetInstance()->Invalidate(); // 刷新界面
+        }
+        // 左滑
+        if (event.GetDragDirection() == DragEvent::DIRECTION_RIGHT_TO_LEFT)
+        {
+            if (showid == 0)
+            {
+                showid = MAX_DIALNUM - 1;
+            }
+            else
+            {
+                showid--;
+            }
+            DialUpdateView::GetInstance()->SetView();
+            RootView::GetInstance()->Invalidate(); // 刷新界面
+        }
         UNUSED(view);
         return true;
     }
 
     bool DialUpdatePresenter::OnClick(UIView &view, const ClickEvent &event)
     {
-        std::string filepath;
+        // 切换表盘按键
         if (strcmp(view.GetViewId(), "button_choose") == 0)
         {
-            filepath = "user/res/dials/KUMI.bin";
             // 检查是否需要更新表盘路径
-            std::string currentPath = g_pdialupdatemodel->GetDialConfigPath();
-            if (currentPath != filepath)
+            uint8_t currentid = g_pdialupdatemodel->GetDialConfigPath();
+            if (showid != currentid)
             {
-                g_pdialupdatemodel->UpdateDialConfigPath(filepath);
+                g_pdialupdatemodel->UpdateDialConfigPath(showid);
             }
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "filepath:%s || currentPath:%s ", filepath.c_str(), currentPath.c_str());
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "filepath:%d || currentPath:%d ", showid, currentid);
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TRANSITION_ZOOM);
         }
-        if (strcmp(view.GetViewId(), "flowerbudbutton") == 0)
+        // 检查点击的按钮并展示相应的表盘
+        else if (strcmp(view.GetViewId(), "button_right") == 0)
         {
-
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
+            if (showid == MAX_DIALNUM - 1)
+            {
+                showid = 0;
+            }
+            else
+            {
+                showid++;
+            }
+            DialUpdateView::GetInstance()->SetView();
+            RootView::GetInstance()->Invalidate(); // 刷新界面
         }
-        if (strcmp(view.GetViewId(), "maomaobutton") == 0)
+        else if (strcmp(view.GetViewId(), "button_left") == 0)
         {
-
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
+            if (showid == 0)
+            {
+                showid = MAX_DIALNUM - 1;
+            }
+            else
+            {
+                showid--;
+            }
+            DialUpdateView::GetInstance()->SetView();
+            RootView::GetInstance()->Invalidate(); // 刷新界面
         }
-        if (strcmp(view.GetViewId(), "momobutton") == 0)
-        {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showid:%d ", showid, showid);
+        return true;
+    }
 
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
-        }
-        if (strcmp(view.GetViewId(), "maliaobutton") == 0)
-        {
+    void DialUpdatePresenter::OnStart()
+    {
 
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
-        }
-        return true;
+        Presenter<DialUpdateView>::OnStart();
+    }
+
+    void DialUpdatePresenter::OnPause(void)
+    {
+
+        Presenter<DialUpdateView>::OnPause();
+    }
+
+    void DialUpdatePresenter::OnResume(void)
+    {
+
+        Presenter<DialUpdateView>::OnResume();
+    }
+
+    void DialUpdatePresenter::OnStop(void)
+    {
+
+        Presenter<DialUpdateView>::OnStop();
     }
 
-}
\ No newline at end of file
+}
index 6fbb7fc..f761606 100644 (file)
  */
 
 #include "dialupdate/include/DialUpdateView.h"
+#include "dialupdate/include/DialUpdateModel.h"
 #include "wearable_log.h"
+#include <string>
+
+extern DialInfo dialInfo[MAX_DIALNUM];
 
 namespace OHOS
 {
@@ -70,9 +74,25 @@ namespace OHOS
     {
         TestPicker();
     }
+    void DialUpdateView::SetView()
+    {
+        dialId = DialUpdatePresenter::GetInstance()->GetShowId();
+        labelStr = dialInfo[dialId].title;
+        dialpath = dialInfo[dialId].thumbnailPath;
+        label1_->SetText(labelStr.c_str());
+        image1_->SetSrc(dialpath.c_str());
+    }
 
     void DialUpdateView::TestPicker()
     {
+        /* -------------------------------- 加载展示表盘信息 -------------------------------- */
+        labelStr = dialInfo[dialId].title;
+        dialpath = dialInfo[dialId].thumbnailPath;
+        if (labelStr.empty() || dialpath.empty())
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialInfo is error!");
+            return;
+        }
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TestPicker");
         if (container_ == nullptr)
         {
@@ -80,7 +100,7 @@ namespace OHOS
             container_->SetPosition(0, 0, 466, 466);
             container_->SetStyle(STYLE_BACKGROUND_OPA, 0);
         }
-
+        /* -------------------------------------------------------------------------- */
         // Add Label to App
         if (label1_ == nullptr)
         {
@@ -90,9 +110,8 @@ namespace OHOS
         label1_->Resize(200, 60);          // widget's width and height
         label1_->SetViewId("label_title"); // Set style
         label1_->SetStyle(STYLE_TEXT_FONT, 26);
-
         // Set additional property
-        label1_->SetText("经典表盘");
+        label1_->SetText(labelStr.c_str());
         label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
         label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         label1_->SetRollSpeed(0);
@@ -101,7 +120,6 @@ namespace OHOS
         // Add to rootView
         container_->Add(label1_);
         label1_->SetVisible(true);
-
         // Add ImageView to App
         if (image1_ == nullptr)
         {
@@ -110,12 +128,8 @@ namespace OHOS
         image1_->SetPosition(103, 103); // widget's left position and top position
         image1_->Resize(100, 100);      // widget's width and height
         image1_->SetViewId("image1");   // Set style
-
         // Set additional property
-        char *image1imagesPath = "/user/res/dialupdate/KUMI.bin";
-
-        image1_->SetSrc(image1imagesPath);
-
+        image1_->SetSrc(dialpath.c_str());
         // Add to rootView
         container_->Add(image1_);
         image1_->SetVisible(true);
@@ -194,7 +208,6 @@ namespace OHOS
         container_->Add(button2_);
         button2_->SetVisible(true);
     }
-
     void DialUpdateView::OnStart()
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialUpdateView");
@@ -215,6 +228,8 @@ namespace OHOS
         container_->SetOnDragListener(draglistener);
         container_->SetTouchable(true);
         container_->SetDraggable(true);
+        // 取到展示表盘id
+        dialId = DialUpdatePresenter::GetInstance()->GetShowId();
         GetTestView();
         RootView::GetInstance()->Add(container_);
     }
index 8f52af9..6207979 100644 (file)
@@ -52,6 +52,7 @@ namespace OHOS
         void OnStop() override;
         virtual void Notify() override;
         bool OnClick(UIView &view, const ClickEvent &event) override;
+        bool OnLongPress(UIView &view, const LongPressEvent &event) override;
         virtual void OnSwipe(UISwipeView &view) override;
         void SetPage(int8_t id);
         void SetTaskPeroid(int page);
index be960f8..2e9173a 100644 (file)
@@ -113,6 +113,7 @@ namespace OHOS
         WeatherControlView *weatherControlView{nullptr};
         TraingView *traingView{nullptr};
         ApplistCardView *applistCardView{nullptr};
+        UIButton*changebut{nullptr};
         /* -------------------------------------------------------------------------- */
         UICardPage *recordCard[MAX_CARD]{nullptr};
         bool pageStatus[MAX_CARD]{false};
index 5bf4bea..e051d55 100644 (file)
@@ -97,7 +97,14 @@ namespace OHOS
             keyActListener_ = nullptr;
         }
     }
-
+    //长按进入切换表盘页面
+    bool MainPresenterSample::OnLongPress(UIView &view, const LongPressEvent &event)
+    {
+        UNUSED(event);
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnLongPress OnLongPress");
+        NativeAbility::GetInstance().ChangeSlice(VIEW_DIALUPDATE, TRANSITION_ZOOM);
+        return true;
+    }
     bool MainPresenterSample::OnClick(UIView &view, const ClickEvent &event)
     {
         UNUSED(event);
@@ -291,7 +298,7 @@ namespace OHOS
         {
 #if USE_OFFLINE_DIAL
             DialModelTime::GetInstance()->UpdateTime();
-            //DialModelPower::GetInstance()->UpdatePower();
+            // DialModelPower::GetInstance()->UpdatePower();
             dynamic_cast<DialViewGroup *>(view_->GetViewById(WATCH_FACE))->UpdateViewsByPeriodicUpdateData();
 #else
             dynamic_cast<MainClockView *>(view_->GetViewById(WATCH_FACE))->UpdateTime();
index 0cc1c08..89e59bb 100644 (file)
@@ -8,7 +8,7 @@
 #include "MainViewSample.h"
 #include "graphic_service.h"
 #include "dialupdate/include/DialUpdateModel.h"
-
+extern DialInfo dialInfo[MAX_DIALNUM];
 namespace OHOS
 {
 
@@ -332,19 +332,18 @@ namespace OHOS
     {
 #if USE_OFFLINE_DIAL
         mainClockView = new DialViewGroup();
-        #if 0
+#if 0
         std::string filePath = dynamic_cast<MainPresenterSample *>(presenter_)->GetDialPath();
         if (filePath.size() == 0)
         {
             filePath = RES_PATH "/dials/dog.bin";
         }
-        #endif
-        std::string filePath = DialUpdateModel::GetInstance()->GetDialConfigPath();
-        if (filePath.size() == 0)
-        {
-            filePath = RES_PATH "/dials/KUMI.bin";
-        }
+#endif
+        // DialUpdateModel::GetInstance()->LoadDialConfigFromJson();
+        uint8_t fileid = DialUpdateModel::GetInstance()->GetDialConfigPath();
+        std::string filePath = dialInfo[fileid].dialPath;
         mainClockView->SetDial(filePath);
+
 #else
         mainClockView = new MainClockView();
 #endif
@@ -354,6 +353,29 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView new fail");
             return nullptr;
         }
+
+#if 1
+        if (changebut == nullptr)
+        {
+            changebut = new UIButton();
+        }
+        changebut->SetPosition(0, 0);    // widget's left position and top position
+        changebut->Resize(466, 466);     // widget's width and height
+        changebut->SetViewId("button1"); // Set style
+        changebut->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
+        changebut->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+        // Set additional property
+        changebut->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfff6eeee, UIButton::PRESSED);
+        changebut->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);
+        changebut->SetStyleForState(STYLE_BORDER_COLOR, 0xfff3e8e8, UIButton::PRESSED);
+        changebut->SetStyleForState(STYLE_BORDER_OPA, 0x00, UIButton::PRESSED);
+        // Add the CallBack about events
+        UIView::OnLongPressListener *button1LongPress = static_cast<UIView::OnLongPressListener *>(MainPresenterSample::GetInstance());
+        changebut->SetOnLongPressListener(button1LongPress);
+        // Add to rootView
+        mainClockView->Add(changebut);
+        changebut->SetVisible(true);
+#endif
         return mainClockView;
     }
 
index 96a14cb..00a0173 100644 (file)
@@ -94,11 +94,13 @@ namespace OHOS
             SystemView::GetInstance()->ChangeView(SYSTEMVIEW, SUPERVISEVIEW);\r
             return true;\r
         }\r
+#if 0\r
         else if (strcmp(view.GetViewId(), SYSTEM_LANGUAGE) == 0)\r
         {\r
             SystemView::GetInstance()->ChangeView(SYSTEMVIEW, SYSTEMLANGUAGEVIEW);\r
             return true;\r
         }\r
+#endif\r
         else if (strcmp(view.GetViewId(), FACTORY_RESET) == 0)\r
         {\r
             SystemView::GetInstance()->ChangeView(SYSTEMVIEW, FACTORYRESETVIEW);\r
@@ -163,7 +165,7 @@ namespace OHOS
     // 用来监听语言切换\r
     bool RadiobuttonOnChangeListener::OnChange(UICheckBox::UICheckBoxState state)\r
     {\r
-\r
+#if 0\r
         // 获取字体单例\r
         UIFont *uiFont = UIFont::GetInstance();\r
         if (uiFont == nullptr)\r
@@ -196,6 +198,7 @@ namespace OHOS
         default:\r
             break;\r
         }\r
+#endif\r
         return true;\r
     }\r
 }
\ No newline at end of file
index 85dc04c..57ed3a5 100644 (file)
@@ -240,6 +240,7 @@ namespace OHOS
     // 3.跳转到系统语言界面\r
     bool SystemView::ChangeSystemLanguageView(int16_t thisView)\r
     {\r
+#if 1\r
         if (SystemScrollView[thisView] == nullptr)\r
         {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemLanguageView");\r
@@ -252,6 +253,7 @@ namespace OHOS
             SystemScrollView[thisView] = p_SystemLanguageView->SystemLanguageViewInit();\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
+#endif\r
         return true;\r
     }\r
 \r
index 05fdb0b..e9d202a 100644 (file)
Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/KUMI.bin and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/KUMI.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/dial_defult.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/dial_defult.bin
deleted file mode 100644 (file)
index caf628c..0000000
Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/dial_defult.bin and /dev/null differ
index 70ec050..e74814c 100644 (file)
Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/dog.bin and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/dog.bin differ
index 48af26f..3a6a4f6 100644 (file)
Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/galaxy.bin and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dials/galaxy.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/defult_dial.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/defult_dial.bin
new file mode 100644 (file)
index 0000000..63c3b81
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/defult_dial.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/dial_config.json b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/dial_config.json
new file mode 100644 (file)
index 0000000..ceca225
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "Current_dial": 0
+}
\ No newline at end of file
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/dog.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/dog.bin
new file mode 100644 (file)
index 0000000..bd7c69f
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/dog.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/flowerbud.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/flowerbud.bin
deleted file mode 100644 (file)
index 463c237..0000000
Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/flowerbud.bin and /dev/null differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/galaxy.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/galaxy.bin
new file mode 100644 (file)
index 0000000..7a04698
Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/galaxy.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/maliao.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/maliao.bin
deleted file mode 100644 (file)
index 3c2ba11..0000000
Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/maliao.bin and /dev/null differ
index 170542c..f84214c 100644 (file)
Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/maomao.bin and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/maomao.bin differ
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/momo.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/momo.bin
deleted file mode 100644 (file)
index f84214c..0000000
Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dialupdate/momo.bin and /dev/null differ