diff --git a/resources/rk3568/pages/confirm.json b/resources/rk3568/pages/confirm.json index 4a68a8087d000a40dca2e1ad00c28b25bb43dd09..71b69b9f2292df00ad6ee88710173c5df189a748 100644 --- a/resources/rk3568/pages/confirm.json +++ b/resources/rk3568/pages/confirm.json @@ -9,7 +9,11 @@ "bgColor": "#f1f3f5ff", "fontColor": "#000000e6", "align" : "center", - "style" : "normal" + "style" : "normal", + "focusedBgColor": "#f1f3f5ff", + "focusedFontColor": "#000000e6", + "focusable" : false, + "lineBreakMode" : "ellipsis" }, "UIImageView": { "imgCnt" : 1, diff --git a/resources/rk3568/pages/menu.json b/resources/rk3568/pages/menu.json index d2b11fbae7e0605b818e62f2fba5eedab6a5f662..078c2747a5db46638954823dd9fa77447041c82d 100644 --- a/resources/rk3568/pages/menu.json +++ b/resources/rk3568/pages/menu.json @@ -23,7 +23,11 @@ "bgColor": "#f1f3f5ff", "fontColor": "#000000e6", "align" : "center", - "style" : "normal" + "style": "normal", + "focusedBgColor": "#f1f3f5ff", + "focusedFontColor": "#000000e6", + "focusable": false, + "lineBreakMode" : "ellipsis" }, "UIImageView": { "imgCnt" : 1, diff --git a/resources/rk3568/pages/upd.json b/resources/rk3568/pages/upd.json index ed27e99e804416f343db167b6936a0e0589c3dcc..ba88fe0f06d8146058534e549870de4c7c7d4f43 100644 --- a/resources/rk3568/pages/upd.json +++ b/resources/rk3568/pages/upd.json @@ -87,7 +87,11 @@ "bgColor": "#000000ff", "fontColor": "#ffffffe6", "align" : "center", - "style" : "normal" + "style" : "normal", + "focusedBgColor": "#000000ff", + "focusedFontColor": "#ffffffe6", + "focusable": false, + "lineBreakMode" : "ellipsis" }, "UIImageView": { "imgCnt" : 1, diff --git a/services/ui/control/event_listener.cpp b/services/ui/control/event_listener.cpp index 97e583d92118c739e769c94d64e2d3f8139bcc5d..0f7ce6b8da9cd86f32c2b06bfe23319dff7c8d1b 100644 --- a/services/ui/control/event_listener.cpp +++ b/services/ui/control/event_listener.cpp @@ -80,13 +80,31 @@ void CallBackDecorator::CallbackWithGuard(Callback cb, OHOS::UIView &view) } } -bool LabelOnTouchListener::OnRelease(OHOS::UIView &view, [[maybe_unused]] const OHOS::ReleaseEvent &event) +bool LabelOnEventListener::OnClick(OHOS::UIView &view, [[maybe_unused]] const OHOS::ClickEvent &event) { - // wrap cb_ with CallBackDecorator, then call operator()() CallBackDecorator{cb_}(view, cb_.isAsync); return isConsumed_; } +bool LabelOnEventListener::OnPress(OHOS::UIView &view, [[maybe_unused]] const OHOS::PressEvent &event) +{ + KeyListener::SetButtonPressed(true); + return true; +} + +bool LabelOnEventListener::OnRelease(OHOS::UIView &view, [[maybe_unused]] const OHOS::ReleaseEvent &event) +{ + KeyListener::SetButtonPressed(false); + CallBackDecorator{cb_}(view, cb_.isAsync); + return isConsumed_; +} + +bool LabelOnEventListener::OnCancel(OHOS::UIView &view, [[maybe_unused]] const OHOS::CancelEvent &event) +{ + KeyListener::SetButtonPressed(false); + return true; +} + bool BtnOnEventListener::OnClick(OHOS::UIView &view, [[maybe_unused]] const OHOS::ClickEvent &event) { CallBackDecorator{cb_}(view, cb_.isAsync); @@ -160,9 +178,9 @@ bool KeyListener::ProcessPowerKey(OHOS::UIView &view, const OHOS::KeyEvent &even LOG(ERROR) << "focused view is nullptr"; return false; } - // triggering button press event by key only supports label button - if (pView->GetViewType() != OHOS::UI_LABEL_BUTTON) { - LOG(ERROR) << "focused view is not label button"; + // triggering button press event by key supports labelButton and label + if (!((pView->GetViewType() == OHOS::UI_LABEL_BUTTON) || (pView->GetViewType() == OHOS::UI_LABEL))) { + LOG(ERROR) << "focused view is not label button or label"; return false; } int16_t centerX = pView->GetX() + static_cast(static_cast(pView->GetWidth()) >> 1u); diff --git a/services/ui/control/event_listener.h b/services/ui/control/event_listener.h index 1fb01d969a58675258f6f4add438aa5ed8dff8cb..969dee845b82a22ac841ee57c2e5fb88b7348a7a 100644 --- a/services/ui/control/event_listener.h +++ b/services/ui/control/event_listener.h @@ -45,12 +45,15 @@ private: static std::mutex mtx_; }; -class LabelOnTouchListener final : public OHOS::UIView::OnTouchListener { +class LabelOnEventListener final : public OHOS::UIView::OnClickListener, public OHOS::UIView::OnTouchListener { public: - LabelOnTouchListener(Callback cb, bool isConsumed) + LabelOnEventListener(Callback cb, bool isConsumed) : cb_(cb), isConsumed_(isConsumed) {} - ~LabelOnTouchListener() = default; + ~LabelOnEventListener() = default; + bool OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event) override; + bool OnPress(OHOS::UIView &view, const OHOS::PressEvent &event) override; bool OnRelease(OHOS::UIView &view, const OHOS::ReleaseEvent &event) override; + bool OnCancel(OHOS::UIView &view, const OHOS::CancelEvent &event) override; private: Callback cb_; diff --git a/services/ui/control/event_manager.cpp b/services/ui/control/event_manager.cpp index cbb95ffc91b5adedf43acd77fdd694495ff051cb..43839c194a674047e303ee6052ee414db5cd748b 100644 --- a/services/ui/control/event_manager.cpp +++ b/services/ui/control/event_manager.cpp @@ -38,16 +38,21 @@ EventManager &EventManager::GetInstance() return instance; } -void EventManager::Add(const ComInfo &viewId, std::unique_ptr listener) +void EventManager::Add(const ComInfo &viewId, std::unique_ptr listener) { if (!pgMgr_.IsValidCom(viewId)) { LOG(ERROR) << "not an valid view " << viewId; return; } auto com = pgMgr_[viewId.pageId][viewId.comId].As(); - labelOnTouchListener_.push_back(std::move(listener)); + // both click and touch listener + LabelOnEventListener *labelListener = listener.get(); + // save this listener + labelOnClickListener_.push_back(std::move(listener)); + com->SetOnClickListener(labelListener); + // this touch listener used to disable volume key when pressing button com->SetTouchable(true); - com->SetOnTouchListener(labelOnTouchListener_.back().get()); + com->SetOnTouchListener(labelListener); } void EventManager::Add(const ComInfo &viewId, std::unique_ptr listener) @@ -89,9 +94,10 @@ void EventManager::Add(const ComInfo &viewId, EventType evt, Callback cb) switch (evt) { case EventType::CLICKEVENT: Add(viewId, std::make_unique(cb, true)); + Add(viewId, std::make_unique(cb, true)); break; case EventType::TOUCHEVENT: - Add(viewId, std::make_unique(cb, true)); + Add(viewId, std::make_unique(cb, true)); break; case EventType::DRAGEVENT: Add(viewId, std::make_unique(cb, true)); diff --git a/services/ui/control/event_manager.h b/services/ui/control/event_manager.h index 9165b961f415596f810b05c473567f25ff842bba..4a13f3e239b7621b00fab79926268462dd28b26c 100644 --- a/services/ui/control/event_manager.h +++ b/services/ui/control/event_manager.h @@ -32,7 +32,7 @@ public: EventManager(); ~EventManager() = default; static EventManager &GetInstance(); - void Add(const ComInfo &viewId, std::unique_ptr listener); + void Add(const ComInfo &viewId, std::unique_ptr listener); void Add(const ComInfo &viewId, std::unique_ptr listener); void Add(const ComInfo &viewId, std::unique_ptr listener); void Add(const ComInfo &viewId, EventType evt, Callback cb); @@ -40,7 +40,7 @@ public: private: PageManager &pgMgr_; std::unique_ptr helper_ {}; - std::vector> labelOnTouchListener_; + std::vector> labelOnClickListener_; std::vector> btnOnClickListener_; std::vector> btnOnDragListener; }; diff --git a/services/ui/updater_ui_traits.h b/services/ui/updater_ui_traits.h index 3a971a350a08bf9d50bc46893f99ac06fb3b44ae..474b3285f01fe922d43ad1b3fb366cad8d10bf9d 100644 --- a/services/ui/updater_ui_traits.h +++ b/services/ui/updater_ui_traits.h @@ -76,7 +76,11 @@ DEFINE_TRAIT(UxLabelInfo, TextLabelAdapter::COMPONENT_TYPE, (std::string, align), (std::string, fontColor), (std::string, bgColor), - (std::string, style) + (std::string, style), + (std::string, focusedFontColor), + (std::string, focusedBgColor), + (bool, focusable), + (std::string, lineBreakMode) ); DEFINE_TRAIT(UxImageInfo, ImgViewAdapter::COMPONENT_TYPE, diff --git a/services/ui/view/component/text_label_adapter.cpp b/services/ui/view/component/text_label_adapter.cpp index 88ea6068ab4acb9dd459f809df5a65dc69fa8bad..5c94d9ee92ba006075a0c615e7d0695c4561901c 100644 --- a/services/ui/view/component/text_label_adapter.cpp +++ b/services/ui/view/component/text_label_adapter.cpp @@ -13,11 +13,62 @@ * limitations under the License. */ #include "text_label_adapter.h" +#include "dock/focus_manager.h" #include "language/language_ui.h" #include "log/log.h" +#include "page/view_proxy.h" #include "updater_ui_const.h" #include "view_api.h" namespace Updater { +struct TextLabelAdapter::TextLabelOnFocusListener : public OHOS::UIView::OnFocusListener { + DISALLOW_COPY_MOVE(TextLabelOnFocusListener); +public: + TextLabelOnFocusListener(const OHOS::ColorType &focusedFontColor, const OHOS::ColorType &unfocusedFontcolor, + const OHOS::ColorType &focusedBgColor, const OHOS::ColorType &unfocusedBgcolor) + : focusedFontcolor_(focusedFontColor), unfocusedFontcolor_(unfocusedFontcolor), focusedBgcolor_(focusedBgColor), + unfocusedBgcolor_(unfocusedBgcolor) + {} + + ~TextLabelOnFocusListener() {} + + bool OnFocus(OHOS::UIView &view) override + { + TextLabelAdapter *label = nullptr; + if (view.GetViewType() != OHOS::UI_LABEL) { + return false; + } + label = static_cast(&view); + LOG(DEBUG) << "key OnFocus"; + label->SetStyle(OHOS::STYLE_TEXT_COLOR, focusedFontcolor_.full); + label->SetStyle(OHOS::STYLE_BACKGROUND_COLOR, focusedBgcolor_.full); + label->Invalidate(); + return true; + } + + bool OnBlur(OHOS::UIView &view) override + { + TextLabelAdapter *label = nullptr; + if (view.GetViewType() != OHOS::UI_LABEL) { + return false; + } + label = static_cast(&view); + LOG(DEBUG) << "key OnBlur"; + label->SetStyle(OHOS::STYLE_TEXT_COLOR, unfocusedFontcolor_.full); + label->SetStyle(OHOS::STYLE_BACKGROUND_COLOR, unfocusedBgcolor_.full); + label->Invalidate(); + return true; + } +private: + OHOS::ColorType focusedFontcolor_; + OHOS::ColorType unfocusedFontcolor_; + OHOS::ColorType focusedBgcolor_; + OHOS::ColorType unfocusedBgcolor_; +}; + +TextLabelAdapter::TextLabelAdapter() = default; + +TextLabelAdapter::~TextLabelAdapter() = default; + TextLabelAdapter::TextLabelAdapter(const UxViewInfo &info) { const UxLabelInfo &spec = std::get(info.specificInfo); @@ -32,6 +83,19 @@ TextLabelAdapter::TextLabelAdapter(const UxViewInfo &info) auto bgColor = StrToColor(spec.bgColor); this->SetStyle(OHOS::STYLE_BACKGROUND_COLOR, bgColor.full); this->SetStyle(OHOS::STYLE_BACKGROUND_OPA, bgColor.alpha); + if (spec.focusable) { + LOG(DEBUG) << "init focus listener for " << viewId_; + InitFocus(fontColor, bgColor, StrToColor(spec.focusedFontColor), + StrToColor(spec.focusedBgColor)); + } else { + this->SetFocusable(false); + this->SetTouchable(false); + } + + if (spec.lineBreakMode == "marquee") { + this->SetLineBreakMode(OHOS::UILabel::LINE_BREAK_MARQUEE); + this->SetRollSpeed(80); // 80: label roll speed + } } bool TextLabelAdapter::IsValid(const UxLabelInfo &info) @@ -57,4 +121,19 @@ void TextLabelAdapter::SetText(const std::string &txt) } OHOS::UILabel::SetText(txt.c_str()); } + +bool TextLabelAdapter::OnPressEvent(const OHOS::PressEvent &event) +{ + OHOS::FocusManager::GetInstance()->ClearFocus(); + OHOS::FocusManager::GetInstance()->RequestFocus(this); + return UIView::OnPressEvent(event); +} + +void TextLabelAdapter::InitFocus(const OHOS::ColorType &fontColor, const OHOS::ColorType &bgColor, + const OHOS::ColorType &focusedFontColor, const OHOS::ColorType &focusedBgColor) +{ + focusListener_ = std::make_unique(focusedFontColor, fontColor, focusedBgColor, bgColor); + this->SetFocusable(true); + this->SetOnFocusListener(focusListener_.get()); +} } // namespace Updater diff --git a/services/ui/view/component/text_label_adapter.h b/services/ui/view/component/text_label_adapter.h index def8fe53f6089d8f58201a6ece61fbdd56b3df14..caabeb31d3335da3fbdd9dcc7983c5239f59d50b 100644 --- a/services/ui/view/component/text_label_adapter.h +++ b/services/ui/view/component/text_label_adapter.h @@ -27,19 +27,29 @@ struct UxLabelInfo { std::string fontColor; std::string bgColor; std::string style; + std::string focusedFontColor; + std::string focusedBgColor; + bool focusable; + std::string lineBreakMode; }; struct UxViewInfo; class TextLabelAdapter : public OHOS::UILabel, public ComponentCommon { DISALLOW_COPY_MOVE(TextLabelAdapter); + struct TextLabelOnFocusListener; static constexpr uint32_t MAX_FONT_SIZE = 200; public: using SpecificInfoType = UxLabelInfo; static constexpr auto COMPONENT_TYPE = "UILabel"; - TextLabelAdapter() = default; + TextLabelAdapter(); explicit TextLabelAdapter(const UxViewInfo &info); - virtual ~TextLabelAdapter() = default; + virtual ~TextLabelAdapter(); + bool OnPressEvent(const OHOS::PressEvent& event) override; void SetText(const std::string &txt); static bool IsValid(const UxLabelInfo &info); +private: + void InitFocus(const OHOS::ColorType &fontColor, const OHOS::ColorType &bgColor, + const OHOS::ColorType &focusedFontColor, const OHOS::ColorType &focusedBgColor); + std::unique_ptr focusListener_ {}; }; } // namespace Updater #endif diff --git a/test/unittest/test_data/ui/layout/all.json b/test/unittest/test_data/ui/layout/all.json index ba9fd10c4b9a9655108a8056a262c793c596f680..36f327d459be9e44a84b05a7cb6a9d3ba83f6267 100644 --- a/test/unittest/test_data/ui/layout/all.json +++ b/test/unittest/test_data/ui/layout/all.json @@ -15,7 +15,11 @@ "fontSize" : 10, "bgColor" : "#ffffffff", "fontColor" : "#ffffffff", - "style" : "normal" + "style" : "normal", + "focusedBgColor" : "#ffffffff", + "focusedFontColor" : "#ffffffff", + "focusable" : false, + "lineBreakMode" : "ellipsis" }, { "id" : "image_view", diff --git a/test/unittest/test_data/ui/layout/commonInvalid.json b/test/unittest/test_data/ui/layout/commonInvalid.json index 18ec97e96326b95690da199d4c6b1cdc584108e8..883862c0178f2b06f58bd1c993f9c2046d1988f6 100644 --- a/test/unittest/test_data/ui/layout/commonInvalid.json +++ b/test/unittest/test_data/ui/layout/commonInvalid.json @@ -9,7 +9,11 @@ "bgColor" : "#000000ff", "fontColor" : "#ffffffff", "align" : "center", - "style" : "normal" + "style" : "normal", + "focusedBgColor" : "#000000ff", + "focusedFontColor" : "#ffffffff", + "focusable" : false, + "lineBreakMode" : "ellipsis" } }, "coms" : [ diff --git a/test/unittest/test_data/ui/layout/label.json b/test/unittest/test_data/ui/layout/label.json index c202a6b6175aadde3a94ef61460032c74714cbb4..0e586368ec20f69db718f5cb3ae2ab513f5bbd64 100644 --- a/test/unittest/test_data/ui/layout/label.json +++ b/test/unittest/test_data/ui/layout/label.json @@ -16,7 +16,11 @@ "fontSize" : 10, "bgColor" : "#ffffffff", "fontColor" : "#ffffffff", - "style" : "normal" + "style" : "normal", + "focusedBgColor" : "#ffffffff", + "focusedFontColor" : "#ffffffff", + "focusable" : false, + "lineBreakMode" : "ellipsis" } ] } \ No newline at end of file diff --git a/test/unittest/test_data/ui/layout/menu.json b/test/unittest/test_data/ui/layout/menu.json index 8fa63107b28283c98fc31388352bb091fbf821c5..c202d46c1d658b4153c3fb77527e9445a7528dfb 100644 --- a/test/unittest/test_data/ui/layout/menu.json +++ b/test/unittest/test_data/ui/layout/menu.json @@ -9,7 +9,11 @@ "bgColor" : "#000000ff", "fontColor" : "#ffffffff", "align" : "center", - "style" : "normal" + "style" : "normal", + "focusedBgColor" : "#000000ff", + "focusedFontColor" : "#ffffffff", + "focusable" : false, + "lineBreakMode" : "ellipsis" } }, "coms" : [ diff --git a/test/unittest/test_data/ui/layout/typeInvalid.json b/test/unittest/test_data/ui/layout/typeInvalid.json index 0b0fe0e83f61858a3a82cbf43240d77c89aeab1e..1e5dfdaa4397c12ef4c2e9256261340e248c9f93 100644 --- a/test/unittest/test_data/ui/layout/typeInvalid.json +++ b/test/unittest/test_data/ui/layout/typeInvalid.json @@ -9,7 +9,11 @@ "bgColor" : "#000000ff", "fontColor" : "#ffffffff", "align" : "center", - "style" : "normal" + "style" : "normal", + "focusedBgColor" : "#000000ff", + "focusedFontColor" : "#ffffffff", + "focusable" : false, + "lineBreakMode" : "ellipsis" } }, "coms" : [ diff --git a/test/unittest/updater_ui_test/view/ui_component_unittest.cpp b/test/unittest/updater_ui_test/view/ui_component_unittest.cpp index 20911d03281cadb21ea4747cf4cbd94538c3095e..69de97b8dc0a09abc4b4ba02abceced745a99ff6 100644 --- a/test/unittest/updater_ui_test/view/ui_component_unittest.cpp +++ b/test/unittest/updater_ui_test/view/ui_component_unittest.cpp @@ -360,7 +360,8 @@ HWTEST_F(UpdaterUiComponentUnitTest, test_text_label_adapter_is_info_valid, Test HWTEST_F(UpdaterUiComponentUnitTest, test_text_label_adapter_constructor, TestSize.Level0) { constexpr auto labelText = "hello"; - UxLabelInfo specInfo {100, "hello", "center", "#000000ff", "#000000ff", "normal"}; + UxLabelInfo specInfo {100, "hello", "center", "#000000ff", "#000000ff", "normal", + "#000000ff", "#000000ff", false, "ellipsis"}; UxViewCommonInfo commonInfo {0, 0, 0, 0, "id", "UILabel", false}; UxViewInfo info {commonInfo, specInfo}; TextLabelAdapter textLabel {info}; @@ -379,7 +380,8 @@ HWTEST_F(UpdaterUiComponentUnitTest, test_text_label_adapter_constructor, TestSi HWTEST_F(UpdaterUiComponentUnitTest, test_text_label_adapter_set_text, TestSize.Level0) { TextLabelAdapter textLabel {UxViewInfo {{0, 0, 0, 0, "id", "UILabel", false}, - UxLabelInfo {255, "", "", "#000000ff", "#000000ff", "normal"}}}; + UxLabelInfo {255, "", "", "#000000ff", "#000000ff", "normal", + "#000000ff", "#000000ff", false, "ellipsis"}}}; constexpr auto testString = "test text"; textLabel.SetText(testString); EXPECT_STREQ(textLabel.GetText(), testString); diff --git a/test/unittest/updater_ui_test/view/ui_layout_unittest.cpp b/test/unittest/updater_ui_test/view/ui_layout_unittest.cpp index 5f7196964650399a8e236047002ff0e1139413e9..8717fe4a6cb3ae5de0dfd414ec036590098417c6 100644 --- a/test/unittest/updater_ui_test/view/ui_layout_unittest.cpp +++ b/test/unittest/updater_ui_test/view/ui_layout_unittest.cpp @@ -108,7 +108,11 @@ HWTEST_F(UpdaterUiLayoutParserUnitTest, test_label_parser, TestSize.Level0) "center", "#ffffffff", "#ffffffff", - "normal" + "normal", + "#ffffffff", + "#ffffffff", + false, + "ellipsis" } }; EXPECT_EQ(pageInfo.viewInfos[0], expectedLabel); } @@ -151,7 +155,11 @@ HWTEST_F(UpdaterUiLayoutParserUnitTest, test_all, TestSize.Level1) "center", "#ffffffff", "#ffffffff", - "normal" + "normal", + "#ffffffff", + "#ffffffff", + false, + "ellipsis" } }; EXPECT_EQ(pageInfo.viewInfos[0], expectedLabel); @@ -180,7 +188,11 @@ HWTEST_F(UpdaterUiLayoutParserUnitTest, test_all_default, TestSize.Level0) "center", "#ffffffff", "#000000ff", - "normal" + "normal", + "#ffffffff", + "#000000ff", + false, + "ellipsis" } }; expected.commonInfo.visible = false; EXPECT_EQ(expected.commonInfo, pageInfo.viewInfos[0].commonInfo); diff --git a/test/unittest/updater_ui_test/view/ui_page_manager_unittest.cpp b/test/unittest/updater_ui_test/view/ui_page_manager_unittest.cpp index 5466d49814f432da3891348b14a94f9ca3ce93ae..e2c6c4c0f18232fdb6c8326acf885d45736ea6ca 100644 --- a/test/unittest/updater_ui_test/view/ui_page_manager_unittest.cpp +++ b/test/unittest/updater_ui_test/view/ui_page_manager_unittest.cpp @@ -74,7 +74,8 @@ const std::vector UpdaterUiPageManagerUnitTest::pageInfos_ = { UxViewCommonInfo { 300, 400, 600, 200, "label_id_0", "UILabel", true}, UxLabelInfo { - 50, "this is page1", "center", "#ff0000ff", "#000000ff", "normal"}}, + 50, "this is page1", "center", "#ff0000ff", "#000000ff", "normal", + "#ff0000ff", "#000000ff", false, "ellipsis"}}, UxViewInfo { UxViewCommonInfo { 300, 700, 400, 400, "image_view", "UIImageView", false}, @@ -90,7 +91,8 @@ const std::vector UpdaterUiPageManagerUnitTest::pageInfos_ = { UxViewCommonInfo { 300, 400, 600, 200, "label_id_0", "UILabel", true}, UxLabelInfo { - 50, "this is page2", "center", "#00ff00ff", "#000000ff", "normal"}}, + 50, "this is page2", "center", "#00ff00ff", "#000000ff", "normal", + "#00ff00ff", "#000000ff", false, "ellipsis"}}, UxViewInfo { UxViewCommonInfo { 300, 700, 400, 400, "image_view", "UIImageView", false}, @@ -105,7 +107,8 @@ const std::vector UpdaterUiPageManagerUnitTest::pageInfos_ = { UxViewCommonInfo { 300, 400, 600, 200, "label_id_0", "UILabel", true}, UxLabelInfo { - 50, "this is page2", "center", "#0000ffff", "#000000ff", "normal"}}, + 50, "this is page2", "center", "#0000ffff", "#000000ff", "normal", + "#0000ffff", "#000000ff", false, "ellipsis"}}, UxViewInfo { UxViewCommonInfo { 300, 700, 400, 400, "image_view", "UIImageView", false}, @@ -142,7 +145,8 @@ HWTEST_F(UpdaterUiPageManagerUnitTest, test_page_manager_init_failed, TestSize.L UxViewCommonInfo { 300, 400, 600, 200, "label_id_0", "UILabel", true}, UxLabelInfo { - 50, "this is page1", "center", "#ff0ff", "#0", "normal"}}}, {}} + 50, "this is page1", "center", "#ff0ff", "#0", "normal", + "#ff0ff", "#0", false, "ellipsis"}}}, {}} }; EXPECT_FALSE(GetInstance().Init(pageInfo, "page1")); } @@ -156,7 +160,8 @@ HWTEST_F(UpdaterUiPageManagerUnitTest, test_page_manager_init_failed, TestSize.L UxViewCommonInfo { 300, 400, 600, 200, "label_id_0", "UILabel", true}, UxLabelInfo { - 50, "this is page1", "center", "#000000ff", "#000000ff", "normal"}}}, + 50, "this is page1", "center", "#000000ff", "#000000ff", "normal", + "#000000ff", "#000000ff", false, "ellipsis"}}}, {{UxSubPageInfo {"", "#000000ff", {"label_id_0"}}}}}}; EXPECT_FALSE(GetInstance().Init(pageInfo, "page1"));