1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_NAVIGATION_NAVIGATION_PATTERN_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_NAVIGATION_NAVIGATION_PATTERN_H 18 19 #include "base/memory/referenced.h" 20 #include "base/system_bar/system_bar_style.h" 21 #include "core/components_ng/base/ui_node.h" 22 #include "core/components_ng/pattern/navigation/inner_navigation_controller.h" 23 #include "core/components_ng/pattern/navigation/navigation_declaration.h" 24 #include "core/components_ng/pattern/navigation/navigation_event_hub.h" 25 #include "core/components_ng/pattern/navigation/navigation_group_node.h" 26 #include "core/components_ng/pattern/navigation/navigation_layout_algorithm.h" 27 #include "core/components_ng/pattern/navigation/navigation_layout_property.h" 28 #include "core/components_ng/pattern/navigation/navigation_stack.h" 29 #include "core/components_ng/pattern/navigation/title_bar_layout_property.h" 30 #include "core/components_ng/pattern/navigation/title_bar_node.h" 31 #include "core/components_ng/pattern/navigation/navigation_transition_proxy.h" 32 #include "core/components_ng/pattern/navrouter/navdestination_group_node.h" 33 #include "core/components_ng/pattern/pattern.h" 34 35 namespace OHOS::Ace::NG { 36 37 using namespace Framework; 38 using OnNavigationAnimation = std::function<NavigationTransition(RefPtr<NavDestinationContext>, 39 RefPtr<NavDestinationContext>, NavigationOperation)>; 40 class NavigationPattern : public Pattern { 41 DECLARE_ACE_TYPE(NavigationPattern, Pattern); 42 43 public: 44 NavigationPattern(); 45 ~NavigationPattern() override = default; 46 IsAtomicNode()47 bool IsAtomicNode() const override 48 { 49 return false; 50 } 51 CreateLayoutProperty()52 RefPtr<LayoutProperty> CreateLayoutProperty() override 53 { 54 return MakeRefPtr<NavigationLayoutProperty>(); 55 } 56 CreateEventHub()57 RefPtr<EventHub> CreateEventHub() override 58 { 59 return MakeRefPtr<NavigationEventHub>(); 60 } 61 CreateLayoutAlgorithm()62 RefPtr<LayoutAlgorithm> CreateLayoutAlgorithm() override 63 { 64 auto layoutAlgorithm = MakeRefPtr<NavigationLayoutAlgorithm>(); 65 layoutAlgorithm->SetRealNavBarWidth(realNavBarWidth_); 66 layoutAlgorithm->SetIfNeedInit(ifNeedInit_); 67 return layoutAlgorithm; 68 } 69 70 void OnAttachToFrameNode() override; 71 void OnDetachFromFrameNode(FrameNode* frameNode) override; 72 void OnModifyDone() override; 73 void OnWindowHide() override; 74 bool OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config) override; 75 void BeforeSyncGeometryProperties(const DirtySwapConfig& /* config */) override; 76 77 void OnLanguageConfigurationUpdate() override; 78 GetFocusPattern()79 FocusPattern GetFocusPattern() const override 80 { 81 return { FocusType::SCOPE, true }; 82 } 83 GetScopeFocusAlgorithm()84 ScopeFocusAlgorithm GetScopeFocusAlgorithm() override 85 { 86 return { false, true, ScopeType::FLEX }; 87 } 88 SetNavDestination(std::function<void (std::string)> && builder)89 void SetNavDestination(std::function<void(std::string)>&& builder) 90 { 91 builder_ = std::move(builder); 92 } 93 GetNavigationMode()94 NavigationMode GetNavigationMode() const 95 { 96 return navigationMode_; 97 } 98 SetNavigationMode(NavigationMode navigationMode)99 void SetNavigationMode(NavigationMode navigationMode) 100 { 101 navigationMode_ = navigationMode; 102 } 103 104 bool JudgeFoldStateChangeAndUpdateState(); 105 106 void SetNavigationStack(const RefPtr<NavigationStack>& navigationStack); 107 GetNavigationStack()108 const RefPtr<NavigationStack>& GetNavigationStack() 109 { 110 return navigationStack_; 111 } 112 113 // use for navRouter case AddNavDestinationNode(const std::string & name,const RefPtr<UINode> & navDestinationNode)114 void AddNavDestinationNode(const std::string& name, const RefPtr<UINode>& navDestinationNode) 115 { 116 addByNavRouter_ = true; 117 navigationStack_->Add(name, navDestinationNode); 118 } 119 AddNavDestinationNode(const std::string & name,const RefPtr<UINode> & navDestinationNode,NavRouteMode mode)120 void AddNavDestinationNode(const std::string& name, const RefPtr<UINode>& navDestinationNode, NavRouteMode mode) 121 { 122 addByNavRouter_ = true; 123 navigationStack_->Add(name, navDestinationNode, mode); 124 } 125 AddNavDestinationNode(const std::string & name,const RefPtr<UINode> & navDestinationNode,NavRouteMode mode,const RefPtr<RouteInfo> & routeInfo)126 void AddNavDestinationNode(const std::string& name, const RefPtr<UINode>& navDestinationNode, NavRouteMode mode, 127 const RefPtr<RouteInfo>& routeInfo) 128 { 129 addByNavRouter_ = true; 130 navigationStack_->Add(name, navDestinationNode, mode, routeInfo); 131 } 132 GetNavDestinationNode(const std::string & name)133 RefPtr<UINode> GetNavDestinationNode(const std::string& name) 134 { 135 RefPtr<UINode> uiNode; 136 int32_t index; 137 navigationStack_->Get(name, uiNode, index); 138 return uiNode; 139 } 140 GetNavDestinationNode()141 RefPtr<UINode> GetNavDestinationNode() 142 { 143 // get NavDestinationNode from the stack top 144 return navigationStack_->Get(); 145 } 146 GetPreNavDestination(const std::string & name,const RefPtr<UINode> & navDestinationNode)147 RefPtr<UINode> GetPreNavDestination(const std::string& name, const RefPtr<UINode>& navDestinationNode) 148 { 149 return navigationStack_->GetPre(name, navDestinationNode); 150 } 151 GetAllNavDestinationNodes()152 const std::vector<std::pair<std::string, RefPtr<UINode>>>& GetAllNavDestinationNodes() 153 { 154 return navigationStack_->GetAllNavDestinationNodes(); 155 } 156 RemoveIfNeeded(const std::string & name,const RefPtr<UINode> & navDestinationNode)157 void RemoveIfNeeded(const std::string& name, const RefPtr<UINode>& navDestinationNode) 158 { 159 navigationStack_->Remove(name, navDestinationNode); 160 } 161 RemoveNavDestination()162 void RemoveNavDestination() 163 { 164 navigationStack_->Remove(); 165 } 166 167 void InitDividerMouseEvent(const RefPtr<InputEventHub>& inputHub); 168 CleanStack()169 void CleanStack() 170 { 171 navigationStack_->RemoveAll(); 172 } 173 UpdateAnimatedValue(bool animated)174 void UpdateAnimatedValue(bool animated) 175 { 176 navigationStack_->UpdateAnimatedValue(animated); 177 } 178 SetNavigationStackProvided(bool provided)179 void SetNavigationStackProvided(bool provided) 180 { 181 navigationStackProvided_ = provided; 182 } 183 GetNavigationStackProvided()184 bool GetNavigationStackProvided() const 185 { 186 return navigationStackProvided_; 187 } 188 SetNavBarVisibilityChange(bool isChange)189 void SetNavBarVisibilityChange(bool isChange) 190 { 191 navBarVisibilityChange_ = isChange; 192 } 193 GetNavBarVisibilityChange()194 bool GetNavBarVisibilityChange() const 195 { 196 return navBarVisibilityChange_; 197 } 198 199 void OnVisibleChange(bool isVisible) override; 200 201 void OnColorConfigurationUpdate() override; 202 GetMinNavBarWidthValue()203 Dimension GetMinNavBarWidthValue() const 204 { 205 return minNavBarWidthValue_; 206 } SetMinNavBarWidthValue(Dimension minNavBarWidthValue)207 void SetMinNavBarWidthValue(Dimension minNavBarWidthValue) 208 { 209 minNavBarWidthValue_ = minNavBarWidthValue; 210 } 211 GetMaxNavBarWidthValue()212 Dimension GetMaxNavBarWidthValue() const 213 { 214 return maxNavBarWidthValue_; 215 } SetMaxNavBarWidthValue(Dimension maxNavBarWidthValue)216 void SetMaxNavBarWidthValue(Dimension maxNavBarWidthValue) 217 { 218 maxNavBarWidthValue_ = maxNavBarWidthValue; 219 } 220 GetMinContentWidthValue()221 Dimension GetMinContentWidthValue() const 222 { 223 return minContentWidthValue_; 224 } 225 SetMinContentWidthValue(Dimension minContentWidthValue)226 void SetMinContentWidthValue(Dimension minContentWidthValue) 227 { 228 minContentWidthValue_ = minContentWidthValue; 229 } 230 GetUserSetNavBarRangeFlag()231 bool GetUserSetNavBarRangeFlag() const 232 { 233 return userSetNavBarRangeFlag_; 234 } 235 SetUserSetNavBarRangeFlag(bool userSetNavBarRangeFlag)236 void SetUserSetNavBarRangeFlag(bool userSetNavBarRangeFlag) 237 { 238 userSetNavBarRangeFlag_ = userSetNavBarRangeFlag; 239 } 240 GetUserSetMinContentFlag()241 bool GetUserSetMinContentFlag() const 242 { 243 return userSetMinContentFlag_; 244 } 245 SetUserSetMinContentFlag(bool userSetMinContentFlag)246 void SetUserSetMinContentFlag(bool userSetMinContentFlag) 247 { 248 userSetMinContentFlag_ = userSetMinContentFlag; 249 } 250 GetUserSetNavBarWidthFlag()251 bool GetUserSetNavBarWidthFlag() const 252 { 253 return userSetNavBarWidthFlag_; 254 } 255 SetUserSetNavBarWidthFlag(bool userSetNavBarWidthFlag)256 void SetUserSetNavBarWidthFlag(bool userSetNavBarWidthFlag) 257 { 258 userSetNavBarWidthFlag_ = userSetNavBarWidthFlag; 259 } 260 SetInitNavBarWidth(const Dimension & initNavBarWidth)261 void SetInitNavBarWidth(const Dimension& initNavBarWidth) 262 { 263 realNavBarWidth_ = static_cast<float>(initNavBarWidth.ConvertToPx()); 264 initNavBarWidthValue_ = initNavBarWidth; 265 } 266 GetInitNavBarWidth()267 Dimension GetInitNavBarWidth() const 268 { 269 return initNavBarWidthValue_; 270 } 271 SetIfNeedInit(bool ifNeedInit)272 void SetIfNeedInit(bool ifNeedInit) 273 { 274 ifNeedInit_ = ifNeedInit; 275 } 276 277 void UpdateContextRect( 278 const RefPtr<NavDestinationGroupNode>& curDestination, const RefPtr<NavigationGroupNode>& navigation); 279 GetNavigationModeChange()280 bool GetNavigationModeChange() const 281 { 282 return navigationModeChange_; 283 } 284 SetNavigationModeChange(bool modeChange)285 void SetNavigationModeChange(bool modeChange) 286 { 287 navigationModeChange_ = modeChange; 288 } 289 AddOnStateChangeItem(int32_t nodeId,std::function<void (bool)> callback)290 void AddOnStateChangeItem(int32_t nodeId, std::function<void(bool)> callback) 291 { 292 onStateChangeMap_.emplace(nodeId, callback); 293 } 294 DeleteOnStateChangeItem(int32_t nodeId)295 void DeleteOnStateChangeItem(int32_t nodeId) 296 { 297 onStateChangeMap_.erase(nodeId); 298 } 299 GetNavigationController()300 const std::shared_ptr<NavigationController>& GetNavigationController() const 301 { 302 return navigationController_; 303 } 304 GetOnStateChangeMap()305 const std::map<int32_t, std::function<void(bool)>>& GetOnStateChangeMap() 306 { 307 return onStateChangeMap_; 308 } 309 310 void OnNavigationModeChange(bool modeChange); 311 312 void OnNavBarStateChange(bool modeChange); 313 314 static void FireNavigationChange(const RefPtr<UINode>& node, bool isShow, bool isFirst); 315 316 static void FireNavigationInner(const RefPtr<UINode>& node, bool isShow); 317 318 static void FireNavigationStateChange(const RefPtr<UINode>& node, bool isShow); 319 320 static void FireNavigationLifecycleChange(const RefPtr<UINode>& node, NavDestinationLifecycle lifecycle); 321 322 static bool CheckParentDestinationIsOnhide(const RefPtr<NavDestinationGroupNode>& destinationNode); 323 324 static bool CheckDestinationIsPush(const RefPtr<NavDestinationGroupNode>& destinationNode); 325 326 static void NotifyPerfMonitorPageMsg(const std::string& pageName); 327 328 // type: will_show + on_show, will_hide + on_hide, hide, show, willShow, willHide 329 void NotifyDialogChange(NavDestinationLifecycle lifecycle, bool isNavigationChanged, bool isFromStandard); 330 void NotifyPageHide(const std::string& pageName); 331 void CheckContentNeedMeasure(const RefPtr<FrameNode>& node); 332 void DumpInfo() override; 333 334 void NotifyDialogChange(bool isShow, bool isNavigationChanged); 335 SetIsCustomAnimation(bool isCustom)336 void SetIsCustomAnimation(bool isCustom) 337 { 338 isCustomAnimation_ = isCustom; 339 } 340 SetNavigationTransition(const OnNavigationAnimation navigationAnimation)341 void SetNavigationTransition(const OnNavigationAnimation navigationAnimation) 342 { 343 auto currentProxy = GetTopNavigationProxy(); 344 if (currentProxy && !currentProxy->GetIsFinished()) { 345 TAG_LOGI(AceLogTag::ACE_NAVIGATION, "not support to update callback during animation"); 346 return; 347 } 348 onTransition_ = std::move(navigationAnimation); 349 } 350 NeedSyncWithJsStackMarked()351 bool NeedSyncWithJsStackMarked() const 352 { 353 return needSyncWithJsStack_; 354 } 355 MarkNeedSyncWithJsStack()356 void MarkNeedSyncWithJsStack() 357 { 358 needSyncWithJsStack_ = true; 359 } 360 361 void SyncWithJsStackIfNeeded(); 362 363 void AttachNavigationStackToParent(); 364 void DetachNavigationStackFromParent(); 365 366 void AddToDumpManager(); 367 void RemoveFromDumpManager(); 368 369 void NotifyDestinationLifecycle(const RefPtr<UINode>& destinationNode, 370 NavDestinationLifecycle lifecycle); 371 void AbortAnimation(RefPtr<NavigationGroupNode>& hostNode); 372 SetParentCustomNode(const RefPtr<UINode> & parentNode)373 void SetParentCustomNode(const RefPtr<UINode>& parentNode) 374 { 375 parentNode_ = parentNode; 376 } 377 GetParentCustomNode()378 WeakPtr<UINode> GetParentCustomNode() const 379 { 380 return parentNode_; 381 } 382 383 void SetSystemBarStyle(const RefPtr<SystemBarStyle>& style); 384 385 void OnAttachToMainTree() override; 386 void OnDetachFromMainTree() override; 387 IsFullPageNavigation()388 bool IsFullPageNavigation() const 389 { 390 return isFullPageNavigation_; 391 } 392 393 bool IsTopNavDestination(const RefPtr<UINode>& node) const; 394 void TryRestoreSystemBarStyle(const RefPtr<WindowManager>& windowManager); 395 IsFinishInteractiveAnimation()396 bool IsFinishInteractiveAnimation() const 397 { 398 return isFinishInteractiveAnimation_; 399 } 400 GetTopNavigationProxy()401 const RefPtr<NavigationTransitionProxy> GetTopNavigationProxy() const 402 { 403 return proxyList_.empty() ? nullptr : proxyList_.back(); 404 } 405 406 RefPtr<NavigationTransitionProxy> GetProxyById(uint64_t id) const; 407 408 void RemoveProxyById(uint64_t id); 409 IsCurTopNewInstance()410 bool IsCurTopNewInstance() const 411 { 412 return isCurTopNewInstance_; 413 } 414 GetAllNavDestinationNodesPrev()415 const std::vector<std::pair<std::string, WeakPtr<UINode>>>& GetAllNavDestinationNodesPrev() 416 { 417 return navigationStack_->GetAllNavDestinationNodesPrev(); 418 } 419 420 void DialogAnimation(const RefPtr<NavDestinationGroupNode>& preTopNavDestination, 421 const RefPtr<NavDestinationGroupNode>& newTopNavDestination, bool isPopPage, bool isNeedVisible); 422 423 bool IsLastStdChange(); 424 void ReplaceAnimation(const RefPtr<NavDestinationGroupNode>& preTopNavDestination, 425 const RefPtr<NavDestinationGroupNode>& newTopNavDestination); 426 void TransitionWithDialogAnimation(const RefPtr<NavDestinationGroupNode>& preTopNavDestination, 427 const RefPtr<NavDestinationGroupNode>& newTopNavDestination, bool isPopPage); 428 void FollowStdNavdestinationAnimation(const RefPtr<NavDestinationGroupNode>& preTopNavDestination, 429 const RefPtr<NavDestinationGroupNode>& newTopNavDestination, bool isPopPage); 430 GetNavBasePageNode()431 RefPtr<FrameNode> GetNavBasePageNode() const 432 { 433 return pageNode_.Upgrade(); 434 } 435 436 private: 437 void UpdateIsFullPageNavigation(const RefPtr<FrameNode>& host); 438 void UpdateSystemBarStyleOnFullPageStateChange(const RefPtr<WindowManager>& windowManager); 439 void UpdateSystemBarStyleOnTopNavPathChange( 440 const std::optional<std::pair<std::string, RefPtr<UINode>>>& newTopNavPath); 441 void UpdateSystemBarStyleWithTopNavPath(const RefPtr<WindowManager>& windowManager, 442 const std::optional<std::pair<std::string, RefPtr<UINode>>>& topNavPath); 443 void UpdateSystemBarStyleOnPageVisibilityChange(bool show); 444 void RegisterPageVisibilityChangeCallback(); 445 bool ApplyTopNavPathSystemBarStyleOrRestore(const RefPtr<WindowManager>& windowManager, 446 const std::optional<std::pair<std::string, RefPtr<UINode>>>& topNavPath); 447 void InitPageNode(const RefPtr<FrameNode>& host); 448 void InitFoldState(); 449 450 void CheckTopNavPathChange(const std::optional<std::pair<std::string, RefPtr<UINode>>>& preTopNavPath, 451 const std::optional<std::pair<std::string, RefPtr<UINode>>>& newTopNavPath, 452 int32_t preLastStandardIndex = -1); 453 void TransitionWithAnimation(const RefPtr<NavDestinationGroupNode>& preTopNavDestination, 454 const RefPtr<NavDestinationGroupNode>& newTopNavDestination, bool isPopPage, bool isNeedVisible = false); 455 bool TriggerCustomAnimation(const RefPtr<NavDestinationGroupNode>& preTopNavDestination, 456 const RefPtr<NavDestinationGroupNode>& newTopNavDestination, bool isPopPage); 457 458 void OnCustomAnimationFinish(const RefPtr<NavDestinationGroupNode>& preTopNavDestination, 459 const RefPtr<NavDestinationGroupNode>& newTopNavDestination, bool isPopPage); 460 void TransitionWithOutAnimation(const RefPtr<NavDestinationGroupNode>& preTopNavDestination, 461 const RefPtr<NavDestinationGroupNode>& newTopNavDestination, bool isPopPage, bool needVisible = false); 462 NavigationTransition ExecuteTransition(const RefPtr<NavDestinationGroupNode>& preTopDestination, 463 const RefPtr<NavDestinationGroupNode>& newTopNavDestination, bool isPopPage); 464 RefPtr<RenderContext> GetTitleBarRenderContext(); 465 void DoAnimation(NavigationMode usrNavigationMode); 466 void RecoveryToLastStack(const RefPtr<NavDestinationGroupNode>& preTopDestination, 467 const RefPtr<NavDestinationGroupNode>& newTopDestination); 468 RefPtr<UINode> GenerateUINodeByIndex(int32_t index); 469 void DoNavbarHideAnimation(const RefPtr<NavigationGroupNode>& hostNode); 470 RefPtr<FrameNode> GetDividerNode() const; 471 void FireInterceptionEvent(bool isBefore, 472 const std::optional<std::pair<std::string, RefPtr<UINode>>>& newTopNavPath); 473 void InitPanEvent(const RefPtr<GestureEventHub>& gestureHub); 474 void HandleDragStart(); 475 void HandleDragUpdate(float xOffset); 476 void HandleDragEnd(); 477 void OnHover(bool isHover); GetPaintRectHeight(const RefPtr<FrameNode> & node)478 float GetPaintRectHeight(const RefPtr<FrameNode>& node) 479 { 480 auto renderContext = node->GetRenderContext(); 481 CHECK_NULL_RETURN(renderContext, 0.0f); 482 return renderContext->GetPaintRectWithoutTransform().Height(); 483 } 484 void AddDividerHotZoneRect(); 485 void RangeCalculation( 486 const RefPtr<NavigationGroupNode>& hostNode, const RefPtr<NavigationLayoutProperty>& navigationLayoutProperty); 487 bool UpdateTitleModeChangeEventHub(const RefPtr<NavigationGroupNode>& hostNode); 488 void NotifyPageShow(const std::string& pageName); 489 int32_t FireNavDestinationStateChange(NavDestinationLifecycle lifecycle); 490 void UpdatePreNavDesZIndex(const RefPtr<FrameNode> &preTopNavDestination, 491 const RefPtr<FrameNode> &newTopNavDestination, int32_t preLastStandardIndex = -1); 492 void UpdateNavPathList(); 493 void RefreshNavDestination(); 494 RefPtr<NavigationPattern> GetParentNavigationPattern(); 495 void DealTransitionVisibility(const RefPtr<FrameNode>& node, bool isVisible, bool isNavBar); 496 void NotifyNavDestinationSwitch(const RefPtr<NavDestinationContext>& from, 497 const RefPtr<NavDestinationContext>& to, NavigationOperation operation); 498 499 void UpdateIsAnimation(const std::optional<std::pair<std::string, RefPtr<UINode>>>& preTopNavPath); 500 void StartTransition(const RefPtr<NavDestinationGroupNode>& preDestination, 501 const RefPtr<NavDestinationGroupNode>& topDestination, 502 bool isAnimated, bool isPopPage, bool isNeedVisible = false); 503 void ProcessAutoSave(const RefPtr<FrameNode>& node); 504 505 void FireShowAndHideLifecycle(const RefPtr<NavDestinationGroupNode>& preDestination, 506 const RefPtr<NavDestinationGroupNode>& topDestination, bool isPopPage, bool isAnimated); 507 void OnWindowSizeChanged(int32_t width, int32_t height, WindowSizeChangeReason type) override; 508 void RefreshFocusToDestination(); 509 510 void PerformanceEventReport(int32_t nodeCount, int32_t depth, const std::string& navDestinationName); 511 void StartDefaultAnimation(const RefPtr<NavDestinationGroupNode>& preTopDestination, 512 const RefPtr<NavDestinationGroupNode>& topDestination, 513 bool isPopPage, bool isNeedInVisible); 514 bool ExecuteAddAnimation(const RefPtr<NavDestinationGroupNode>& preTopDestination, 515 const RefPtr<NavDestinationGroupNode>& topDestination, 516 bool isPopPage, const RefPtr<NavigationTransitionProxy>& proxy, 517 NavigationTransition navigationTransition); 518 bool GetIsFocusable(const RefPtr<FrameNode>& frameNode); 519 520 NavigationMode navigationMode_ = NavigationMode::AUTO; 521 std::function<void(std::string)> builder_; 522 RefPtr<NavigationStack> navigationStack_; 523 RefPtr<InputEvent> hoverEvent_; 524 RefPtr<PanEvent> panEvent_; 525 std::vector<RefPtr<NavigationTransitionProxy>> proxyList_; 526 RectF dragRect_; 527 WeakPtr<FrameNode> pageNode_; 528 bool isFullPageNavigation_ = false; 529 std::optional<RefPtr<SystemBarStyle>> backupStyle_; 530 std::optional<RefPtr<SystemBarStyle>> currStyle_; 531 bool addByNavRouter_ = false; 532 bool ifNeedInit_ = true; 533 float preNavBarWidth_ = 0.0f; 534 float realNavBarWidth_ = DEFAULT_NAV_BAR_WIDTH.ConvertToPx(); 535 float realDividerWidth_ = 2.0f; 536 bool navigationStackProvided_ = false; 537 bool navBarVisibilityChange_ = false; 538 bool userSetNavBarRangeFlag_ = false; 539 bool userSetMinContentFlag_ = false; 540 bool userSetNavBarWidthFlag_ = false; 541 bool isChanged_ = false; // check navigation top page is change 542 Dimension initNavBarWidthValue_ = DEFAULT_NAV_BAR_WIDTH; 543 Dimension minNavBarWidthValue_ = 0.0_vp; 544 Dimension maxNavBarWidthValue_ = 0.0_vp; 545 Dimension minContentWidthValue_ = 0.0_vp; 546 NavigationTitleMode titleMode_ = NavigationTitleMode::FREE; 547 bool navigationModeChange_ = false; 548 bool isCustomAnimation_ = false; // custom animation 549 bool isInDividerDrag_ = false; 550 bool isDividerDraggable_ = true; 551 bool isAnimated_ = false; 552 FoldStatus currentFoldStatus_ = FoldStatus::UNKNOWN; // only used for mode-switch animation 553 bool isReplace_ = false; 554 bool isFinishInteractiveAnimation_ = true; 555 int32_t lastPreIndex_ = false; 556 std::shared_ptr<NavigationController> navigationController_; 557 std::map<int32_t, std::function<void(bool)>> onStateChangeMap_; 558 OnNavigationAnimation onTransition_; 559 bool needSyncWithJsStack_ = false; 560 std::optional<std::pair<std::string, RefPtr<UINode>>> preTopNavPath_; 561 RefPtr<NavDestinationContext> preContext_; 562 WeakPtr<UINode> parentNode_; 563 int32_t preStackSize_ = 0; 564 bool isRightToLeft_ = false; 565 bool isCurTopNewInstance_ = false; 566 }; 567 568 } // namespace OHOS::Ace::NG 569 570 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_NAVIGATION_NAVIGATION_PATTERN_H 571