From dcd9abc48a0a0da1df8566dca6baa988a1955c5a Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Thu, 19 Sep 2024 10:49:41 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3#748,=E5=85=B3=E4=BA=8E?= =?utf8?q?=E6=89=8B=E8=A1=A8=E7=95=8C=E9=9D=A2=EF=BC=8C=E7=BC=96=E7=A0=81?= =?utf8?q?=E5=99=A8=E6=97=8B=E8=BD=AC=E4=B8=8D=E8=B5=B7=E4=BD=9C=E7=94=A8b?= =?utf8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../system/src/SystemAboutTheWatchView.cpp | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemAboutTheWatchView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemAboutTheWatchView.cpp index e6fd4359f..9f8691a0e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemAboutTheWatchView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemAboutTheWatchView.cpp @@ -29,22 +29,22 @@ namespace OHOS { - static constexpr uint16_t SYSTEM_ABOUT_THEWATCH_TITLE_X = 93; - static constexpr uint16_t SYSTEM_ABOUT_THEWATCH_TITLE_Y = 52; - static constexpr uint16_t SYSTEM_ABOUT_THEWATCH_TITLE_W = 280; - static constexpr uint16_t SYSTEM_ABOUT_THEWATCH_TITLE_H = 40; + static constexpr uint16_t SYSTEM_ABOUT_THEWATCH_TITLE_X = 83; + static constexpr uint16_t SYSTEM_ABOUT_THEWATCH_TITLE_Y = 50; + static constexpr uint16_t SYSTEM_ABOUT_THEWATCH_TITLE_W = 300; + static constexpr uint16_t SYSTEM_ABOUT_THEWATCH_TITLE_H = 35; static constexpr uint16_t SYSTEM_ABOUT_THEWATCH_TITLE_FONTSIZE = 30; static constexpr uint16_t SYSTEM_ABOUT_THEWATCH_TITLE_LINEHEIGHT = 35; static constexpr uint16_t TITLE_LABEL_X = 53; static constexpr uint16_t TITLE_LABEL_W = 360; - static constexpr uint16_t TITLE_LABEL_H = 40; + static constexpr uint16_t TITLE_LABEL_H = 35; static constexpr uint16_t TITLE_LABEL_FONTSIZE = 30; static constexpr uint16_t TITLE_LABEL_LINEHEIGHT = 35; static constexpr uint16_t LABEL_X = 33; static constexpr uint16_t LABEL_W = 400; - static constexpr uint16_t LABEL_H = 40; + static constexpr uint16_t LABEL_H = 35; static constexpr uint16_t LABEL_FONTSIZE = 30; static constexpr uint16_t LABEL_LINEHEIGHT = 35; @@ -127,6 +127,7 @@ namespace OHOS delete CyweeVersion; CyweeVersion = nullptr; + FocusManager::GetInstance()->ClearFocus(); delete SystemAboutTheWatchScrollView; SystemAboutTheWatchScrollView = nullptr; } @@ -178,9 +179,15 @@ namespace OHOS SystemAboutTheWatchScrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); SystemAboutTheWatchScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); SystemAboutTheWatchScrollView->SetStyle(STYLE_BORDER_RADIUS, 1294); - SystemAboutTheWatchScrollView->SetScrollBlankSize(TITLE_LABEL_LINEHEIGHT); - SystemAboutTheWatchScrollView->SetReboundSize(50); + SystemAboutTheWatchScrollView->SetScrollBlankSize(30); + SystemAboutTheWatchScrollView->SetReboundSize(30); SystemAboutTheWatchScrollView->SetDirection(1); + SystemAboutTheWatchScrollView->SetThrowDrag(true); + SystemAboutTheWatchScrollView->SetMaxScrollDistance(1000); + SystemAboutTheWatchScrollView->SetSwipeACCLevel(800); /*设置手指抬起屏幕后的补偿距离。*/ + FocusManager::GetInstance()->RequestFocus(SystemAboutTheWatchScrollView); + FocusManager::GetInstance()->RequestFocusByDirection(FOCUS_DIRECTION_UP); + SystemAboutTheWatchScrollView->SetRotateFactor(1.0); UIView::OnDragListener *draglistener = static_cast(SystemPresenter::GetInstance()); if (draglistener == nullptr) { @@ -214,7 +221,7 @@ namespace OHOS .lineHeigh = SYSTEM_ABOUT_THEWATCH_TITLE_LINEHEIGHT, .text = "关于手表", .textId = STR_ABOUT_WATCH, - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; SystemAboutTheWatchTitle = InitLabel_Ext(Config); if (SystemAboutTheWatchTitle == nullptr) @@ -233,7 +240,7 @@ namespace OHOS .lineHeigh = TITLE_LABEL_LINEHEIGHT, .text = "手表名称", .textId = STR_WATCH_NAME, - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; WatchNameTitle = InitLabel_Ext(Config); if (WatchNameTitle == nullptr) @@ -275,7 +282,7 @@ namespace OHOS .lineHeigh = TITLE_LABEL_LINEHEIGHT, .text = "固件版本", .textId = STR_FIRMWARE_VERSION, - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; FirmwareVersionTitle = InitLabel_Ext(Config); if (FirmwareVersionTitle == nullptr) @@ -320,7 +327,7 @@ namespace OHOS .lineHeigh = TITLE_LABEL_LINEHEIGHT, .text = "蓝牙名称", .textId = STR_BLUETOOTH_NAME, - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; BluetoothNameTitle = InitLabel_Ext(Config); if (BluetoothNameTitle == nullptr) @@ -363,7 +370,7 @@ namespace OHOS .lineHeigh = TITLE_LABEL_LINEHEIGHT, .text = "蓝牙地址", .textId = STR_BLUETOOTH_ADDRESS, - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; BluetoothAddressTitle = InitLabel_Ext(Config); if (BluetoothAddressTitle == nullptr) @@ -407,7 +414,7 @@ namespace OHOS .fontSize = TITLE_LABEL_FONTSIZE, .lineHeigh = TITLE_LABEL_LINEHEIGHT, .text = "4G Modem", - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; Network4GTitle = InitLabel(Config); if (Network4GTitle == nullptr) @@ -444,7 +451,7 @@ namespace OHOS .fontSize = TITLE_LABEL_FONTSIZE, .lineHeigh = TITLE_LABEL_LINEHEIGHT, .text = "pyVer", - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; PyVerTitle = InitLabel(Config); if (PyVerTitle == nullptr) @@ -481,7 +488,7 @@ namespace OHOS .fontSize = TITLE_LABEL_FONTSIZE, .lineHeigh = TITLE_LABEL_LINEHEIGHT, .text = "IMEI", - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; IMELTitle = InitLabel(Config); if (IMELTitle == nullptr) @@ -518,7 +525,7 @@ namespace OHOS .fontSize = TITLE_LABEL_FONTSIZE, .lineHeigh = TITLE_LABEL_LINEHEIGHT, .text = "OS Version", - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; FONTTitle = InitLabel(Config); if (FONTTitle == nullptr) @@ -555,7 +562,7 @@ namespace OHOS .fontSize = TITLE_LABEL_FONTSIZE, .lineHeigh = TITLE_LABEL_LINEHEIGHT, .text = "HW Version", - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; HWVERTitle = InitLabel(Config); if (HWVERTitle == nullptr) @@ -592,7 +599,7 @@ namespace OHOS .fontSize = TITLE_LABEL_FONTSIZE, .lineHeigh = TITLE_LABEL_LINEHEIGHT, .text = "Cywee Version", - .lineBreakMode = UILabel::LINE_BREAK_MARQUEE, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; CyweeVersionTitle = InitLabel(Config); if (CyweeVersionTitle == nullptr) -- 2.17.1