uisample文件夹更新
authorluozheng <1732036298@qq.com>
Tue, 28 May 2024 11:49:39 +0000 (19:49 +0800)
committerluozheng <1732036298@qq.com>
Tue, 28 May 2024 11:49:39 +0000 (19:49 +0800)
code/sdk/application/wearable/fd230app/nativeui/uisample/include/UISampleModel.h
code/sdk/application/wearable/fd230app/nativeui/uisample/include/UISamplePresenter.h
code/sdk/application/wearable/fd230app/nativeui/uisample/include/UISampleView.h
code/sdk/application/wearable/fd230app/nativeui/uisample/src/UISamplePresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/uisample/src/UISampleView.cpp
code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/include/test_case_list_adapter.h
code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/include/ui_test.h
code/sdk/application/wearable/fd230app/nativeui/uisample/uitest/framework/src/ui_test_group.cpp

index 556d8fc..45028ca 100644 (file)
@@ -11,8 +11,6 @@
 #include <cstdint>
 #include <map>
 #include "AppViewIDs.h"
-#include "components/ui_label_ext.h"
-#include"language/font/ui_resource_string.h"
 #include "UiConfig.h"
 #include "UISamplePresenter.h"
 
@@ -26,7 +24,6 @@ namespace OHOS {
         UISampleModel(const UISampleModel &);
         UISampleModel &operator=(const UISampleModel &);
         virtual ~UISampleModel();
-
     };
 }
 
index 2272d09..821544b 100644 (file)
@@ -19,18 +19,17 @@ class UISamplePresenter : public Presenter<UISampleView>,
                          public UIView::OnDragListener {
 public:
     UISamplePresenter();
-    virtual ~UISamplePresenter();
+    ~UISamplePresenter() override;
 
-    virtual void OnStart() override;
-    virtual void OnResume() override;
-    virtual void OnStop() override;
+    void OnStart() override;
+    void OnResume() override;
+    void OnStop() override;
 
     bool OnClick(UIView &view, const ClickEvent &event) override;
-    virtual bool OnDrag(UIView& view, const DragEvent& event) override;
+    bool OnDrag(UIView& view, const DragEvent& event) override;
 
 private:
     UISampleModel *uisampleModel;
-
 };
 }
 
index ff130de..6009abb 100644 (file)
@@ -13,7 +13,6 @@
 #include "components/ui_view_group.h"
 #include "components/ui_scroll_view.h"
 #include "components/ui_label.h"
-#include "components/ui_label_ext.h"
 #include "components/ui_list.h"
 #include "window/window.h"
 #include "BaseView.h"
@@ -27,9 +26,9 @@ class UISamplePresenter;
 class UISampleOnDragListener : public UIView::OnDragListener {
 public:
     UISampleOnDragListener() {}
-    virtual ~UISampleOnDragListener() {}
+    ~UISampleOnDragListener() override {}
 
-    bool OnDrag(UIView& view, const DragEvent& event)
+    bool OnDrag(UIView& view, const DragEvent& event) override
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UISampleOnDragListener::OnDrag");
         UNUSED(view);
@@ -45,7 +44,7 @@ public:
 class UISampleView : public View<UISamplePresenter> {
 public:
     UISampleView();
-    virtual ~UISampleView();
+    ~UISampleView();
 
     static UISampleView *GetInstance()
     {
@@ -53,10 +52,10 @@ public:
         return &instance;
     }
 
-    virtual void OnStart() override;
-    virtual void OnSetUpView() override;
-    virtual void OnTearDownView() override;
-    virtual void OnStop() override;
+    void OnStart() override;
+    void OnSetUpView() override;
+    void OnTearDownView() override;
+    void OnStop() override;
     void InitView();
 
 private:
index 4d57d3f..7037c35 100644 (file)
@@ -8,9 +8,7 @@
 #include "UISampleView.h"
 #include "UISampleModel.h"
 #include "UISamplePresenter.h"
-#if defined(SUPPORT_POWER_MANAGER)
-#include "power_display_service.h"
-#endif
+#include "ui_service.h"
 
 namespace OHOS {
     UISamplePresenter::UISamplePresenter()
@@ -23,29 +21,17 @@ namespace OHOS {
 
     void UISamplePresenter::OnStart()
     {
-#if defined(SUPPORT_POWER_MANAGER)
-        const power_display_svr_api_t *display_api = power_display_svr_get_api();
-        if (display_api->get_screen_state() != SCREEN_ON) {
-            display_api->turn_on_screen();
-        }
-        display_api->set_screen_set_keepon_timeout(-1);
-#endif
         Presenter<UISampleView>::OnStart();
+        SendMsgToUIService(UI_ADD_SLEEP_VETO, 0, nullptr, 0);
     }
 
     void UISamplePresenter::OnResume(void)
     {
-        if (view_ == nullptr) {
-            return;
-        }
     }
 
     void UISamplePresenter::OnStop(void)
     {
-#if defined(SUPPORT_POWER_MANAGER)
-        const power_display_svr_api_t *display_api = power_display_svr_get_api();
-        display_api->set_screen_set_keepon_timeout(0);
-#endif
+        SendMsgToUIService(UI_RM_SLEEP_VETO, 0, nullptr, 0);
         return;
     }
 
@@ -53,7 +39,7 @@ namespace OHOS {
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UISamplePresenter::OnDrag");
         UNUSED(view);
-               UNUSED(event);
+        UNUSED(event);
         return false;
     }
 
@@ -61,7 +47,7 @@ namespace OHOS {
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UISamplePresenter::OnDrag");
         UNUSED(view);
-               UNUSED(event);
-               return true; 
+        UNUSED(event);
+        return true;
     }
 }
index afff383..40fbc7f 100644 (file)
@@ -30,6 +30,7 @@ void UISampleView::InitView()
         mainList_->SetThrowDrag(true);
         mainList_->SetReboundSize(100); // 100: rebound size
         mainList_->SetElastic(true);
+        mainList_->SetYScrollBarVisible(true);
         adapter_ = new TestCaseListAdapter();
         UITestGroup::GetInstance()->SetUpTestCase();
         mainList_->SetAdapter(adapter_);
@@ -95,5 +96,4 @@ void UISampleView::OnStop()
     View<UISamplePresenter>::OnStop();
     return;
 }
-
 }
index 786e392..3e4da3c 100644 (file)
 #include "ui_test_countdown/ui_test_countdown.h"
 #include "ui_test_running_ball/ui_test_running_ball.h"
 #endif
+#if ENABLE_SOFT_KEYBOARD
+#include "ui_test_keyboard/ui_test_keyboard.h"
+#endif
 #include "ui_test_tiger/ui_test_tiger.h"
+#include "ui_test_hexagons_list/ui_test_hexagons_list.h"
 #include "ui_test_video_play/ui_test_video_play.h"
+#include "ui_test_coverflow/ui_test_coverflow.h"
+#include "ui_test_kaleidoscope/ui_test_kaleidoscope.h"
 
 namespace OHOS {
 void UITestGroup::AddTestCase(TestCaseInfo testCaseInfo)
@@ -44,17 +50,23 @@ void UITestGroup::SetUpTestCase()
     }
     testCaseList_->Clear();
     testCaseList_->PushBack(TestCaseInfo{"老虎头", new UITestTiger()});
+    testCaseList_->PushBack(TestCaseInfo{"蜂窝表盘", new UITestHexagonsList()});
     testCaseList_->PushBack(TestCaseInfo{"滑动列表", new UITestListFPS()});
     testCaseList_->PushBack(TestCaseInfo{"卡片切换", new UITestCardSwitch()});
     testCaseList_->PushBack(TestCaseInfo{"立方体旋转", new UITestCubeRotate()});
     testCaseList_->PushBack(TestCaseInfo{"消息", new UITestMessage()});
     testCaseList_->PushBack(TestCaseInfo{"呼吸效果", new UITestBreath()});
+    testCaseList_->PushBack(TestCaseInfo{"覆盖流", new UITestCoverflow()});
+    testCaseList_->PushBack(TestCaseInfo{"万花筒", new UITestKaleidoscope()});
 
 #if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH
     testCaseList_->PushBack(TestCaseInfo{"倒计时", new UITestCountdown()});
     testCaseList_->PushBack(TestCaseInfo{"动画曲线", new UITestRunningBall()});
 #endif
-    //testCaseList_->PushBack(TestCaseInfo{"视频播放", new UITestVideoPlay()});
+#if ENABLE_SOFT_KEYBOARD
+    testCaseList_->PushBack(TestCaseInfo{"软键盘", new UITestKeyboard()});
+#endif
+    testCaseList_->PushBack(TestCaseInfo{"视频播放", new UITestVideoPlay()});
 }
 
 List<TestCaseInfo>& UITestGroup::GetTestCase()