From: luozheng <1732036298@qq.com> Date: Mon, 1 Sep 2025 09:53:23 +0000 (+0800) Subject: 1.applist弧形列表SetRotateFactor从2.0改为1.0 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~121 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=a1b0227e18e061178636dd41662a6676bc69385b;p=mirrors%2FFD230.git 1.applist弧形列表SetRotateFactor从2.0改为1.0 2.主界面和applist界面按键监听注册改为从OnStart->OnResume --- diff --git a/code/sdk/application/wearable/fd230/nativeabilityfwk/src/Ability.cpp b/code/sdk/application/wearable/fd230/nativeabilityfwk/src/Ability.cpp index 8c03756cd..9c211169f 100644 --- a/code/sdk/application/wearable/fd230/nativeabilityfwk/src/Ability.cpp +++ b/code/sdk/application/wearable/fd230/nativeabilityfwk/src/Ability.cpp @@ -153,7 +153,7 @@ void Ability::SwitchSlice(uint16_t sliceId, uint16_t pageId, TransitionType type } FreeElement(elementName); #endif - #ifdef FD230 + // showsStackSliceId(); if (sliceId == VIEW_MAIN) { @@ -171,7 +171,7 @@ void Ability::SwitchSlice(uint16_t sliceId, uint16_t pageId, TransitionType type if(id!=VIEW_INCOMING_CALL && id!=VIEW_BLUETOOTH_EARPHONE) make_phone_push(id); } - #endif + TransitionTarget target; target.sliceInfo = sliceId | (static_cast(pageId) << PAGE_OFFSET); bool runImmed = PageTransitionMgr::GetInstance().BeginTransition(TransitionCaller::CHANGE_SLICE, target, diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp index 7fd9bd632..3b43455fa 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistPresenter.cpp @@ -21,6 +21,7 @@ #include "ConfigModel.h" #include #include "custom_runtime.h" +#include "graphic_service.h" namespace OHOS { REGIST_SLICE(VIEW_APPLIST, ApplistView, ApplistPresenter); @@ -40,7 +41,6 @@ REGIST_SLICE(VIEW_APPLIST, ApplistView, ApplistPresenter); void ApplistPresenter::OnStart() { - RootView::GetInstance()->SetOnKeyActListener(KeyInputListener::GetInstance()); if (view_ == nullptr) { return; } @@ -58,6 +58,9 @@ REGIST_SLICE(VIEW_APPLIST, ApplistView, ApplistPresenter); } else if (GetCurrentStyle() == AppListStyle::WATERFALL_STYLE) { view_->ResumeWaterFallDraggable(); } + // 避免与弹窗收起的时序冲突,放到UI线程消息队列 + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::RootView::SetOnKeyActListener, OHOS::RootView::GetInstance(), KeyInputListener::GetInstance())); } bool ApplistPresenter::OnRotate(UIView& view, const RotateEvent& event) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistView.cpp index c28ab18e0..ee597d965 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/applist/src/ApplistView.cpp @@ -303,7 +303,7 @@ void ApplistView::ArcScaleListStyleOnStart(void) ArcScaleList_->EnableAutoAlign(true); ArcScaleList_->SetItemSpace(0); ArcScaleList_->SetSelectPosition(ARC_SCALE_LIST_HEIGHT / 2); - ArcScaleList_->SetRotateFactor(2.0); + ArcScaleList_->SetRotateFactor(1.0); ArcScaleList_->RequestFocus(); ArcScaleList_->RefreshList(); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp index 73b1f336b..ece2fbdce 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/MainPresenterSample.cpp @@ -102,7 +102,6 @@ REGIST_SLICE(VIEW_MAIN, MainViewSample, MainPresenterSample); void MainPresenterSample::OnStart() { mainPresenterState_ = MainPresenterState::START; - RootView::GetInstance()->SetOnKeyActListener(KeyInputListener::GetInstance()); } void MainPresenterSample::OnPause() @@ -136,6 +135,9 @@ REGIST_SLICE(VIEW_MAIN, MainViewSample, MainPresenterSample); // Set current page again to invoke OnActive method. uint8_t curCardId = view_->GetHorCurrentCard(); view_->SwitchToCard(curCardId); + // 避免与弹窗收起的时序冲突,放到UI线程消息队列 + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::RootView::SetOnKeyActListener, OHOS::RootView::GetInstance(), KeyInputListener::GetInstance())); #if IS_SUPPORT_BIND_VOTE if (ConfigModel::GetInstance()->GetisFirstTimeStart() == true) {