static constexpr uint16_t BUTTON_Y2 = 363;
static constexpr uint16_t BUTTON_WIDTH = 90;
static constexpr uint16_t BUTTON_HEIGHT = 90;
-static constexpr uint16_t SLIDER_X = 207;
-static constexpr uint16_t SLIDER_Y = 90;
-static constexpr uint16_t SLIDER_WIDTH = 40;
-static constexpr uint16_t SLIDER_HEIGHT = 274;
+static constexpr uint16_t SLIDER_X = 167;
+static constexpr uint16_t SLIDER_Y = 77;
+static constexpr uint16_t SLIDER_WIDTH = 130;
+static constexpr uint16_t SLIDER_HEIGHT = 310;
constexpr uint16_t VOLUME_OK = 0;
constexpr int16_t VOLUME_ERROR = (-1);
delete listener;
listener = nullptr;
}
- delete increaseButton;
- increaseButton = nullptr;
-
- delete decreaseButton;
- decreaseButton = nullptr;
-
- delete progress;
- progress = nullptr;
+ if(increaseButton) {
+ delete increaseButton;
+ increaseButton = nullptr;
+ }
+ if(decreaseButton) {
+ delete decreaseButton;
+ decreaseButton = nullptr;
+ }
+ if(VolumeVetor!=nullptr)
+ {
+ delete VolumeVetor;
+ VolumeVetor = nullptr;
+ }
+ if(progress!=nullptr){
+ delete progress;
+ progress = nullptr;
+ }
}
bool VolumeSettingView::SetUpVolume(void)
progress->SetDirection(UISlider::Direction::DIR_BOTTOM_TO_TOP);
progress->SetViewId(VOLUME_PROGRESS);
progress->SetRange(VOLUME_MAX, VOLUME_MIN);
+ progress->SetStyle(STYLE_BORDER_RADIUS, 100);
+ progress->SetBackgroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND);
+ progress->SetForegroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND);
+ progress->SetSliderColor(Color::GetColorFromRGBA(0x19, 0x19, 0x19, 0xff), Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0xff));
+ progress->SetForegroundStyle(STYLE_BACKGROUND_OPA, 0xff);
+ progress->RequestFocus();
+ progress->SetRotateFactor(1.0);
+
+ VolumeVetor = new UIImageView();
+ if (VolumeVetor == 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(this);
SetDraggable(true);
SetTouchable(true);
Add(progress);
+ Add(VolumeVetor);
ShowVolume();
return true;
increaseButton->SetImageSrc(image, image);
increaseButton->SetOnClickListener(listener);
Add(increaseButton);
+ increaseButton->SetVisible(false);
if (decreaseButton == nullptr) {
decreaseButton = new UIButton();
image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_DECREASE_BUTTON, PLAYER_IAMGES);
decreaseButton->SetImageSrc(image, image);
decreaseButton->SetOnClickListener(listener);
+ decreaseButton->SetVisible(false);
Add(decreaseButton);
return VOLUME_OK;