表盘更新
authorhcj <1224667075@qq.com>
Tue, 12 Mar 2024 02:45:17 +0000 (10:45 +0800)
committerhcj <1224667075@qq.com>
Tue, 12 Mar 2024 02:45:17 +0000 (10:45 +0800)
code/sdk/application/wearable/fd230app/nativeui/dialupdate/include/DialUpdateModel.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/src/MainViewSample.cpp
code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp

index 9fe9316..0e88ce9 100644 (file)
@@ -17,6 +17,8 @@ typedef struct
 {
     const char *title;
     const char *dialPath;
+    const char *thumbnailPath;
+    uint32_t imageOffset;
 } DialInfo_1;
 
 
@@ -29,7 +31,10 @@ enum class DialPathType
     DIAL_DEFAULT
 };
 extern DialInfo dialInfo[MAX_DIALNUM];
-
+extern DialInfo_1 dialInfo_1[MAX_DIALNUM_1];
+extern int dial_num;
+void read_dial();
+void printf_dial(void);
 namespace OHOS
 {
     class DialUpdateModel
index f572a13..deb5415 100644 (file)
 #include "core/render_manager.h"
 #include "graphic_config.h"
 #include "components/ui_image_view.h"
-
+#include "components/ui_card_page.h"
+#include "components/ui_cross_view.h"
 #include "dialupdate/include/DialUpdatePresenter.h"
+#include "swipe_effect/zoom_effect.h"
+#include "components/ui_swipe_view.h"
+#include "components/ui_label_button_ext.h"
+#include "common/image_cache_manager.h"
 
 namespace OHOS
 {
@@ -49,9 +54,13 @@ namespace OHOS
         void TestPicker();
         void GetTestView();
         void SetView();
+        void init_button();
+        bool HorizontalViewInit(void);
+
+        
 
     private:
-        UIViewGroup *container_ = nullptr;
+        UISwipeView *container_ = nullptr;
         UILabel *label1_ = nullptr;
         UIImageView *image1_ = nullptr;
         UIButton *button3_ = nullptr;
@@ -61,6 +70,8 @@ namespace OHOS
         std::string labelStr; // 表盘名称
         std::string dialpath; // 展示表盘
         uint8_t dialId;       // 表盘Id
+
+        ZoomEffect* callback{nullptr};
     };
 }
 
index b17ab07..1dd9544 100644 (file)
@@ -27,7 +27,7 @@ DialInfo dialInfo[MAX_DIALNUM] = {
     {"星空表盘", "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"}};
-int dial_num=0;
+int dial_num;
 void read_dial(void)
 {
     DIR *dirp = opendir(DIAL_DIR);
@@ -41,6 +41,7 @@ void read_dial(void)
             if(dialInfo_1[dial_num].dialPath)
             {
                 free((void*)dialInfo_1[dial_num].dialPath);
+                dialInfo_1[dial_num].dialPath=NULL;
             }
             char path[124]={0};
 
@@ -49,9 +50,21 @@ void read_dial(void)
             strcpy(str_1,path);
             dialInfo_1[dial_num].dialPath=str_1;
 
+            if(dialInfo_1[dial_num].thumbnailPath)
+            {
+                free((void*)dialInfo_1[dial_num].thumbnailPath);
+                dialInfo_1[dial_num].thumbnailPath=NULL;
+            }
+            char path_1[124]={0};
+            sprintf(path_1,"user/res/dialupdate/%s",ret->d_name);
+            str_1=(char*) malloc(sizeof(path_1));
+            strcpy(str_1,path_1);
+            dialInfo_1[dial_num].thumbnailPath=str_1;
+
             if(dialInfo_1[dial_num].title)
             {
                 free((void*)dialInfo_1[dial_num].title);
+                dialInfo_1[dial_num].title=NULL;
             }
             FILE * fp = fopen(path, "rb");
             if (fp == nullptr) 
@@ -63,8 +76,14 @@ void read_dial(void)
             
             char * str_2=(char*) malloc(sizeof(data->dialName));
             strcpy(str_2,data->dialName);
+            dialInfo_1->imageOffset=data->imageOffset;
             dialInfo_1[dial_num++].title=str_2;
 
+
+
+
+
+            
             fclose(fp);
             UIFree(data);
         }
@@ -103,8 +122,8 @@ namespace OHOS
      */
     uint8_t DialUpdateModel::GetDialConfigPath()
     {
-        //read_dial();
-        //printf_dial();
+        read_dial();
+        printf_dial();
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetDialConfigPath:%d", Current_dial);
         return Current_dial;
     }
index b677e0e..6e9a33b 100644 (file)
@@ -3,9 +3,12 @@
 #include "DialViewGroup.h"
 #include "dialupdate/include/DialUpdatePresenter.h"
 #include "wearable_log.h"
+extern DialInfo_1 dialInfo_1[MAX_DIALNUM_1];
+extern int dial_num;
 namespace OHOS
 {
 
+
     // 当前Presenter属性实例化的内存指针
     static DialUpdatePresenter *g_pDialUpdatePresenter = nullptr;
 
@@ -78,19 +81,30 @@ namespace OHOS
     bool DialUpdatePresenter::OnClick(UIView &view, const ClickEvent &event)
     {
         // 切换表盘按键
-        if (strcmp(view.GetViewId(), "button_choose") == 0)
+        // if (strcmp(view.GetViewId(), "button_choose") == 0)
+        // {
+        //     // 检查是否需要更新表盘路径
+        //     uint8_t currentid = g_pdialupdatemodel->GetDialConfigPath();
+        //     if (showid != currentid)
+        //     {
+        //         g_pdialupdatemodel->UpdateDialConfigPath(showid);
+        //     }
+        //     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "filepath:%d || currentPath:%d ", showid, currentid);
+        //     NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TRANSITION_ZOOM);
+        // }
+        // 检查点击的按钮并展示相应的表盘
+        for(int i=0;i<dial_num;i++)
         {
-            // 检查是否需要更新表盘路径
-            uint8_t currentid = g_pdialupdatemodel->GetDialConfigPath();
-            if (showid != currentid)
+            if (strcmp(view.GetViewId(),dialInfo_1[i].title) == 0)
             {
-                g_pdialupdatemodel->UpdateDialConfigPath(showid);
+                g_pdialupdatemodel->UpdateDialConfigPath(i);
+                NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TRANSITION_ZOOM);
+                break;
             }
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "filepath:%d || currentPath:%d ", showid, currentid);
-            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TRANSITION_ZOOM);
+       
+        // {
         }
-        // 检查点击的按钮并展示相应的表盘
-        else if (strcmp(view.GetViewId(), "button_right") == 0)
+        if (strcmp(view.GetViewId(), "button_right") == 0)
         {
             if (showid == MAX_DIALNUM - 1)
             {
index f761606..df9cd3b 100644 (file)
@@ -19,7 +19,8 @@
 #include <string>
 
 extern DialInfo dialInfo[MAX_DIALNUM];
-
+extern DialInfo_1 dialInfo_1[MAX_DIALNUM_1];
+extern int dial_num;
 namespace OHOS
 {
 
@@ -85,153 +86,212 @@ namespace OHOS
 
     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)
-        {
-            container_ = new UIViewGroup();
-            container_->SetPosition(0, 0, 466, 466);
-            container_->SetStyle(STYLE_BACKGROUND_OPA, 0);
-        }
-        /* -------------------------------------------------------------------------- */
-        // Add Label to App
-        if (label1_ == nullptr)
-        {
-            label1_ = new UILabel();
-        }
-        label1_->SetPosition(181, 50);     // widget's left position and top position
-        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(labelStr.c_str());
-        label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
-        label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
-        label1_->SetRollSpeed(0);
-        label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 26);
-
-        // Add to rootView
-        container_->Add(label1_);
-        label1_->SetVisible(true);
-        // Add ImageView to App
-        if (image1_ == nullptr)
-        {
-            image1_ = new UIImageView();
-        }
-        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
-        image1_->SetSrc(dialpath.c_str());
-        // Add to rootView
-        container_->Add(image1_);
-        image1_->SetVisible(true);
+        // /* -------------------------------- 加载展示表盘信息 -------------------------------- */
+        // 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)
+        // {
+        //     container_ = new UICardPage();
+        //     container_->SetPosition(0, 0, 466, 466);
+        //     container_->SetStyle(STYLE_BACKGROUND_OPA, 0);
+        // }
+        // /* -------------------------------------------------------------------------- */
+        // // Add Label to App
+        // if (label1_ == nullptr)
+        // {
+        //     label1_ = new UILabel();
+        // }
+        // label1_->SetPosition(181, 50);     // widget's left position and top position
+        // 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(labelStr.c_str());
+        // label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        // label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        // label1_->SetRollSpeed(0);
+        // label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 26);
 
-        // Add Button to App
-        if (button3_ == nullptr)
-        {
-            button3_ = new UIButton();
-        }
-        button3_->SetPosition(103, 103);      // widget's left position and top position
-        button3_->Resize(260, 260);           // widget's width and height
-        button3_->SetViewId("button_choose"); // Set style
-        button3_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
-        button3_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
-
-        // Set additional property
-        button3_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED);
-        button3_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);
-        button3_->SetStyleForState(STYLE_BORDER_COLOR, 0xfffafafa, UIButton::PRESSED);
-        button3_->SetStyleForState(STYLE_BORDER_OPA, 0x00, UIButton::PRESSED);
-
-        // Add the CallBack about events
-        UIView::OnClickListener *button3Click = static_cast<UIView::OnClickListener *>(DialUpdatePresenter::GetInstance());
-        button3_->SetOnClickListener(button3Click);
-        // Add to rootView
-        container_->Add(button3_);
-        button3_->SetVisible(true);
-
-        // Add Button to App
-        if (button1_ == nullptr)
-        {
-            button1_ = new UIButton();
-        }
-        button1_->SetPosition(402, 208);     // widget's left position and top position
-        button1_->Resize(23, 50);            // widget's width and height
-        button1_->SetViewId("button_right"); // Set style
-        button1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
-        button1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
-
-        // Set additional property
-        char *button1defaultImgSrc = "/user/res/dialupdate/right_boutton.bin";
-
-        char *button1triggeredImgSrc = nullptr;
-        button1_->SetImageSrc(button1defaultImgSrc, button1triggeredImgSrc);
-        button1_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
-
-        // Add the CallBack about events
-        UIView::OnClickListener *button1Click = static_cast<UIView::OnClickListener *>(DialUpdatePresenter::GetInstance());
-        button1_->SetOnClickListener(button1Click);
-        // Add to rootView
-        container_->Add(button1_);
-        button1_->SetVisible(true);
-
-        // Add Button to App
-        if (button2_ == nullptr)
+        // // Add to rootView
+        // container_->Add(label1_);
+        // label1_->SetVisible(true);
+        // // Add ImageView to App
+        // if (image1_ == nullptr)
+        // {
+        //     image1_ = new UIImageView();
+        // }
+        // 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
+        // image1_->SetSrc(dialpath.c_str());
+        // // Add to rootView
+        // container_->Add(image1_);
+        // image1_->SetVisible(true);
+
+        // // Add Button to App
+        // if (button3_ == nullptr)
+        // {
+        //     button3_ = new UIButton();
+        // }
+        // button3_->SetPosition(103, 103);      // widget's left position and top position
+        // button3_->Resize(260, 260);           // widget's width and height
+        // button3_->SetViewId("button_choose"); // Set style
+        // button3_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
+        // button3_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+
+        // // Set additional property
+        // button3_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED);
+        // button3_->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);
+        // button3_->SetStyleForState(STYLE_BORDER_COLOR, 0xfffafafa, UIButton::PRESSED);
+        // button3_->SetStyleForState(STYLE_BORDER_OPA, 0x00, UIButton::PRESSED);
+
+        // // Add the CallBack about events
+        // UIView::OnClickListener *button3Click = static_cast<UIView::OnClickListener *>(DialUpdatePresenter::GetInstance());
+        // button3_->SetOnClickListener(button3Click);
+        // // Add to rootView
+        // container_->Add(button3_);
+        // button3_->SetVisible(true);
+
+        // // Add Button to App
+        // if (button1_ == nullptr)
+        // {
+        //     button1_ = new UIButton();
+        // }
+        // button1_->SetPosition(402, 208);     // widget's left position and top position
+        // button1_->Resize(23, 50);            // widget's width and height
+        // button1_->SetViewId("button_right"); // Set style
+        // button1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
+        // button1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+
+        // // Set additional property
+        // char *button1defaultImgSrc = "/user/res/dialupdate/right_boutton.bin";
+
+        // char *button1triggeredImgSrc = nullptr;
+        // button1_->SetImageSrc(button1defaultImgSrc, button1triggeredImgSrc);
+        // button1_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+
+        // // Add the CallBack about events
+        // UIView::OnClickListener *button1Click = static_cast<UIView::OnClickListener *>(DialUpdatePresenter::GetInstance());
+        // button1_->SetOnClickListener(button1Click);
+        // // Add to rootView
+        // container_->Add(button1_);
+        // button1_->SetVisible(true);
+
+        // // Add Button to App
+        // if (button2_ == nullptr)
+        // {
+        //     button2_ = new UIButton();
+        // }
+        // button2_->SetPosition(40, 208);     // widget's left position and top position
+        // button2_->Resize(23, 50);           // widget's width and height
+        // button2_->SetViewId("button_left"); // Set style
+        // button2_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
+        // button2_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+
+        // // Set additional property
+        // char *button2defaultImgSrc = "/user/res/dialupdate/left_boutton.bin";
+
+        // char *button2triggeredImgSrc = nullptr;
+        // button2_->SetImageSrc(button2defaultImgSrc, button2triggeredImgSrc);
+        // button2_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+
+        // // Add the CallBack about events
+        // UIView::OnClickListener *button2Click = static_cast<UIView::OnClickListener *>(DialUpdatePresenter::GetInstance());
+        // button2_->SetOnClickListener(button2Click);
+        // // Add to rootView
+        // container_->Add(button2_);
+        // button2_->SetVisible(true);
+    }
+
+    UILabelButtonExt* Button[10]={};
+    void DialUpdateView::init_button()
+    {   
+        //read_dial();
+        printf_dial();//dial_num
+        for(int i=0;i<dial_num;i++)
         {
-            button2_ = new UIButton();
+            Button[i] = new UILabelButtonExt();
+            if (Button == nullptr)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemUpgradeButtonExt new fail!");
+            }
+            Button[i]->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetWidth());
+            Button[i]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
+            Button[i]->SetImagePosition(103, 103);
+            Button[i]->SetViewId(dialInfo_1[i].title);
+        //     uint32_t resId=5|( 0xfef << 20);
+        //     //uint32_t resId=1|( 0xfef << 20);
+        //     //ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes((uint8_t*)dialInfo_1[i].dialPath,resId);
+        //     // std::string str="user/res/dials/KUMI.bin";
+        //     // FILE * fp = fopen(dialInfo_1[i].dialPath, "rb");
+        //     // if (fp == nullptr) 
+        //     // {
+        //     //     return;
+        //     // }
+        // //       ImageInfo* LoadOneInMultiRes(uint32_t resId, const std::string& file, FILE* userFP = nullptr,
+        // // bool isLongTerm = false, int offset = 0);
+        //     ImageInfo* image = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId,dialInfo_1[i].thumbnailPath);//,fp,false,dialInfo_1[i].imageOffset);//dialInfo_1[i].dialPath);
+        //     if (image == nullptr) {
+        //         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LoadAppImages %x  %s  fail", resId,dialInfo_1[1].thumbnailPath);
+        //        // return ;
+        //     }
+            //view->SetSrc(image);
+
+            
+            //Button[i]->SetImageSrc(dialInfo_1[i].dialPath,dialInfo_1[i].dialPath);
+            Button[i]->SetImageSrc(dialInfo_1[i].thumbnailPath,dialInfo_1[i].thumbnailPath);
+            Button[i]->SetText(dialInfo_1[i].title);
+            Button[i]->SetAlign(TEXT_ALIGNMENT_CENTER);
+            Button[i]->SetLabelPosition(0, -380);
+            Button[i]->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+            Button[i]->SetStyleForState(STYLE_BORDER_COLOR, Color::Black().full, UIButton::PRESSED);
+            Button[i]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED);
+            UIView::OnClickListener *buttonClick = static_cast<UIView::OnClickListener *>(DialUpdatePresenter::GetInstance());
+            Button[i]->SetOnClickListener(buttonClick);
+        // button2_->SetOnClickListener(button2Click);
+            container_->Add( Button[i]);
         }
-        button2_->SetPosition(40, 208);     // widget's left position and top position
-        button2_->Resize(23, 50);           // widget's width and height
-        button2_->SetViewId("button_left"); // Set style
-        button2_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
-        button2_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
-
-        // Set additional property
-        char *button2defaultImgSrc = "/user/res/dialupdate/left_boutton.bin";
-
-        char *button2triggeredImgSrc = nullptr;
-        button2_->SetImageSrc(button2defaultImgSrc, button2triggeredImgSrc);
-        button2_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
-
-        // Add the CallBack about events
-        UIView::OnClickListener *button2Click = static_cast<UIView::OnClickListener *>(DialUpdatePresenter::GetInstance());
-        button2_->SetOnClickListener(button2Click);
-        // Add to rootView
-        container_->Add(button2_);
-        button2_->SetVisible(true);
+      
+
     }
+    UICardPage *cade[10]={nullptr};
+
+
     void DialUpdateView::OnStart()
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialUpdateView");
         View<DialUpdatePresenter>::OnStart();
         BaseView::RootView(Color::Red().full);
 
-        container_ = new UIViewGroup();
-        container_->SetPosition(0, 0);
-        container_->SetWidth(Screen::GetInstance().GetWidth());
-        container_->SetHeight(Screen::GetInstance().GetHeight());
-
-        // 创建 draglistener 实例并设置为拖动监听器
-        UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(DialUpdatePresenter::GetInstance());
-        if (draglistener == nullptr)
+        if (container_ == nullptr) 
         {
-            return;
+        container_ = new UISwipeView(UISwipeView::HORIZONTAL);
+        container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());
+        container_->SetThrowDrag(true);
+        container_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
+        container_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE);
+        container_->SetBlankSize(0);
+        container_->SetReboundSize(200); // 200: rebound size
+        container_->SetElastic(true);
         }
-        container_->SetOnDragListener(draglistener);
-        container_->SetTouchable(true);
-        container_->SetDraggable(true);
-        // 取到展示表盘id
-        dialId = DialUpdatePresenter::GetInstance()->GetShowId();
-        GetTestView();
+
+
+        init_button();
+
+       
         RootView::GetInstance()->Add(container_);
+
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "mainSwipeGroup new fail");
+
+        //container_->RegisterSwipeCallback(callback);
+     
     }
     void DialUpdateView::OnSetUpView()
     {
index 89e59bb..73d2f93 100644 (file)
@@ -8,7 +8,7 @@
 #include "MainViewSample.h"
 #include "graphic_service.h"
 #include "dialupdate/include/DialUpdateModel.h"
-extern DialInfo dialInfo[MAX_DIALNUM];
+extern DialInfo_1 dialInfo_1[MAX_DIALNUM_1];
 namespace OHOS
 {
 
@@ -340,8 +340,9 @@ namespace OHOS
         }
 #endif
         // DialUpdateModel::GetInstance()->LoadDialConfigFromJson();
+        //read_dial();
         uint8_t fileid = DialUpdateModel::GetInstance()->GetDialConfigPath();
-        std::string filePath = dialInfo[fileid].dialPath;
+        std::string filePath = dialInfo_1[fileid].dialPath;
         mainClockView->SetDial(filePath);
 
 #else
index c2e5252..d17afe7 100755 (executable)
@@ -94,7 +94,7 @@ PhoneCallInfo *phoneCall = NULL;
 //     unsigned char nameLen;
 //     unsigned char tel[MAX_PHONE_NUM];
 //     unsigned char telLen;
-     CallFinishStatus status;
+ //    CallFinishStatus status;
 //     uint64 creationTime; // 通话创建时间(不是接通时间)
 //     uint64 callDurTime; // 通话持续时间
 // } CallLogInfo;