}
// 退出语音助手
if (request->msgId == TOPIC_EVENT_ASSISTANT_NOTE) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "退出语音助手\r\n");
- AssistantView *p_AssistantView = AssistantView::GetInstance();
- if (p_AssistantView == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
- " AssistantView::GetInstance fail!");
- return;
- }
- if ((p_AssistantView->GetAssistantScrollView(ASSISTANT_ANSWER_VIEW))
- ->IsVisible() == true &&
- p_AssistantView->GetAssistantScrollView(ASSISTANT_MAIN_VIEW)
- ->IsVisible() == false) {
- p_AssistantView->ChangeView(ASSISTANT_ANSWER_VIEW, ASSISTANT_MAIN_VIEW);
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "退出语音助手成功\r\n");
- }
+ // 界面刷新
+ GraphicService::GetInstance()->PostGraphicEvent(std::bind(
+ &AssistantModel::ChangeToMainView, AssistantModel::GetInstance()));
}
}
#ifdef __cplusplus
}
}
+//语音回答界面->主界面
+bool AssistantModel::ChangeToMainView(void) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "退出语音助手\r\n");
+ AssistantView *p_AssistantView = AssistantView::GetInstance();
+ if (p_AssistantView == nullptr) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " AssistantView::GetInstance fail!");
+ return false;
+ }
+ if ((p_AssistantView->GetAssistantScrollView(ASSISTANT_ANSWER_VIEW))
+ ->IsVisible() == true &&
+ p_AssistantView->GetAssistantScrollView(ASSISTANT_MAIN_VIEW)
+ ->IsVisible() == false) {
+ p_AssistantView->ChangeView(ASSISTANT_ANSWER_VIEW, ASSISTANT_MAIN_VIEW);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "退出语音助手成功\r\n");
+ }
+ return true;
+}
+
} // namespace OHOS
\ No newline at end of file