From: xue <2144439972@qq.com> Date: Sun, 28 Sep 2025 06:35:19 +0000 (+0800) Subject: 增加对话模式操作 X-Git-Tag: V1.0.9_20251128_194606_LN~305 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=7840367f19b338b740f67982bc009d00370933a8;p=mirrors%2FFD230.git 增加对话模式操作 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h index b4d5acd8b..338fd3431 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h @@ -41,6 +41,7 @@ namespace OHOS bool X_DRAG_FLAG{false}; bool isLullabyRecording{false}; + bool isDialogueing{false};//是否进入对话模式 // 按键处理函数 bool HandlePowerKey(uint16_t keyState, int16_t currentView, int16_t currentSubView, int screenState); diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp index 8ea8c3819..75ada4eb4 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp @@ -154,8 +154,8 @@ namespace OHOS ThunderBirdModel::BindingStatus bindingStatus = ThunderBirdModel::GetInstance()->CheckBindingStatus(); if(bindingStatus == ThunderBirdModel::BindingStatus::BOUND) { - //绑定成功 - ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING); + //绑定成功进入状态显示界面 + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW); } else { @@ -229,26 +229,29 @@ namespace OHOS */ bool ThunderBirdPresenter::HandleFuncKey(uint16_t keyState, int16_t currentView, int16_t currentSubView, int screenState) { - // 长按FUNC键:进入LCD产测 + // 长按FUNC键:开启对话模式切换 if (keyState == InputDevice::STATE_LONG_PRESS && screenState == 0) { - NativeAbility::GetInstance().SwitchSlice(VIEW_LCD_TEST); + //NativeAbility::GetInstance().SwitchSlice(VIEW_LCD_TEST); + if(currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW) + { + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING); + isDialogueing = true; + } + else + { + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW); + isDialogueing = false; + } return true; } // 短按FUNC键(息屏状态下) - if (keyState == InputDevice::STATE_PRESS && screenState == 0) { - // // 检查绑定状态 - // if (ThunderBirdModel::GetInstance()->getbind_status() != true) { - // if (currentSubView != ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3) { - // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3); - // } - // return true; - // } + if (keyState == InputDevice::STATE_PRESS && screenState == 0 ) { if(currentView == THUNDERBIRD_LULLABYVIEW && currentSubView == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_3) { HandleLullabyFunction(currentView, currentSubView); } - else + else if(isDialogueing == true) { // 处理对话功能 HandleDialogueFunction(currentView, currentSubView);