解决AI解决滑动切换模型顺序错误问题
authorluozheng <1732036298@qq.com>
Mon, 26 May 2025 08:27:21 +0000 (16:27 +0800)
committerluozheng <1732036298@qq.com>
Mon, 26 May 2025 08:27:21 +0000 (16:27 +0800)
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp

index 233dbeb..9a8bd33 100644 (file)
@@ -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);