From: luozheng <1732036298@qq.com> Date: Fri, 26 Jul 2024 09:52:07 +0000 (+0800) Subject: 系统视图优化修改 X-Git-Tag: release_V1.2.70_20241020_135402~743 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=85a545d29718d30b2bd922847e697642e57d1512;p=mirrors%2FFD230.git 系统视图优化修改 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemFactoryResetView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemFactoryResetView.cpp index e0002e5a7..47e63d3a3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemFactoryResetView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemFactoryResetView.cpp @@ -132,6 +132,11 @@ namespace OHOS FactoryResetButtonCheckOff->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); FactoryResetButtonCheckOff->SetImageSrc(PNG_SYSTEM_CHECK_OFF_IMAGE, PNG_SYSTEM_CHECK_OFF_IMAGE); UIView::OnClickListener *FactoryResetButtonCheckOffClick = static_cast(SystemPresenter::GetInstance()); + if(FactoryResetButtonCheckOffClick == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemFactoryResetView::FactoryResetButtonCheckOffClick is nullptr!"); + return nullptr; + } FactoryResetButtonCheckOff->SetOnClickListener(FactoryResetButtonCheckOffClick); /* ------------------------ FactoryResetButtonCheckOn ----------------------- */ FactoryResetButtonCheckOn = new UIButton(); @@ -149,6 +154,11 @@ namespace OHOS FactoryResetButtonCheckOn->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); FactoryResetButtonCheckOn->SetImageSrc(PNG_SYSTEM_CHECK_ON_IMAGE, PNG_SYSTEM_CHECK_ON_IMAGE); UIView::OnClickListener *FactoryResetButtonCheckOnClick = static_cast(SystemPresenter::GetInstance()); + if(FactoryResetButtonCheckOnClick == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemFactoryResetView::FactoryResetButtonCheckOnClick is nullptr!"); + return nullptr; + } FactoryResetButtonCheckOn->SetOnClickListener(FactoryResetButtonCheckOnClick); /* ----------------------------- Add to scroView ---------------------------- */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp index 095d065e0..f45b0725a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp @@ -145,18 +145,21 @@ namespace OHOS {513, STR_SYSTEM_LANGUAGE}, {633, STR_FACTORY_RESET}, }; + labelConfig = { + .left = 90, + .top = 153, + .width = 240, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .textId = STR_ABOUT_WATCH, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, + }; for (int i = 0; i < sizeof(labelSetups) / sizeof(labelSetups[0]); ++i) { - labelConfig = { - .left = 90, - .top = labelSetups[i].y, - .width = 240, - .height = 35, - .fontSize = 30, - .lineHeigh = 35, - .textId = labelSetups[i].textId, - .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, - }; + + labelConfig.top = labelSetups[i].y; + labelConfig.textId = labelSetups[i].textId; SystemViewLabel[i] = SystemViewLabelInit(labelConfig); if (SystemViewLabel[i] == nullptr) { @@ -223,7 +226,7 @@ namespace OHOS SystemScrollView[SYSTEMVIEW]->SetThrowDrag(true); // 设置手指抬起屏幕后是否继续滚动。 SystemScrollView[SYSTEMVIEW]->SetMaxScrollDistance(1000); // 设置手指抬起屏幕后的最大滚动距离。 SystemScrollView[SYSTEMVIEW]->RequestFocus(); - SystemScrollView[SYSTEMVIEW]->SetRotateFactor(true); + SystemScrollView[SYSTEMVIEW]->SetRotateFactor(1.0); SystemScrollView[SYSTEMVIEW]->SetOnDragListener(presenter_); SystemScrollView[SYSTEMVIEW]->SetTouchable(true); SystemScrollView[SYSTEMVIEW]->SetDraggable(true);