From ca7966e5a63164617593de001b5644b10de18dc3 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 23 Oct 2024 20:48:03 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9applist=E9=80=80=E5=87=BA?= =?utf8?q?=E5=92=8C=E8=BF=9B=E5=85=A5=E7=BB=9F=E4=B8=80=E5=8A=A8=E7=94=BB?= =?utf8?q?=EF=BC=8C=E5=8F=AA=E6=9C=89=E8=9C=82=E7=AA=9D=E6=89=8D=E6=9C=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/alarm/src/AlarmPresenter.cpp | 2 +- .../nativeui/alarm/src/MainAlarmView.cpp | 13 ++++++------ .../nativeui/alipay/src/AlipayPresenter.cpp | 2 +- .../assistant/src/AssistantPresenter.cpp | 4 ++-- .../src/BloodDetectionPresenter.cpp | 2 +- .../bloodoxygen/src/BloodResultPresenter.cpp | 8 ++++---- .../calculator/src/CalculatorPresenter.cpp | 2 +- .../calculator/src/CalculatorView.cpp | 1 + .../calendar/src/CalendarPresenter.cpp | 2 +- .../nativeui/calendar/src/CalendarView.cpp | 1 + .../flashlight/src/FlashlightPresenter.cpp | 4 ++-- .../nativeui/goal/src/Maingoalpresenter.cpp | 4 ++-- .../nativeui/goal/src/Maingoalview.cpp | 20 +++++++++++++++++-- .../heartrate/src/HeartChartPresenter.cpp | 2 +- .../heartrate/src/HeartDetectionPresenter.cpp | 2 +- .../heartrate/src/HeartResultPresenter.cpp | 8 ++++---- .../nativeui/message/src/MessagePresenter.cpp | 6 +++--- .../message/src/MessageShowPresenter.cpp | 2 +- .../nativeui/phone/src/MainPhonePresenter.cpp | 4 ++-- .../sleep/src/SleepControlPresenter.cpp | 4 ++-- .../nativeui/sleep/src/SleepControlView.cpp | 18 ++++++++++++++++- .../takephotos/src/TakephotosModel.cpp | 2 +- .../takephotos/src/TakephotosPresenter.cpp | 6 +++--- .../traing/src/TraingNomalPresenter.cpp | 2 +- .../nativeui/traing/src/TraingPresenter.cpp | 2 +- .../training_card/src/TraingCardPresenter.cpp | 4 ++-- .../src/TraingMorePresenter.cpp | 6 +++--- .../src/TraingRecordPresenter.cpp | 6 +++--- .../nativeui/applist/include/ApplistView.h | 2 +- .../nativeui/key/src/KeyInputListener.cpp | 4 ++-- 30 files changed, 90 insertions(+), 55 deletions(-) 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/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); } } } -- 2.17.1