From: xue <2144439972@qq.com> Date: Thu, 13 Nov 2025 08:34:28 +0000 (+0800) Subject: 优化电量显示 X-Git-Tag: V1.0.9_20251128_194606_LN~65^2~7 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=eab94cd8f24e954aaf2f2a18f16f4116772b432d;p=mirrors%2FFD230.git 优化电量显示 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp index 2d5ae251c..0b613ba51 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp @@ -787,8 +787,20 @@ namespace OHOS } } + hairIcon = new UIImageView(); + if (hairIcon == nullptr) + { + GRAPHIC_LOGE("hairIcon is nullptr\n"); + return; + } + hairIcon->SetAutoEnable(false); + hairIcon->SetPosition(0, 0, 360, 360); + hairIcon->SetResizeMode(UIImageView::COVER); + hairIcon->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + hairIcon->SetVisible(false); ScrollView_->Add(surfaceView_); ScrollView_->Add(curFace); + ScrollView_->Add(hairIcon);//图层逻辑:(从下往上)surfaceView_(视频) -> curFace(头发) -> hairIcon(头发图标) } void ThunderBirdMainView::SwitchHair(const char *hairPath) @@ -799,6 +811,24 @@ namespace OHOS curFace->SetSrc(hairPath); curFace->Invalidate(); } + void ThunderBirdMainView::SwitchHairIcon(const char *hairIconPath) + { + if (hairIcon == nullptr || hairIconPath == nullptr) { + return; + } + hairIcon->SetSrc(hairIconPath); + hairIcon->SetVisible(true); + hairIcon->Invalidate(); + } + + void ThunderBirdMainView::StopHairIcon(void) + { + if (hairIcon == nullptr) { + return; + } + hairIcon->SetVisible(false); + hairIcon->Invalidate(); + } //获取是否开启屏保模式 bool ThunderBirdMainView::GetIsOpenScreenImageModel(void) @@ -1003,8 +1033,8 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "progress new fail"); return nullptr; } - progress->SetPosition(batteryimage->GetX() + 5, batteryimage->GetY() + 4, 18, 12); - progress->SetValidWidth(18); + progress->SetPosition(batteryimage->GetX() + 5, batteryimage->GetY() + 4, 20 ,12); + progress->SetValidWidth(20); progress->SetValidHeight(12); progress->SetRange(100, 0); progress->SetStyle(STYLE_BORDER_RADIUS, 3);