bool AiVoicePresenter::ChangeViewAndLogicOperator(int16_t hideView, int16_t showView)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::ChangeViewOperator");
-
+ bool isSameView = (hideView == showView);
+ if (isSameView)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Same view no need to change");
+ return false;
+ }
if (hideView > MAX_AIVOICE_VIEWID)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Overstep ones bounds");
{
if (model->GetSelect4gorbt() == AI_SELECT_4G)
{
- model->cancel_tts_play();
+ // model->cancel_tts_play();
+ dinit_ai_task();
usleep(50000);
}
}
bool AiVoicePresenter::OnRotate(UIView &view, const RotateEvent &event)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnRotateEnd");
- ChangeVolume(view,event);
+ ChangeVolume(view, event);
return true;
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "VolumeProcess new fail");
return false;
}
+ VolumeProcess->SetSliderColor(Color::Gray(), Color::Silver());
+ VolumeProcess->SetPosition(-200, 77, 130, 310);
+ VolumeProcess->SetDirection(UISlider::Direction::DIR_BOTTOM_TO_TOP);
+ VolumeProcess->SetRange(100, 0);
+ VolumeProcess->SetStyle(STYLE_BORDER_RADIUS, 100);
+ VolumeProcess->SetBackgroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND);
+ VolumeProcess->SetForegroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND);
+ VolumeProcess->SetSliderColor(Color::GetColorFromRGBA(0x19, 0x19, 0x19, 0xff), Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0xff));
+ VolumeProcess->SetForegroundStyle(STYLE_BACKGROUND_OPA, 0xff);
+ VolumeProcess->SetKnobStyle(StyleDefault::GetSliderKnobStyle());
+ VolumeProcess->RequestFocus();
+ VolumeProcess->SetRotateFactor(1.0);
+ // VolumeProcess->SetVisible(false);
+ VolumeProcess->SetOnRotateListener(presenter_);
+ container_->Add(VolumeProcess);
}
- VolumeProcess->SetSliderColor(Color::Gray(), Color::Silver());
- VolumeProcess->SetPosition(-200, 77, 130, 310);
- VolumeProcess->SetDirection(UISlider::Direction::DIR_BOTTOM_TO_TOP);
- VolumeProcess->SetRange(100, 0);
- VolumeProcess->SetStyle(STYLE_BORDER_RADIUS, 100);
- VolumeProcess->SetBackgroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND);
- VolumeProcess->SetForegroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND);
- VolumeProcess->SetSliderColor(Color::GetColorFromRGBA(0x19, 0x19, 0x19, 0xff), Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0xff));
- VolumeProcess->SetForegroundStyle(STYLE_BACKGROUND_OPA, 0xff);
- VolumeProcess->SetKnobStyle(StyleDefault::GetSliderKnobStyle());
- VolumeProcess->RequestFocus();
- VolumeProcess->SetRotateFactor(1.0);
- // VolumeProcess->SetVisible(false);
- VolumeProcess->SetOnRotateListener(presenter_);
- container_->Add(VolumeProcess);
return true;
}