表盘切换
authorCaisking <3449750381@qq.com>
Sat, 25 Nov 2023 09:47:48 +0000 (17:47 +0800)
committerCaisking <3449750381@qq.com>
Sat, 25 Nov 2023 09:47:48 +0000 (17:47 +0800)
23 files changed:
code/sdk/application/wearable/nativeapp/CMakeLists.txt
code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h
code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h
code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodErrorPresenter.h [new file with mode: 0644]
code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodErrorView.h [new file with mode: 0644]
code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodNotePresenter.h [new file with mode: 0644]
code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodNoteView.h [new file with mode: 0644]
code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodErrorPresenter.cpp [new file with mode: 0644]
code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodErrorView.cpp [new file with mode: 0644]
code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodNotePresenter.cpp [new file with mode: 0644]
code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodNoteView.cpp [new file with mode: 0644]
code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h
code/sdk/application/wearable/nativeapp/nativeui/main/src/MainSwipeViewGroup.cpp
code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp
code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_api.a
code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_core.a
code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_drv.a
code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_sample.a
code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_vendor.a
code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_sample.a
code/sdk/interim_binary/brandy/libs/gpu/evb_standard/libgpu.a
code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_captuer.a
code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_player.a

index 728cc84..a8d77cd 100644 (file)
@@ -92,6 +92,7 @@ set(SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistPresenter.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/applist/src/ApplistView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/MainClockView.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/clock/src/DialUserView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodOxygenView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodBandoffView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp
index de1c566..8639114 100644 (file)
@@ -109,6 +109,7 @@ typedef enum : uint16_t
     VIEW_SYSTEM_FACTORY_RESET,   // 系统:恢复出厂设置
     VIEW_BRIGHTNESS_CONTROL,     // 亮度调节
     VIEW_SCREEN_DURATION,        // 亮屏时长
+    
     VIEW_MAX_INTER_APP,          // 在此之前添加native应用ID
     VIEW_EXTERN_APP = 0xFFFE,    // 三方应用
     VIEW_INVALIDE_APP = 0xFFFF,
index f33932d..870836f 100644 (file)
@@ -255,7 +255,8 @@ namespace OHOS
     // 血氧
     static constexpr const char *PNG_BLOOD_ERROR_IMAGE = APP_RES_PATH "/Blood/Error.bin";
     static constexpr const char *PNG_BLOOD_NOTE_IMAGE = APP_RES_PATH "/Blood/boutton.bin";
-
+    //表盘切换
+    static constexpr const char *PNG_DIAL_USER_IMAGE = APP_RES_PATH "/Dial/Diallogo.bin";
     static constexpr const char *PNG_PHONE_FINGER_IMAGE = APP_RES_PATH "/Save_Ele/finger.bin";
     static constexpr const char *PNG_VOICE_ASSISTANT_IMAGE01 = APP_RES_PATH "/VOICE_ASSISTANT_01.bin";
     static constexpr const char *PNG_VOICE_ASSISTANT_IMAGE02 = APP_RES_PATH "/VOICE_ASSISTANT_02.bin";
diff --git a/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodErrorPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodErrorPresenter.h
new file mode 100644 (file)
index 0000000..c79028f
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef _BloodError_PRESENTER_H
+#define _BloodError_PRESENTER_H
+
+#include "Presenter.h"
+#include "BloodErrorView.h"
+
+namespace OHOS
+{
+    class BloodErrorView;
+
+    class BloodErrorPresenter : public Presenter<BloodErrorView>,
+                               public UIView::OnClickListener,
+                               public UIView::OnDragListener
+    {
+    public:
+        BloodErrorPresenter();
+        virtual ~BloodErrorPresenter();
+
+        void OnStart() override;
+        void OnPause() override;
+        void OnResume() override;
+        void OnStop() override;
+
+        static BloodErrorPresenter *GetInstance();
+
+    private:
+        // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
+        bool OnClick(UIView &view, const ClickEvent &event) override;
+        bool OnDrag(UIView &view, const DragEvent &event) override;
+    };
+} // namespace OHOS
+
+#endif // SLEEPDETAIL_PRESENTER_H
\ No newline at end of file
diff --git a/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodErrorView.h b/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodErrorView.h
new file mode 100644 (file)
index 0000000..8140621
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef _BloodError_VIEW_H
+#define _BloodError_VIEW_H
+
+#include "BaseView.h"
+#include "View.h"
+#include <ui_scroll_view.h>
+#include "components/ui_view_group.h"
+#include "components/ui_label.h"
+#include "components/ui_image_view.h"
+#include "components/ui_button.h"
+#include "components/ui_image_animator.h"
+#include "components/ui_label_button_ext.h"
+
+#include "BloodErrorPresenter.h"
+namespace OHOS
+{
+#define LABELBUTTONRE "labelButton1"   // 重新检测
+#define LABELBUTTONSTOP "labelButton2" // 停止检测
+
+    class BloodErrorPresenter;
+    class BloodErrorView : public View<BloodErrorPresenter>
+    {
+
+    public:
+        BloodErrorView();
+        virtual ~BloodErrorView();
+        static BloodErrorView *GetInstance(void);
+
+        void OnStart() override;
+        void OnSetUpView() override;
+        void OnTearDownView() override;
+        void OnStop() override;
+        void Init();
+        void DeInit();
+
+        UIView *GetView();
+
+    private:
+        UIView::OnDragListener *draglistener{nullptr};
+        BloodErrorView(BloodErrorView &&) = delete;
+        BloodErrorView &operator=(BloodErrorView &&) = delete;
+
+        UIViewGroup *container_ = nullptr;
+        UIScrollView *scrollView1_ = nullptr;
+        UILabel *label1_ = nullptr;
+        UIImageView *image1_ = nullptr;
+        UILabel *label2_ = nullptr;
+        UILabel *label3_ = nullptr;
+        UILabel *label4_ = nullptr;
+        UIImageView *image2_ = nullptr;
+        UIImageView *image3_ = nullptr;
+        UILabelButtonExt *labelButton1_ = nullptr;
+        UILabelButtonExt *labelButton2_ = nullptr;
+    };
+} // namespace OHOS
+#endif // BloodError_PRESENTER_H
diff --git a/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodNotePresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodNotePresenter.h
new file mode 100644 (file)
index 0000000..1d62525
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef _BloodNote_PRESENTER_H
+#define _BloodNote_PRESENTER_H
+
+#include "Presenter.h"
+#include "BloodNoteView.h"
+
+namespace OHOS
+{
+    class BloodNoteView;
+
+    class BloodNotePresenter : public Presenter<BloodNoteView>,
+                               public UIView::OnClickListener,
+                               public UIView::OnDragListener
+    {
+    public:
+        BloodNotePresenter();
+        virtual ~BloodNotePresenter();
+
+        void OnStart() override;
+        void OnPause() override;
+        void OnResume() override;
+        void OnStop() override;
+
+        static BloodNotePresenter *GetInstance();
+
+    private:
+        // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;
+        bool OnClick(UIView &view, const ClickEvent &event) override;
+        bool OnDrag(UIView &view, const DragEvent &event) override;
+    };
+} // namespace OHOS
+
+#endif // SLEEPDETAIL_PRESENTER_H
\ No newline at end of file
diff --git a/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodNoteView.h b/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodNoteView.h
new file mode 100644 (file)
index 0000000..be20126
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef _BloodNote_VIEW_H
+#define _BloodNote_VIEW_H
+
+#include "BaseView.h"
+#include "View.h"
+#include <ui_scroll_view.h>
+#include "components/ui_view_group.h"
+#include "components/ui_label.h"
+#include "components/ui_image_view.h"
+#include "components/ui_button.h"
+#include "components/ui_image_animator.h"
+#include "components/ui_label_button_ext.h"
+
+#include "BloodNotePresenter.h"
+namespace OHOS
+{
+#define NOTEBUTTON "Button1"   // 退出按键
+
+
+    class BloodNotePresenter;
+    class BloodNoteView : public View<BloodNotePresenter>
+    {
+
+    public:
+        BloodNoteView();
+        virtual ~BloodNoteView();
+        static BloodNoteView *GetInstance(void);
+
+        void OnStart() override;
+        void OnSetUpView() override;
+        void OnTearDownView() override;
+        void OnStop() override;
+        void Init();
+        void DeInit();
+
+        UIView *GetView();
+
+    private:
+        UIView::OnDragListener *draglistener{nullptr};
+        BloodNoteView(BloodNoteView &&) = delete;
+        BloodNoteView &operator=(BloodNoteView &&) = delete;
+
+        UIViewGroup *container_ = nullptr;
+        UILabel *label1_ = nullptr;
+        UIImageView *image1_ = nullptr;
+        UILabel *label3_ = nullptr;
+        UILabel *label2_ = nullptr;
+        UILabel *label4_ = nullptr;
+        UIButton *button1_ = nullptr;
+    };
+} // namespace OHOS
+#endif // BloodNote_PRESENTER_H
diff --git a/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodErrorPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodErrorPresenter.cpp
new file mode 100644 (file)
index 0000000..744a59d
--- /dev/null
@@ -0,0 +1,80 @@
+#include "AppViewIDs.h"
+#include "NativeAbility.h"
+
+#include "/blood/include/BloodErrorPresenter.h"
+
+namespace OHOS
+{
+
+    // 当前Presenter属性实例化的内存指针
+    static BloodErrorPresenter *g_pBloodErrorPresenter = nullptr;
+
+    BloodErrorPresenter::BloodErrorPresenter()
+    {
+
+        g_pBloodErrorPresenter = this;
+    }
+
+    BloodErrorPresenter::~BloodErrorPresenter()
+    {
+
+        g_pBloodErrorPresenter = nullptr;
+    }
+
+    BloodErrorPresenter *BloodErrorPresenter::GetInstance()
+    {
+
+        return g_pBloodErrorPresenter;
+    }
+
+    void BloodErrorPresenter::OnStart()
+    {
+
+        Presenter<BloodErrorView>::OnStart();
+    }
+
+    void BloodErrorPresenter::OnPause(void)
+    {
+
+        Presenter<BloodErrorView>::OnPause();
+    }
+
+    void BloodErrorPresenter::OnResume(void)
+    {
+
+        Presenter<BloodErrorView>::OnResume();
+    }
+
+    void BloodErrorPresenter::OnStop(void)
+    {
+
+        Presenter<BloodErrorView>::OnStop();
+    }
+
+    bool BloodErrorPresenter::OnDrag(UIView &view, const DragEvent &event)
+    {
+
+        // if (event.GetDragDirection() == DragEvent::DIRECTION_RIGHT_TO_LEFT)
+        // {
+        //     printf("draglistene is ok!\n");
+        //     NativeAbility::GetInstance().ChangeSlice(VIEW_PHONE);
+        // }
+        UNUSED(view);
+        return true;
+    }
+
+    bool BloodErrorPresenter::OnClick(UIView &view, const ClickEvent &event)
+    {
+        // 根据控件id查找是哪个控件触发了点击回调
+        if (strcmp(view.GetViewId(), LABELBUTTONRE) == 0)
+        {
+            NativeAbility::GetInstance().ChangeSlice(VIEW_BLOODCHECK);
+        }
+        if (strcmp(view.GetViewId(), LABELBUTTONSTOP) == 0)
+        {
+            NativeAbility::GetInstance().ChangeSlice(VIEW_BLOOD);
+        }
+
+        return true;
+    }
+}
\ No newline at end of file
diff --git a/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodErrorView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodErrorView.cpp
new file mode 100644 (file)
index 0000000..4bfba92
--- /dev/null
@@ -0,0 +1,343 @@
+
+
+#include "/blood/include/BloodErrorView.h"
+
+#include "common/image_cache_manager.h"
+#include "UiConfig.h"
+#include "ui_resource_image.h"
+#include <ui_scroll_view.h>
+#include "components/ui_button.h"
+namespace OHOS
+{
+    static BloodErrorView *g_pBloodErrorView{nullptr};
+
+    BloodErrorView::BloodErrorView()
+    {
+
+        g_pBloodErrorView = this;
+    }
+
+    BloodErrorView::~BloodErrorView()
+    {
+        DeInit();
+        g_pBloodErrorView = nullptr;
+    }
+
+    BloodErrorView *BloodErrorView::GetInstance()
+    {
+
+        return g_pBloodErrorView;
+    }
+    void BloodErrorView::Init()
+    {
+        if (container_ == nullptr)
+        {
+            container_ = new UIViewGroup();
+            container_->SetPosition(0, 0, 466, 466);
+            container_->SetStyle(STYLE_BACKGROUND_OPA, 0);
+        }
+
+        // Add ScrollView to App
+        if (scrollView1_ == nullptr)
+        {
+            scrollView1_ = new UIScrollView();
+        }
+        scrollView1_->SetPosition(0, 0);        // widget's left position and top position
+        scrollView1_->Resize(466, 466);         // widget's width and height
+        scrollView1_->SetViewId("scrollView1"); // Set style
+        scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+
+        // Set additional property
+
+        // Add the CallBack about events
+        UIView::OnDragListener *scrollView1Drag = static_cast<UIView::OnDragListener *>(BloodErrorPresenter::GetInstance());
+        scrollView1_->SetOnDragListener(scrollView1Drag);
+        // Add to rootView
+        container_->Add(scrollView1_);
+        scrollView1_->SetVisible(true);
+
+        // Add Label to App
+        if (label1_ == nullptr)
+        {
+            label1_ = new UILabel();
+        }
+        label1_->SetPosition(143, 52); // widget's left position and top position
+        label1_->Resize(180, 35);      // widget's width and height
+        label1_->SetViewId("label1");  // Set style
+        label1_->SetStyle(STYLE_TEXT_FONT, 30);
+
+        // Set additional property
+        label1_->SetText("检测不到结果");
+        label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label1_->SetRollSpeed(0);
+        label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
+        // Add to scrollView1
+        scrollView1_->Add(label1_);
+        label1_->SetVisible(true);
+
+        // Add ImageView to App
+        if (image1_ == nullptr)
+        {
+            image1_ = new UIImageView();
+        }
+        image1_->SetPosition(193, 111); // widget's left position and top position
+        image1_->Resize(80, 80);        // widget's width and height
+        image1_->SetViewId("image1");   // Set style
+
+        // Set additional property
+#ifdef _WIN32
+        char *image1imagesPath = "c:/Users/caiking/project/image_converter_tool/output/Blood/Error.bin";
+#else
+        const char *image1imagesPath = PNG_BLOOD_ERROR_IMAGE;
+#endif
+        image1_->SetSrc(image1imagesPath);
+
+        // Add to scrollView1
+        scrollView1_->Add(image1_);
+        image1_->SetVisible(true);
+
+        // Add Label to App
+        if (label2_ == nullptr)
+        {
+            label2_ = new UILabel();
+        }
+        label2_->SetPosition(58, 208); // widget's left position and top position
+        label2_->Resize(200, 60);      // widget's width and height
+        label2_->SetViewId("label2");  // Set style
+        label2_->SetStyle(STYLE_TEXT_FONT, 30);
+
+        // Set additional property
+        label2_->SetText("请确认已带上手表,并保持");
+        label2_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        label2_->SetTextColor(Color::GetColorFromRGBA(0xcc, 0xcc, 0xcc, 0xff));
+        label2_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label2_->SetRollSpeed(0);
+        label2_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
+        // Add to scrollView1
+        scrollView1_->Add(label2_);
+        label2_->SetVisible(true);
+
+        // Add Label to App
+        if (label3_ == nullptr)
+        {
+            label3_ = new UILabel();
+        }
+        label3_->SetPosition(43, 243); // widget's left position and top position
+        label3_->Resize(200, 60);      // widget's width and height
+        label3_->SetViewId("label3");  // Set style
+        label3_->SetStyle(STYLE_TEXT_FONT, 30);
+
+        // Set additional property
+        label3_->SetText("静止,准备好后点击下方按钮");
+        label3_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        label3_->SetTextColor(Color::GetColorFromRGBA(0xcc, 0xcc, 0xcc, 0xff));
+        label3_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label3_->SetRollSpeed(0);
+        label3_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
+        // Add to scrollView1
+        scrollView1_->Add(label3_);
+        label3_->SetVisible(true);
+
+        // Add Label to App
+        if (label4_ == nullptr)
+        {
+            label4_ = new UILabel();
+        }
+        label4_->SetPosition(148, 278); // widget's left position and top position
+        label4_->Resize(200, 60);       // widget's width and height
+        label4_->SetViewId("label4");   // Set style
+        label4_->SetStyle(STYLE_TEXT_FONT, 30);
+
+        // Set additional property
+        label4_->SetText("进行重新检测");
+        label4_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        label4_->SetTextColor(Color::GetColorFromRGBA(0xcc, 0xcc, 0xcc, 0xff));
+        label4_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label4_->SetRollSpeed(0);
+        label4_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
+        // Add to scrollView1
+        scrollView1_->Add(label4_);
+        label4_->SetVisible(true);
+
+        // Add LabelButtonExt to App
+        if (labelButton1_ == nullptr)
+        {
+            labelButton1_ = new UILabelButtonExt();
+        }
+        labelButton1_->SetPosition(118, 434);      // widget's left position and top position
+        labelButton1_->Resize(230, 80);            // widget's width and height
+        labelButton1_->SetViewId(LABELBUTTONSTOP); // Set style
+        labelButton1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+
+        // Set additional property
+        labelButton1_->SetText("停止检测");
+        labelButton1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 26);
+        labelButton1_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);
+        labelButton1_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+
+        // Add the CallBack about events
+        UIView::OnClickListener *labelButton1Click = static_cast<UIView::OnClickListener *>(BloodErrorPresenter::GetInstance());
+        labelButton1_->SetOnClickListener(labelButton1Click);
+        // Add to scrollView1
+        scrollView1_->Add(labelButton1_);
+        labelButton1_->SetVisible(true);
+
+        // Add LabelButtonExt to App
+        if (labelButton2_ == nullptr)
+        {
+            labelButton2_ = new UILabelButtonExt();
+        }
+        labelButton2_->SetPosition(110, 334);    // widget's left position and top position
+        labelButton2_->Resize(230, 80);          // widget's width and height
+        labelButton2_->SetViewId(LABELBUTTONRE); // Set style
+        labelButton2_->SetStyle(STYLE_BACKGROUND_COLOR, 0xffff8a36);
+
+        // Set additional property
+        labelButton2_->SetText("重新检测");
+        labelButton2_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 26);
+        labelButton2_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+
+        // Add the CallBack about events
+        UIView::OnClickListener *labelButton2Click = static_cast<UIView::OnClickListener *>(BloodErrorPresenter::GetInstance());
+        labelButton2_->SetOnClickListener(labelButton2Click);
+        // Add to scrollView1
+        scrollView1_->Add(labelButton2_);
+        labelButton2_->SetVisible(true);
+        // Add ImageView to App
+        if (image2_ == nullptr)
+        {
+            image2_ = new UIImageView();
+        }
+        image2_->SetPosition(183, 550); // widget's left position and top position
+        image2_->Resize(100, 100);      // widget's width and height
+        image2_->SetViewId("image2");   // Set style
+
+        // Set additional property
+
+        // Add to scrollView1
+        scrollView1_->Add(image2_);
+        image2_->SetVisible(true);
+        // Add ImageView to App
+        if (image3_ == nullptr)
+        {
+            image3_ = new UIImageView();
+        }
+        image3_->SetPosition(183, -100); // widget's left position and top position
+        image3_->Resize(100, 100);       // widget's width and height
+        image3_->SetViewId("image3");    // Set style
+
+        // Set additional property
+
+        // Add to scrollView1
+        scrollView1_->Add(image3_);
+        image3_->SetVisible(true);
+    }
+
+    void BloodErrorView::DeInit()
+    {
+        if (container_ != nullptr)
+        {
+            container_->RemoveAll();
+            delete container_;
+            container_ = nullptr;
+        }
+        if (scrollView1_ != nullptr)
+        {
+            delete scrollView1_;
+            scrollView1_ = nullptr;
+        }
+        if (label1_ != nullptr)
+        {
+            delete label1_;
+            label1_ = nullptr;
+        }
+        if (image1_ != nullptr)
+        {
+            delete image1_;
+            image1_ = nullptr;
+        }
+        if (label2_ != nullptr)
+        {
+            delete label2_;
+            label2_ = nullptr;
+        }
+        if (label3_ != nullptr)
+        {
+            delete label3_;
+            label3_ = nullptr;
+        }
+        if (label4_ != nullptr)
+        {
+            delete label4_;
+            label4_ = nullptr;
+        }
+        if (labelButton1_ != nullptr)
+        {
+            delete labelButton1_;
+            labelButton1_ = nullptr;
+        }
+        if (labelButton2_ != nullptr)
+        {
+            delete labelButton2_;
+            labelButton2_ = nullptr;
+        }
+    }
+
+    UIView *BloodErrorView::GetView()
+    {
+        Init();
+        return container_;
+    }
+
+    void BloodErrorView::OnStart()
+    {
+        container_ = new UIViewGroup();
+        if (container_ == nullptr)
+        {
+            return;
+        }
+        container_->SetPosition(0, 0);
+        container_->SetWidth(Screen::GetInstance().GetWidth());
+        container_->SetHeight(Screen::GetInstance().GetHeight());
+
+        // 创建 draglistener 实例并设置为拖动监听器
+        UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(BloodErrorPresenter::GetInstance());
+        if (draglistener == nullptr)
+        {
+            return;
+        }
+        container_->SetOnDragListener(draglistener);
+
+        container_->SetTouchable(true);
+        container_->SetDraggable(true);
+
+        GetView();
+        RootView::GetInstance()->Add(container_);
+    }
+
+    void BloodErrorView::OnSetUpView()
+    {
+
+        View<BloodErrorPresenter>::OnSetUpView();
+        Draw();
+    }
+
+    void BloodErrorView::OnTearDownView()
+    {
+
+        View<BloodErrorPresenter>::OnTearDownView();
+        return;
+    }
+
+    void BloodErrorView::OnStop()
+    {
+        View<BloodErrorPresenter>::OnStop();
+        RootView::GetInstance()->RemoveAll();
+        return;
+    }
+}
diff --git a/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodNotePresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodNotePresenter.cpp
new file mode 100644 (file)
index 0000000..870bfc7
--- /dev/null
@@ -0,0 +1,76 @@
+#include "AppViewIDs.h"
+#include "NativeAbility.h"
+
+#include "/blood/include/BloodNotePresenter.h"
+
+namespace OHOS
+{
+
+    // 当前Presenter属性实例化的内存指针
+    static BloodNotePresenter *g_pBloodNotePresenter = nullptr;
+
+    BloodNotePresenter::BloodNotePresenter()
+    {
+
+        g_pBloodNotePresenter = this;
+    }
+
+    BloodNotePresenter::~BloodNotePresenter()
+    {
+
+        g_pBloodNotePresenter = nullptr;
+    }
+
+    BloodNotePresenter *BloodNotePresenter::GetInstance()
+    {
+
+        return g_pBloodNotePresenter;
+    }
+
+    void BloodNotePresenter::OnStart()
+    {
+
+        Presenter<BloodNoteView>::OnStart();
+    }
+
+    void BloodNotePresenter::OnPause(void)
+    {
+
+        Presenter<BloodNoteView>::OnPause();
+    }
+
+    void BloodNotePresenter::OnResume(void)
+    {
+
+        Presenter<BloodNoteView>::OnResume();
+    }
+
+    void BloodNotePresenter::OnStop(void)
+    {
+
+        Presenter<BloodNoteView>::OnStop();
+    }
+
+    bool BloodNotePresenter::OnDrag(UIView &view, const DragEvent &event)
+    {
+
+        // if (event.GetDragDirection() == DragEvent::DIRECTION_RIGHT_TO_LEFT)
+        // {
+        //     printf("draglistene is ok!\n");
+        //     NativeAbility::GetInstance().ChangeSlice(VIEW_PHONE);
+        // }
+        UNUSED(view);
+        return true;
+    }
+
+    bool BloodNotePresenter::OnClick(UIView &view, const ClickEvent &event)
+    {
+        // 根据控件id查找是哪个控件触发了点击回调
+        if (strcmp(view.GetViewId(), NOTEBUTTON) == 0)
+        {
+            NativeAbility::GetInstance().ChangeSlice(VIEW_BLOOD);
+        }
+    
+        return true;
+    }
+}
\ No newline at end of file
diff --git a/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodNoteView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodNoteView.cpp
new file mode 100644 (file)
index 0000000..4aa2db7
--- /dev/null
@@ -0,0 +1,268 @@
+
+
+#include "/blood/include/BloodNoteView.h"
+
+#include "common/image_cache_manager.h"
+#include "UiConfig.h"
+#include "ui_resource_image.h"
+#include <ui_scroll_view.h>
+#include "components/ui_button.h"
+namespace OHOS
+{
+    static BloodNoteView *g_pBloodNoteView{nullptr};
+
+    BloodNoteView::BloodNoteView()
+    {
+
+        g_pBloodNoteView = this;
+    }
+
+    BloodNoteView::~BloodNoteView()
+    {
+        DeInit();
+        g_pBloodNoteView = nullptr;
+    }
+
+    BloodNoteView *BloodNoteView::GetInstance()
+    {
+
+        return g_pBloodNoteView;
+    }
+    void BloodNoteView::Init()
+    {
+        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(173, 52); // widget's left position and top position
+        label1_->Resize(200, 60);      // widget's width and height
+        label1_->SetViewId("label1");  // Set style
+        label1_->SetStyle(STYLE_TEXT_FONT, 30);
+
+        // Set additional property
+        label1_->SetText("血氧提醒");
+        label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label1_->SetRollSpeed(0);
+        label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
+        // Add to rootView
+        container_->Add(label1_);
+        label1_->SetVisible(true);
+
+        // Add ImageView to App
+        if (image1_ == nullptr)
+        {
+            image1_ = new UIImageView();
+        }
+        image1_->SetPosition(193, 121); // widget's left position and top position
+        image1_->Resize(100, 100);      // widget's width and height
+        image1_->SetViewId("image1");   // Set style
+
+        // Set additional property
+#ifdef _WIN32
+        char *image1imagesPath = "c:/Users/caiking/project/image_converter_tool/output/Blood/error.bin";
+#else
+        const char *image1imagesPath = PNG_BLOOD_ERROR_IMAGE;
+#endif
+        image1_->SetSrc(image1imagesPath);
+
+        // Add to rootView
+        container_->Add(image1_);
+        image1_->SetVisible(true);
+
+        // Add Label to App
+        if (label3_ == nullptr)
+        {
+            label3_ = new UILabel();
+        }
+        label3_->SetPosition(341, 234); // widget's left position and top position
+        label3_->Resize(200, 60);       // widget's width and height
+        label3_->SetViewId("label3");   // Set style
+        label3_->SetStyle(STYLE_TEXT_FONT, 30);
+
+        // Set additional property
+        label3_->SetText("95%");
+        label3_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        label3_->SetTextColor(Color::GetColorFromRGBA(0xff, 0x8a, 0x36, 0xff));
+        label3_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label3_->SetRollSpeed(0);
+        label3_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
+        // Add to rootView
+        container_->Add(label3_);
+        label3_->SetVisible(true);
+
+        // Add Label to App
+        if (label2_ == nullptr)
+        {
+            label2_ = new UILabel();
+        }
+        label2_->SetPosition(67, 235); // widget's left position and top position
+        label2_->Resize(200, 60);      // widget's width and height
+        label2_->SetViewId("label2");  // Set style
+        label2_->SetStyle(STYLE_TEXT_FONT, 30);
+
+        // Set additional property
+        label2_->SetText("当前血氧含量已低于\n");
+        label2_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        label2_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label2_->SetRollSpeed(0);
+        label2_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
+        // Add to rootView
+        container_->Add(label2_);
+        label2_->SetVisible(true);
+
+        // Add Label to App
+        if (label4_ == nullptr)
+        {
+            label4_ = new UILabel();
+        }
+        label4_->SetPosition(128, 276); // widget's left position and top position
+        label4_->Resize(200, 60);       // widget's width and height
+        label4_->SetViewId("label4");   // Set style
+        label4_->SetStyle(STYLE_TEXT_FONT, 30);
+
+        // Set additional property
+        label4_->SetText("请注意身体健康");
+        label4_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        label4_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label4_->SetRollSpeed(0);
+        label4_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
+        // Add to rootView
+        container_->Add(label4_);
+        label4_->SetVisible(true);
+
+        // Add Button to App
+        if (button1_ == nullptr)
+        {
+            button1_ = new UIButton();
+        }
+        button1_->SetPosition(0, 366); // widget's left position and top position
+        button1_->Resize(466, 100);    // widget's width and height
+        button1_->SetViewId(NOTEBUTTON); // Set style
+        button1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
+        button1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+
+        // Set additional property
+#ifdef _WIN32
+        char *button1defaultImgSrc = "c:/Users/caiking/project/image_converter_tool/output/Blood/boutton.bin";
+#else
+        const char *button1defaultImgSrc = PNG_BLOOD_NOTE_IMAGE;
+#endif
+        char *button1triggeredImgSrc = nullptr;
+        button1_->SetImageSrc(button1defaultImgSrc, button1triggeredImgSrc);
+        button1_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);
+        button1_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+
+        // Add the CallBack about events
+        UIView::OnClickListener *button1Click = static_cast<UIView::OnClickListener *>(BloodNotePresenter::GetInstance());
+        button1_->SetOnClickListener(button1Click);
+        // Add to rootView
+        container_->Add(button1_);
+        button1_->SetVisible(true);
+    }
+
+    void BloodNoteView::DeInit()
+    {
+        if (container_ != nullptr)
+        {
+            container_->RemoveAll();
+            delete container_;
+            container_ = nullptr;
+        }
+        if (label1_ != nullptr)
+        {
+            delete label1_;
+            label1_ = nullptr;
+        }
+        if (image1_ != nullptr)
+        {
+            delete image1_;
+            image1_ = nullptr;
+        }
+        if (label3_ != nullptr)
+        {
+            delete label3_;
+            label3_ = nullptr;
+        }
+        if (label2_ != nullptr)
+        {
+            delete label2_;
+            label2_ = nullptr;
+        }
+        if (label4_ != nullptr)
+        {
+            delete label4_;
+            label4_ = nullptr;
+        }
+        if (button1_ != nullptr)
+        {
+            delete button1_;
+            button1_ = nullptr;
+        }
+    }
+
+    UIView *BloodNoteView::GetView()
+    {
+        Init();
+        return container_;
+    }
+
+    void BloodNoteView::OnStart()
+    {
+        container_ = new UIViewGroup();
+        if (container_ == nullptr)
+        {
+            return;
+        }
+        container_->SetPosition(0, 0);
+        container_->SetWidth(Screen::GetInstance().GetWidth());
+        container_->SetHeight(Screen::GetInstance().GetHeight());
+
+        // 创建 draglistener 实例并设置为拖动监听器
+        UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(BloodNotePresenter::GetInstance());
+        if (draglistener == nullptr)
+        {
+            return;
+        }
+        container_->SetOnDragListener(draglistener);
+
+        container_->SetTouchable(true);
+        container_->SetDraggable(true);
+
+        GetView();
+        RootView::GetInstance()->Add(container_);
+    }
+
+    void BloodNoteView::OnSetUpView()
+    {
+
+        View<BloodNotePresenter>::OnSetUpView();
+        Draw();
+    }
+
+    void BloodNoteView::OnTearDownView()
+    {
+
+        View<BloodNotePresenter>::OnTearDownView();
+        return;
+    }
+
+    void BloodNoteView::OnStop()
+    {
+        View<BloodNotePresenter>::OnStop();
+        RootView::GetInstance()->RemoveAll();
+        return;
+    }
+}
index 5ca62c2..24ef5b7 100644 (file)
@@ -22,6 +22,7 @@
 #include "ActivityWeekView.h"
 #include "CompassControlView.h"
 #include "MainClockView.h"
+#include "DialUserView.h"
 #include "PlayersView.h"
 #include "MainPresenterSample.h"
 #include "HeartRateView.h"
@@ -68,6 +69,7 @@ private:
     UICardPage *messageView{nullptr};
     UILabel *messageLable{nullptr};
     MainClockView *mainClockView{nullptr};
+    DialUserView *dialUserView{nullptr};
     ActivityWeekView *activityWeekView{nullptr};
     PlayersView *playersView{nullptr};
     CompassControlView *compassControlView{nullptr};
index adfa835..0d0803d 100644 (file)
@@ -140,7 +140,7 @@ bool MainSwipeViewGroup::OnDragEndEvent(const DragEvent& event)
     } else if (swipeDirect == VERTICAL_SWIPE) {
         vertical->OnDragEndEvent(event);
         if (vertical->GetCurrentPage() == VER_MAIN_CLOCK_VIEW) {
-            vertical->GetViewByIndex(pullIndex)->ClearBackgroundBlur();
+           vertical->GetViewByIndex(pullIndex)->ClearBackgroundBlur();
             RootView::GetInstance()->Invalidate();
         }
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "vertical->OnDragEndEvent, index: %d", vertical->GetCurrentPage());
index 4c03c18..212b53a 100644 (file)
@@ -245,12 +245,25 @@ void MainViewSample::OnStop()
 
 UICardPage *MainViewSample::InitWatchFacePage(void)
 {
+    #if 0
+    dialUserView = new DialUserView();
+    //dialUserView->PreLoad();
+    if ( dialUserView  == nullptr) {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialUserView new fail");
+        return nullptr;
+    }
+    printf("creat dial succes!!\n");
+    return dialUserView;
+    #endif
+
+    #if 1
     mainClockView = new MainClockView();
     if (mainClockView == nullptr) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView new fail");
         return nullptr;
     }
     return mainClockView;
+    #endif
 }
 
 UICardPage *MainViewSample::InitHeartRatePage(void)
index 6145db3..f7b7b47 100644 (file)
Binary files a/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_api.a and b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_api.a differ
index f7a7bae..735273d 100644 (file)
Binary files a/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_core.a and b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_core.a differ
index dddf258..08f396b 100644 (file)
Binary files a/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_drv.a and b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_drv.a differ
index ea52cf6..ee28250 100644 (file)
Binary files a/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_sample.a and b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_sample.a differ
index cdad8c4..71ac4cd 100644 (file)
Binary files a/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_vendor.a and b/code/sdk/interim_binary/brandy/libs/audio/evb4_standard/liteos/libaudio_vendor.a differ
index 2e5418f..cdfdabd 100644 (file)
Binary files a/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_sample.a and b/code/sdk/interim_binary/brandy/libs/bt/evb_standard/liteos/br/libbt_host_brandy_sample.a differ
index 897f637..eaf693b 100644 (file)
Binary files a/code/sdk/interim_binary/brandy/libs/gpu/evb_standard/libgpu.a and b/code/sdk/interim_binary/brandy/libs/gpu/evb_standard/libgpu.a differ
index 013e449..3334de6 100644 (file)
Binary files a/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_captuer.a and b/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_audio_captuer.a differ
index d619910..340c06d 100644 (file)
Binary files a/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_player.a and b/code/sdk/interim_binary/brandy/libs/media/evb_standard/libjs_player.a differ