音乐播放器声音设置视图在slider上增加一张图片
author罗正yun <1732036298@qq.com>
Fri, 5 Jan 2024 01:49:58 +0000 (09:49 +0800)
committer罗正yun <1732036298@qq.com>
Fri, 5 Jan 2024 01:49:58 +0000 (09:49 +0800)
code/sdk/application/wearable/nativeapp/nativeui/main/include/VolumeSettingView.h
code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingView.cpp

index 365ced2..659204f 100755 (executable)
@@ -11,6 +11,7 @@
 #include "components/ui_button.h"\r
 #include "components/ui_view_group.h"\r
 #include "components/ui_slider.h"\r
+#include "components/ui_image_view.h"\r
 #include "PlayersView.h"\r
 #include "BaseView.h"\r
 #include "wearable_log.h"\r
@@ -34,6 +35,7 @@ public:
 private:\r
     VolumeSliderEventListener *listener{nullptr};\r
     UISlider *progress{nullptr};\r
+    UIImageView* VolumeVetor = nullptr;\r
     UIButton *increaseButton{nullptr};\r
     UIButton *decreaseButton{nullptr};\r
     int ShowVolume();\r
index afb1e1b..7676c7d 100755 (executable)
@@ -40,6 +40,9 @@ VolumeSettingView::~VolumeSettingView()
         delete click;\r
         click = nullptr;\r
     }\r
+    delete VolumeVetor;\r
+    VolumeVetor = nullptr;\r
+    \r
     delete increaseButton;\r
     increaseButton = nullptr;\r
 \r
@@ -83,6 +86,17 @@ bool VolumeSettingView::SetUpVolume(void)
     progress->SetSliderColor(Color::GetColorFromRGBA(0x19, 0x19, 0x19, 0xff), Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0xff));\r
     progress->SetForegroundStyle(STYLE_BACKGROUND_OPA, 0xff);\r
 \r
+    if(VolumeVetor == nullptr)\r
+    {\r
+        VolumeVetor = new UIImageView();\r
+        if (progress == nullptr) {\r
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VolumeVetor new fail");\r
+            return false;\r
+        }\r
+    }\r
+    VolumeVetor->SetPosition(213, 213,40,40);\r
+    VolumeVetor->SetSrc("/user/res/VolumeControlVector.bin");\r
+\r
     if (listener == nullptr) {\r
         listener = new VolumeSliderEventListener();\r
         if (listener == nullptr) {\r
@@ -100,6 +114,7 @@ bool VolumeSettingView::SetUpVolume(void)
     SetDraggable(true);\r
     SetTouchable(true);\r
     Add(progress);\r
+    Add(VolumeVetor);\r
     ShowVolume();\r
 \r
     return true;\r