From: 罗正 <1732036298@qq.com> Date: Thu, 24 Oct 2024 00:17:16 +0000 (+0000) Subject: Merge #1244 into sdk602patch0911 from refs/changes/1244/head X-Git-Tag: fd230_release_V1.3.102~195^2~3 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.js?a=commitdiff_plain;h=998ca1796522b6cb76c8c637144162c46eed7f9f;p=mirrors%2FFD230.git Merge #1244 into sdk602patch0911 from refs/changes/1244/head Code review from 罗正 * refs/changes/1244/head: (19 commits squashed) - 来电界面,禁止双击进入AI - 录音列表视图修改为右滑退出到录音主视图 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - 1.一个分区模式下修改音乐和录音文件夹 2.录音添加空间判断管理 3.录音添加”空间已满弹窗“:在总时长大于20分钟或总数大于等于99,录音总空间大于等于10M,弹出 4.判断录音空间大小是否超出采用指令队列读职 5.修改底层录音文件audio_capture_wrapper.cpp大小参数使之录取一个录音最长时间在20分钟左右 - 修改音乐播放器函数名英文错误拼写 - 如果手表在播放本地音乐,AI界面点击开始对话会暂停本地音乐播放,避免混音 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - 优化查找手表的播放音频逻辑 - 修复录音播放完后等待一段时间再去点击录音播放,需要点击两次bug - 修复音乐播放器在切换到手机音乐无法调节音量bug - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - AI语音界面修改,提示将英文改为中文提醒 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - 实现AI答案恢复,列表同步滚动 - 将power键;亮屏改为release触发 - #477,系统更新界面提示,改成灰色透明弹窗提示,这个不显眼(需求) - 修改applist退出和进入统一动画,只有蜂窝才有 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1244 --- diff --git a/code/sdk/application/brandy/brandy_standard/input_app.c b/code/sdk/application/brandy/brandy_standard/input_app.c index 9e6ebc070..6e582f9a3 100755 --- a/code/sdk/application/brandy/brandy_standard/input_app.c +++ b/code/sdk/application/brandy/brandy_standard/input_app.c @@ -200,6 +200,16 @@ void button_report_event(button_id_t id, event_button_t event) switch (event) { case BUTTON_PWR_PRESS: + // #ifdef SUPPORT_POWER_MANAGER + // if (!lcd_get_status()) { + // button_report_event_to_pms(); + // return; + // } + // button_report_event_to_pms(); + // #endif + button_report_event_to_gui(id, 1); // 1:press + break; + case BUTTON_PWR_CLICKUP: #ifdef SUPPORT_POWER_MANAGER if (!lcd_get_status()) { button_report_event_to_pms(); @@ -207,9 +217,6 @@ void button_report_event(button_id_t id, event_button_t event) } button_report_event_to_pms(); #endif - button_report_event_to_gui(id, 1); // 1:press - break; - case BUTTON_PWR_CLICKUP: button_report_event_to_gui(id, 0); // 0:release break; case BUTTON_PWR_LONGPRESS_3S: diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h index 8768583ce..60257671e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 14:44:22 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-31 16:13:42 + * @LastEditTime: 2024-10-23 11:22:25 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h */ #ifndef AI_VOICE_PRESENTER_H @@ -12,6 +12,7 @@ #include "View.h" #include "ui_resource_string.h" #include "components/ui_time_picker.h" +#include "ModelListenerSample.h" namespace OHOS { class AiVoiceView; @@ -21,7 +22,8 @@ namespace OHOS public UIView::OnDragListener, public RootView::OnKeyActListener, public UIPicker::SelectedListener, - public UIView::OnTouchListener + public UIView::OnTouchListener, + public ModelListenerSample { public: typedef enum : uint8_t @@ -42,6 +44,8 @@ namespace OHOS void OnResume() override; void OnPause() override; void OnStop() override; + void Notify() override; + void calculateChatContentItemViewHeight(std::string text, bool flag); bool JumpToReturnResultTextView(void); bool ChangeToAIVoiceListeningView(bool val); @@ -61,6 +65,9 @@ namespace OHOS AiVoiceModel *model; bool X_DRAG_FLAG{false}; + + int preHeight{0}; + bool isScroll{false}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp index d9bd5e891..35c847da1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:14:50 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-19 18:26:01 + * @LastEditTime: 2024-10-23 14:19:17 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp */ #include "aivoice/include/AiVoiceModel.h" @@ -408,6 +408,8 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetChatContentListCount() - 1 = %d,line = %d", GetChatContentListCount() - 1, __LINE__); // 将更新后的 AI 回答内容添加到列表 adapter->GetChatContentItem().push_back(chatTtems[GetChatContentListCount() - 1]); + if (AiVoicePresenter::GetInstance()) + AiVoicePresenter::GetInstance()->calculateChatContentItemViewHeight(chatTtems[GetChatContentListCount() - 1].text, true); p_AivoiceReturnResultTextView->GetChatContentList()->RefreshList(); } else @@ -474,7 +476,7 @@ namespace OHOS if (errnote.empty()) // 如果没有回应数据 { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::GetErrnote is empty!!"); - AiVoiceModel::GetInstance().SetErrnote("response data is empty"); + AiVoiceModel::GetInstance().SetErrnote("响应内容为空"); std::string str = AiVoiceModel::GetInstance().GetErrnote(); SendMsgToUIService(UI_AI_JUMP_TO_RESPONDERR_VIEW, 0, (void *)str.c_str(), str.length()); return; @@ -619,7 +621,7 @@ namespace OHOS if (Time < 0) // 如果思考时间超时30s,进入连接超时界面 { AiVoiceModel::GetInstance().AIVoice_StopTimer(); - AiVoiceModel::GetInstance().SetErrnote("The connection timed out. Please restart the conversation"); + AiVoiceModel::GetInstance().SetErrnote("连接超时,请重新开始对话"); std::string str = AiVoiceModel::GetInstance().GetErrnote(); SendMsgToUIService(UI_AI_JUMP_TO_RESPONDERR_VIEW, 0, (void *)str.c_str(), str.length()); } @@ -630,7 +632,7 @@ namespace OHOS // 蓝牙的连接状态判断,如果AI思考过程中途断连,直接弹窗提示,不在硬等 if (get_ble_connect() == false) { - AiVoiceModel::GetInstance().SetErrnote("ble is disconnected"); + AiVoiceModel::GetInstance().SetErrnote("手机蓝牙已断开"); std::string str = AiVoiceModel::GetInstance().GetErrnote(); SendMsgToUIService(UI_AI_JUMP_TO_RESPONDERR_VIEW, 0, (void *)str.c_str(), str.length()); } @@ -785,7 +787,7 @@ namespace OHOS void AiVoiceModel::reset_ai_screen60s_timer_time() { SCREEN_60S_TIME = 60; - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "reset_ai_screen60s_timer_time %d",SCREEN_60S_TIME); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "reset_ai_screen60s_timer_time %d", SCREEN_60S_TIME); if (nullptr == g_screen60s_timer) { ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); // 重新常亮屏 @@ -878,7 +880,7 @@ namespace OHOS } static osTimerId_t g_ai_is_ready_Handle = nullptr; // 处理查询AI是否就绪定时器 - static uint8_t AI_IS_READY_TIMEOUT = 5; // 5s钟超时 + static uint8_t AI_IS_READY_TIMEOUT = 5; // 5s钟超时 static void AI_IS_READY_CallbackProc(int data) { if (AI_IS_READY_TIMEOUT <= 0) // 模型连接失败有5秒超时 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 029b81357..998281a51 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:11:17 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-21 18:35:53 + * @LastEditTime: 2024-10-23 15:07:12 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp */ #include "AppViewIDs.h" @@ -102,8 +102,10 @@ namespace OHOS bool AiVoicePresenter::JumpToReturnResultTextView(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::JumpToReturnResultTextView"); - if (view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID) != nullptr && view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID)->IsVisible()) + if (view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID) != nullptr && + view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID)->IsVisible()) { + preHeight = 0; ChangeViewAndLogicOperator(AIVOICE_THINKING_VIEWID, AIVOICE_RETURN_RESULT_TEXT_VIEWID); } else @@ -263,8 +265,8 @@ namespace OHOS { UNUSED(event); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnClick"); - - model->reset_ai_screen60s_timer_time();//重置60s取消常亮屏timer + + model->reset_ai_screen60s_timer_time(); // 重置60s取消常亮屏timer if (strcmp(view.GetViewId(), AIVOICE_IMGAE_VIEW_ID) == 0) /*点击的是Ai模型就切换模型*/ { @@ -478,4 +480,42 @@ namespace OHOS model->SetSelectAiModel(picker.GetSelected()); view_->ChangeAiModelAndUpdateComponentsStatus(); } + + // 计算聊天内容ItemView的高度 + void AiVoicePresenter::calculateChatContentItemViewHeight(std::string text, bool flag) + { + const char *Text = text.c_str(); + UILabel label; + label.SetPosition(53, 100); + label.Resize(flag ? 280 : 200, 60); + label.SetStyle(STYLE_TEXT_FONT, 26); + label.SetStyle(STYLE_LINE_HEIGHT, 30); + label.SetText(Text); + label.SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + label.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label.SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 26); + + if (label.GetTextHeight() > preHeight) + { + preHeight = label.GetTextHeight(); + isScroll = true; + } + return; + } + + //监听高度是否变化 + void AiVoicePresenter::Notify() + { + if ((view_->GetAiVoiceScrollView(AIVOICE_RETURN_RESULT_TEXT_VIEWID) != nullptr) && + (view_->GetAiVoiceScrollView(AIVOICE_RETURN_RESULT_TEXT_VIEWID)->IsVisible())) + { + if (isScroll) + { + // 监听,让List实现滚动 + AivoiceReturnResultTextView::GetInstance()->GetChatContentList()->ScrollBy(-150); + isScroll = false; + } + } + return; + } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceReturnResultTextView.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceReturnResultTextView.cpp index cfdc9a80a..b585e2dc5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceReturnResultTextView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceReturnResultTextView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-05-07 11:25:58 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-01 10:12:28 + * @LastEditTime: 2024-10-23 14:58:03 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AivoiceReturnResultTextView.cpp */ #include "aivoice/include/AiVoicePresenter.h" @@ -248,13 +248,13 @@ namespace OHOS chatContentList->SetTouchable(true); chatContentList->SetDraggable(true); chatContentList->SetThrowDrag(true); - chatContentList->SetReboundSize(REBOUNDSIZE); + // chatContentList->SetReboundSize(REBOUNDSIZE); chatContentList->SetMaxScrollDistance(MAX_SCR_DIS); chatContentList->SetSwipeACCLevel(800); // 800: compensation distance chatContentList->SetDragACCLevel(5); // 5: drag acceleration chatContentList->SetRotateFactor(2); chatContentList->RequestFocus(); - chatContentList->SetIntercept(true); + // chatContentList->SetIntercept(true); chatContentList->SetAdapter(chatContentListAdapter); chatContentList->RefreshList(); /* -------------------------------------------------------------------------- */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmPresenter.cpp index 3cc007351..0b36bf50b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/AlarmPresenter.cpp @@ -543,7 +543,7 @@ void AlarmPresenter::OnSwipe(UISwipeView &view) void AlarmPresenter::UpdateAlarmInfoByAppSet(void) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } void AlarmPresenter::RefreshAlarmStatus(int i) diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp index 5b2a89de2..c65dc36ef 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarm/src/MainAlarmView.cpp @@ -520,6 +520,7 @@ void MainAlarmView::OnSetUpView() if (group != nullptr) { container[0] = group; RootView::GetInstance()->Add(container[0]); + container_ = group; } // show timerView @@ -538,11 +539,11 @@ void MainAlarmView::OnStop() WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainAlarmView::OnStop"); View::OnStop(); - if (container_ != nullptr) { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } + // if (container_ != nullptr) { + // container_->RemoveAll(); + // delete container_; + // container_ = nullptr; + // } group->RemoveAll(); RootView::GetInstance()->ClearOnKeyActListener(); RootView::GetInstance()->RemoveAll(); @@ -775,7 +776,7 @@ void MainAlarmView::DropView(UIView& view) // uint16_t preSlice = AlarmClockModel::GetInstance()->JudgePreSlice(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainAlarmView::DropView::container[MAIN_INTERFACE]"); // NativeAbility::GetInstance().ChangeSlice(preSlice); - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayPresenter.cpp index 9dcbec9f1..f2c9398ba 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayPresenter.cpp @@ -114,7 +114,7 @@ void AlipayPresenter::ClickExitAlipay(UIView &view) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayPresenter::ClickExitAlipay start"); // uint16 preSlice = NativeAbility::GetInstance().GetPreSliceId(); // NativeAbility::GetInstance().ChangeSlice(preSlice); - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); return; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantPresenter.cpp index 7860d80e7..773cc4eeb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantPresenter.cpp @@ -51,7 +51,7 @@ bool AssistantPresenter::OnDrag(UIView &view, const DragEvent &event) { (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) { /*在主界面进行退出*/ if (&view == p_AssistantView->GetAssistantScrollView(ASSISTANT_MAIN_VIEW)) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } /*在其他界面返回主界面*/ if (&view == @@ -132,7 +132,7 @@ bool AssistantPresenter::OnKeyAct(UIView &view, const KeyEvent &event) { // 如果是power键,且是亮屏状态,按键释放就返回上一级 if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionPresenter.cpp index fd8713335..c2a5e36d0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionPresenter.cpp @@ -45,7 +45,7 @@ namespace OHOS } void BloodDetectionPresenter::NavigateBack() { - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } void BloodDetectionPresenter::OnStart() { diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodResultPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodResultPresenter.cpp index dd8b0aeec..78b990497 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodResultPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodResultPresenter.cpp @@ -114,7 +114,7 @@ namespace OHOS if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { // NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); return true; } return false; @@ -128,7 +128,7 @@ namespace OHOS keyState == 1 && uapi_get_screen_state() == 0) { // NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } @@ -143,11 +143,11 @@ namespace OHOS HealthState highHealthState; highHealthState.checkType = CHARGE; HealthService::GetInstance()->SetHealthCurrent(highHealthState); - NativeAbility::GetInstance().ChangeSlice(VIEW_CHECK_INVALID, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_CHECK_INVALID, TransitionType::TRANSITION_BACK_TO_HEXAGONS); } else { - NativeAbility::GetInstance().EnterSlice(VIEW_BLOOD_CHECK, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().EnterSlice(VIEW_BLOOD_CHECK, TransitionType::TRANSITION_BACK_TO_HEXAGONS); } } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodPresenter::OnClick"); diff --git a/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorPresenter.cpp index 43b21ff6f..f6f5c352d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorPresenter.cpp @@ -163,7 +163,7 @@ bool CalculatorPresenter::OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& e if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { if(event.GetPreLastPoint().x-event.GetStartPoint().x>150) - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorView.cpp b/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorView.cpp index ed4bb4ed2..345e5573a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/calculator/src/CalculatorView.cpp @@ -642,6 +642,7 @@ void CalculatorView::OnStart() group->SetOnDragListener(dragListener); RootView::GetInstance()->Add(group); + container_ = group; if(!button_init()) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarPresenter.cpp index a14f3cb0a..7aa81c563 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarPresenter.cpp @@ -71,7 +71,7 @@ bool CalendarPresenter::OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& eve if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { if(event.GetPreLastPoint().x-event.GetStartPoint().x>100) - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } if (event.GetDragDirection() == DragEvent::DIRECTION_BOTTOM_TO_TOP) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarView.cpp b/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarView.cpp index ee3f7319f..c1e87c731 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/calendar/src/CalendarView.cpp @@ -395,6 +395,7 @@ void CalendarView::OnStart() group->SetOnDragListener(dragListener); RootView::GetInstance()->Add(group); + container_ = group; if(!Label_init()) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/flashlight/src/FlashlightPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/flashlight/src/FlashlightPresenter.cpp index 9a8c5c3c2..3b3394d78 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/flashlight/src/FlashlightPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/flashlight/src/FlashlightPresenter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-10 17:32:38 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-10 11:31:51 + * @LastEditTime: 2024-10-23 18:16:39 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/flashligh/src/FlashlightPresenter.cpp */ @@ -184,7 +184,7 @@ namespace OHOS // 如果是power键就返回上一级 if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/goal/src/Maingoalpresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/goal/src/Maingoalpresenter.cpp index 0e9c89970..423680eef 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/goal/src/Maingoalpresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/goal/src/Maingoalpresenter.cpp @@ -75,7 +75,7 @@ namespace OHOS UNUSED(view); if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && MaingoalPresenter::X_DRAG_FLAG) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); X_DRAG_FLAG = false; } return true; @@ -99,7 +99,7 @@ namespace OHOS // 如果是power键就返回上一级 if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/goal/src/Maingoalview.cpp b/code/sdk/application/wearable/fd230app/nativeui/goal/src/Maingoalview.cpp index c4e5ee2f8..61a988fa3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/goal/src/Maingoalview.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/goal/src/Maingoalview.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-05-10 11:31:08 + * @LastEditTime: 2024-10-23 18:23:40 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/MaingoalrView.cpp */ #include "goal/include/Maingoalview.h" @@ -102,7 +102,17 @@ namespace OHOS void MaingoalrView::OnStart() { View::OnStart(); - RootView::GetInstance()->Add(GetGoalPageView()); + SetContainerView(new UIViewGroup()); + if (GetContainer() == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "container_ new fail!!"); + return; + } + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + container_->SetTouchable(true); + container_->SetDraggable(true); + container_->Add(GetGoalPageView()); + // RootView::GetInstance()->Add(GetGoalPageView()); if (goalSwipeViewList != nullptr) { @@ -154,6 +164,12 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MaingoalrView OnStop!!"); View::OnStop(); + if(container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ =nullptr; + } RootView::GetInstance()->ClearOnKeyActListener(); RootView::GetInstance()->RemoveAll(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartChartPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartChartPresenter.cpp index ecbcc8840..0c2e64ee4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartChartPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartChartPresenter.cpp @@ -50,7 +50,7 @@ namespace OHOS } void HeartChartPresenter::NavigateBack() { - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } void HeartChartPresenter::OnStart() { diff --git a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartDetectionPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartDetectionPresenter.cpp index 268e98023..926a9566f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartDetectionPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartDetectionPresenter.cpp @@ -43,7 +43,7 @@ namespace OHOS } void HeartDetectionPresenter::NavigateBack() { - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } void HeartDetectionPresenter::OnStart() { diff --git a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartResultPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartResultPresenter.cpp index 8b1295eb6..20ee45be2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartResultPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartResultPresenter.cpp @@ -107,7 +107,7 @@ namespace OHOS if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { // NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); return true; } return false; @@ -120,7 +120,7 @@ namespace OHOS if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { // NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } @@ -135,11 +135,11 @@ namespace OHOS HealthState highHealthState; highHealthState.checkType = CHARGE; HealthService::GetInstance()->SetHealthCurrent(highHealthState); - NativeAbility::GetInstance().ChangeSlice(VIEW_CHECK_INVALID, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_CHECK_INVALID, TransitionType::TRANSITION_BACK_TO_HEXAGONS); } else { - NativeAbility::GetInstance().EnterSlice(VIEW_HEART_CHECK, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().EnterSlice(VIEW_HEART_CHECK, TransitionType::TRANSITION_BACK_TO_HEXAGONS); } } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartPresenter::OnClick"); diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp index ae92dbe11..de014ea19 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp @@ -82,7 +82,7 @@ namespace OHOS if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } if(event.GetDragDirection() == DragEvent::DIRECTION_TOP_TO_BOTTOM) { @@ -106,7 +106,7 @@ namespace OHOS { // 执行全部删除操作 model->ClearAllMessages(); - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); return true; } @@ -142,7 +142,7 @@ namespace OHOS // 如果是power键,且是亮屏状态,按键释放就返回上一级 if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowPresenter.cpp index 01518048e..485e16539 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageShowPresenter.cpp @@ -92,7 +92,7 @@ namespace OHOS if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { // NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhonePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhonePresenter.cpp index 5fb1e0327..2f066caf5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhonePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhonePresenter.cpp @@ -120,7 +120,7 @@ namespace OHOS else { //if(event.GetPreLastPoint().x-event.GetStartPoint().x>200) - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); //NativeAbility::GetInstance().EnterSlice(VIEW_APPLIST); TelephonyInitInterface::X_DRAG_FLAG = false; } @@ -150,7 +150,7 @@ namespace OHOS if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepControlPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepControlPresenter.cpp index 8691a4fc9..8e86bfd58 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepControlPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepControlPresenter.cpp @@ -79,7 +79,7 @@ namespace OHOS UNUSED(view); if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && SleepControlPresenter::X_DRAG_FLAG) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } @@ -102,7 +102,7 @@ namespace OHOS // 如果是power键就返回上一级 if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepControlView.cpp b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepControlView.cpp index 4bc6ea88b..86252b47c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepControlView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepControlView.cpp @@ -101,7 +101,17 @@ namespace OHOS void SleepControlView::OnStart() { View::OnStart(); - RootView::GetInstance()->Add(GetSleepControlPageView()); + SetContainerView(new UIViewGroup()); + if (GetContainer() == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "container_ new fail!!"); + return; + } + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + container_->SetTouchable(true); + container_->SetDraggable(true); + container_->Add(GetSleepControlPageView()); + // RootView::GetInstance()->Add(GetSleepControlPageView()); if (SleepSwipeViewList == nullptr) { @@ -144,6 +154,12 @@ namespace OHOS void SleepControlView::OnStop() { View::OnStop(); + if(container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ =nullptr; + } RootView::GetInstance()->ClearOnKeyActListener(); RootView::GetInstance()->RemoveAll(); return; diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp index 8bc05f6ff..a0d2e1258 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp @@ -171,7 +171,7 @@ namespace OHOS LabelSetup labelSetups[] = { {153, STR_ABOUT_WATCH}, - {273, STR_SYSTEM_UPDATE}, + // {273, STR_SYSTEM_UPDATE}, {393, STR_WATCH_QR_CODE}, {513, STR_SYSTEM_LANGUAGE}, {633, STR_RESTART}, @@ -188,10 +188,11 @@ namespace OHOS .textId = STR_ABOUT_WATCH, .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; + int pos_y = 153; for (int i = 0; i < sizeof(labelSetups) / sizeof(labelSetups[0]); ++i) { - labelConfig.top = labelSetups[i].y; + labelConfig.top = pos_y + 120*i; labelConfig.textId = labelSetups[i].textId; SystemViewLabel[i] = SystemViewLabelInit(labelConfig); if (SystemViewLabel[i] == nullptr) @@ -215,7 +216,7 @@ namespace OHOS }; ButtonSetup buttonSetups[] = { {120, ABOUT_THE_WATCH}, - {240, SYSTEM_UPGRADE}, + // {240, SYSTEM_UPGRADE}, {360, WATCH_QR_CODE}, {480, SYSTEM_LANGUAGE}, {600, RESTART}, @@ -223,11 +224,13 @@ namespace OHOS {840, FACTORY_RESET}, }; + int pos_y = 120; for (int i = 0; i < sizeof(buttonSetups) / sizeof(buttonSetups[0]); ++i) { ButtonConfig buttonconfig = { .x = 43, - .y = buttonSetups[i].y, + // .y = buttonSetups[i].y, + .y = pos_y + 120*i, .w = 380, .h = 100, .viewId = buttonSetups[i].viewId, @@ -308,7 +311,7 @@ namespace OHOS { return; } - temp->SetPosition(43, 960, 380, 40); + temp->SetPosition(43, 840, 380, 40); temp->SetVisible(false); SystemScrollView[SYSTEMVIEW]->Add(temp); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp index 3837db09b..7af14d404 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp @@ -106,7 +106,7 @@ extern "C" // 退出拍照 if (request->msgId == TOPIC_EVENT_CANCEL_CMAERA) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); cameraSend(3); TakephotosModel::GetInstance()->SetPopStaust(PopupPhoto::CreamPopup); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosPresenter.cpp index 86d2f3ced..852ed90ef 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosPresenter.cpp @@ -78,7 +78,7 @@ namespace OHOS (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); /*如果是拍照界面需要发送拍照结束的消息*/ if (TakephotosModel::GetInstance()->GetPopStaust() == PopupPhoto::TakePopup) @@ -96,7 +96,7 @@ namespace OHOS // 返回按键 if (strcmp(view.GetViewId(), BUTTONGO) == 0) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } if (strcmp(view.GetViewId(), BUTTONTAKE) == 0) { @@ -114,7 +114,7 @@ namespace OHOS // 如果是power键,且是亮屏状态,按键释放就返回上一级 if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { - NativeAbility::GetInstance().Back(); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); /*如果是拍照界面需要发送拍照结束的消息*/ if (TakephotosModel::GetInstance()->GetPopStaust() == PopupPhoto::TakePopup) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalPresenter.cpp index ce9546167..0c5501075 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalPresenter.cpp @@ -73,7 +73,7 @@ namespace OHOS 3.[更多]->[具体训练项]进入 4.[设置训练目标]进入 {不返回} */ - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } bool TraingNomalPresenter::OnDrag(UIView &view, const DragEvent &event) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingPresenter.cpp index fdd7064de..7c5dafa59 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingPresenter.cpp @@ -70,7 +70,7 @@ namespace OHOS // 回退函数 [ Slice 的 traingview {右滑只能回到applist}] void TraingPresenter::NavigateBack() { - NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TransitionType::TRANSITION_BACK_TO_HEXAGONS); NativeAbility::GetInstance().ClearSliceIdStack(); // 清空所有SLiceId栈元素 } bool TraingPresenter::OnDrag(UIView &view, const DragEvent &event) diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardPresenter.cpp index 10982c32a..99589761b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardPresenter.cpp @@ -498,10 +498,10 @@ void TraingCardPresenter::handleEndState() { // NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING_RECORD); if (TraingModel::GetInstance()->GetEntryType() == APPLIST_ENTER) NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING, - TransitionType::TRANSITION_ZOOM); + TransitionType::TRANSITION_BACK_TO_HEXAGONS); else { NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, - TransitionType::TRANSITION_ZOOM); + TransitionType::TRANSITION_BACK_TO_HEXAGONS); NativeAbility::GetInstance().ClearSliceIdStack(); // 清空所有SLiceId栈元素 } NativeAbility::GetInstance().ClearSliceIdStack(); // 清空所有SLiceId栈元素 diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp index b2ea91b3a..42571f4ef 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp @@ -84,16 +84,16 @@ namespace OHOS if (preSlice == VIEW_TRAININGENDDATA) { if (TraingModel::GetInstance()->GetEntryType() == APPLIST_ENTER) - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING, TransitionType::TRANSITION_BACK_TO_HEXAGONS); else { - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TransitionType::TRANSITION_BACK_TO_HEXAGONS); NativeAbility::GetInstance().ClearSliceIdStack(); // 清空所有SLiceId栈元素 } } else { - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } } bool TraingMorePresenter::OnDrag(UIView &view, const DragEvent &event) diff --git a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordPresenter.cpp index 8f96de0c9..e9341640f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordPresenter.cpp @@ -89,16 +89,16 @@ namespace OHOS if (preSlice == VIEW_TRAININGCRAD) { if (TraingModel::GetInstance()->GetEntryType() == APPLIST_ENTER) - NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_TRAINING, TransitionType::TRANSITION_BACK_TO_HEXAGONS); else { - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN, TransitionType::TRANSITION_BACK_TO_HEXAGONS); NativeAbility::GetInstance().ClearSliceIdStack(); // 清空所有SLiceId栈元素 } } else { - NativeAbility::GetInstance().Back(TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } } bool TraingRecordPresenter::OnDrag(UIView &view, const DragEvent &event) diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h index 401408eb9..b19be2c6c 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h @@ -53,7 +53,7 @@ public: if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) && (event.GetDeltaX() > X_DRAG_OFFSET) && (event.GetDeltaX() > (DOUBLES * MATH_ABS(event.GetDeltaY())))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Applist Ondrag!!"); - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TransitionType::TRANSITION_BACK_TO_HEXAGONS); } return false; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp b/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp index 1d34972dc..a024a8d98 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp @@ -109,13 +109,13 @@ void KeyInputListener::OnKeyRelease(const KeyEvent& event) CallVolumeDipSwitchControl(VOLUMEUP); } else if (currentViewId != VIEW_MAIN_SAMPLE) { // 主表盘 PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面 - NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN_SAMPLE, TransitionType::TRANSITION_BACK_TO_HEXAGONS); } else { PressAlarmNotify(); // 当前为闹钟通知页面时,先处理闹钟再切换页面 if (!MainViewSample::GetInstance()->IsMainClockPage()) { // 当前页面为主表盘的其他页面时,切换回主表盘页面 MainViewSample::GetInstance()->SwitchToClockPage(); } else { - NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TransitionType::TRANSITION_ZOOM); + NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST, TransitionType::TRANSITION_BACK_TO_HEXAGONS); } } }