From: luozheng <1732036298@qq.com> Date: Mon, 26 May 2025 08:27:21 +0000 (+0800) Subject: 解决AI解决滑动切换模型顺序错误问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.js?a=commitdiff_plain;h=40e7e9bc6271ddb5246cb3d62ae1f91697555743;p=mirrors%2FFD230.git 解决AI解决滑动切换模型顺序错误问题 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp index 233dbeb8b..9a8bd3371 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -184,10 +184,10 @@ namespace OHOS { if(view_->GetAiVoiceScrollView(AIVOICE_STARTCHAT_VIEWID) && view_->GetAiVoiceScrollView(AIVOICE_STARTCHAT_VIEWID)->IsVisible() == true) { - int index = model->GetSelectAiModel() + 1; - if (index >= AIMODES_MAX_NUM) + int index = model->GetSelectAiModel() - 1; + if (index < 0) { - index = 0; + index = AIMODES_CHATGPT; } WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::index = %d", index); model->SetSelectAiModel(index); @@ -201,10 +201,10 @@ namespace OHOS { if(view_->GetAiVoiceScrollView(AIVOICE_STARTCHAT_VIEWID) && view_->GetAiVoiceScrollView(AIVOICE_STARTCHAT_VIEWID)->IsVisible() == true) { - int index = model->GetSelectAiModel() - 1; - if (index < 0) + int index = model->GetSelectAiModel() + 1; + if (index >= AIMODES_MAX_NUM) { - index = AIMODES_CHATGPT; + index = 0; } WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::index = %d", index); model->SetSelectAiModel(index);