From: 罗正yun <1732036298@qq.com> Date: Fri, 5 Jan 2024 01:49:58 +0000 (+0800) Subject: 音乐播放器声音设置视图在slider上增加一张图片 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=d1aaba4acc03cfd0bdae5e63fe6e6d54cc170906;p=mirrors%2FFD230.git 音乐播放器声音设置视图在slider上增加一张图片 --- diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/VolumeSettingView.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/VolumeSettingView.h index 365ced2c4..659204f55 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/VolumeSettingView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/VolumeSettingView.h @@ -11,6 +11,7 @@ #include "components/ui_button.h" #include "components/ui_view_group.h" #include "components/ui_slider.h" +#include "components/ui_image_view.h" #include "PlayersView.h" #include "BaseView.h" #include "wearable_log.h" @@ -34,6 +35,7 @@ public: private: VolumeSliderEventListener *listener{nullptr}; UISlider *progress{nullptr}; + UIImageView* VolumeVetor = nullptr; UIButton *increaseButton{nullptr}; UIButton *decreaseButton{nullptr}; int ShowVolume(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingView.cpp index afb1e1bd4..7676c7dba 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingView.cpp @@ -40,6 +40,9 @@ VolumeSettingView::~VolumeSettingView() delete click; click = nullptr; } + delete VolumeVetor; + VolumeVetor = nullptr; + delete increaseButton; increaseButton = nullptr; @@ -83,6 +86,17 @@ bool VolumeSettingView::SetUpVolume(void) progress->SetSliderColor(Color::GetColorFromRGBA(0x19, 0x19, 0x19, 0xff), Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0xff)); progress->SetForegroundStyle(STYLE_BACKGROUND_OPA, 0xff); + if(VolumeVetor == nullptr) + { + VolumeVetor = new UIImageView(); + if (progress == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VolumeVetor new fail"); + return false; + } + } + VolumeVetor->SetPosition(213, 213,40,40); + VolumeVetor->SetSrc("/user/res/VolumeControlVector.bin"); + if (listener == nullptr) { listener = new VolumeSliderEventListener(); if (listener == nullptr) { @@ -100,6 +114,7 @@ bool VolumeSettingView::SetUpVolume(void) SetDraggable(true); SetTouchable(true); Add(progress); + Add(VolumeVetor); ShowVolume(); return true;