From d1aaba4acc03cfd0bdae5e63fe6e6d54cc170906 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3yun?= <1732036298@qq.com> Date: Fri, 5 Jan 2024 09:49:58 +0800 Subject: [PATCH] =?utf8?q?=E9=9F=B3=E4=B9=90=E6=92=AD=E6=94=BE=E5=99=A8?= =?utf8?q?=E5=A3=B0=E9=9F=B3=E8=AE=BE=E7=BD=AE=E8=A7=86=E5=9B=BE=E5=9C=A8s?= =?utf8?q?lider=E4=B8=8A=E5=A2=9E=E5=8A=A0=E4=B8=80=E5=BC=A0=E5=9B=BE?= =?utf8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/main/include/VolumeSettingView.h | 2 ++ .../nativeui/main/src/VolumeSettingView.cpp | 15 +++++++++++++++ 2 files changed, 17 insertions(+) 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; -- 2.17.1