From: luozheng <1732036298@qq.com> Date: Wed, 21 Aug 2024 10:13:12 +0000 (+0800) Subject: 修改进入AI的按键逻辑,现在已经确定是(不在AI界面)双击进入AI,单击切换模型(在AI界面) X-Git-Tag: release_V1.2.70_20241020_135402~613 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=664e6a0bff691eea8f8eaafc88e5fa3d38cc5427;p=mirrors%2FFD230.git 修改进入AI的按键逻辑,现在已经确定是(不在AI界面)双击进入AI,单击切换模型(在AI界面) --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp index 022480291..d2f7fb326 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-07-18 14:55:27 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-15 16:22:03 + * @LastEditTime: 2024-08-21 18:02:08 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp */ @@ -174,17 +174,13 @@ namespace OHOS /* -------------------------------------------------------------------------- */ display_api->turn_on_screen(); /* -------------------------------------------------------------------------- */ - if(display_api->get_screen_state() == SCREEN_ON) + if (display_api->get_screen_state() == SCREEN_ON) { uint16_t curSliceId = NativeAbility::GetInstance().GetCurSliceId(); - if (curSliceId == VIEW_AI_VOICE) // 如果当前已在ai语音界面不做切换 + if (curSliceId == VIEW_AI_VOICE) // 如果当前已在ai语音界面就切换模型 { AiVoiceModel::GetInstance().FunctionKeyOnClickToChangeAIModel(); } - else - { - NativeAbility::GetInstance().EnterSlice(VIEW_AI_VOICE); // 切换到Ai语音界面 - } } return; @@ -351,8 +347,11 @@ namespace OHOS } if (display_api->get_screen_state() == SCREEN_ON) { - // 切换到显示方式界面 - NativeAbility::GetInstance().EnterSlice(VIEW_AI_MODELS); + uint16_t curSliceId = NativeAbility::GetInstance().GetCurSliceId(); + if (curSliceId != VIEW_AI_VOICE) + { + NativeAbility::GetInstance().EnterSlice(VIEW_AI_VOICE); + } } else { @@ -386,6 +385,6 @@ namespace OHOS RegisterFuncKeyPressEvent(); // RegisterFuncKeyLongPressEvent(); // RegisterFuncKeyClickEvent(); - // RegisterFuncKeyDoubleClickEvent(); + RegisterFuncKeyDoubleClickEvent(); } }