mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-27 01:03:08 +00:00
!48690 Swiper: add CreateIndicatorId function
Merge pull request !48690 from Hu_zq/CreateIndicatorId
This commit is contained in:
commit
8699ca7261
@ -2090,7 +2090,7 @@ void SwiperPattern::InitIndicator()
|
||||
if (!IsShowIndicator()) {
|
||||
return;
|
||||
}
|
||||
indicatorNode = FrameNode::GetOrCreateFrameNode(V2::SWIPER_INDICATOR_ETS_TAG, GetIndicatorId(),
|
||||
indicatorNode = FrameNode::GetOrCreateFrameNode(V2::SWIPER_INDICATOR_ETS_TAG, CreateIndicatorId(),
|
||||
[]() { return AceType::MakeRefPtr<SwiperIndicatorPattern>(); });
|
||||
swiperNode->AddChild(indicatorNode);
|
||||
} else {
|
||||
@ -2103,7 +2103,7 @@ void SwiperPattern::InitIndicator()
|
||||
}
|
||||
if (GetIndicatorType() == SwiperIndicatorType::DIGIT && lastSwiperIndicatorType_ == SwiperIndicatorType::DOT) {
|
||||
RemoveIndicatorNode();
|
||||
indicatorNode = FrameNode::GetOrCreateFrameNode(V2::SWIPER_INDICATOR_ETS_TAG, GetIndicatorId(),
|
||||
indicatorNode = FrameNode::GetOrCreateFrameNode(V2::SWIPER_INDICATOR_ETS_TAG, CreateIndicatorId(),
|
||||
[]() { return AceType::MakeRefPtr<SwiperIndicatorPattern>(); });
|
||||
swiperNode->AddChild(indicatorNode);
|
||||
}
|
||||
|
@ -310,14 +310,17 @@ public:
|
||||
return rightButtonId_.has_value();
|
||||
}
|
||||
|
||||
int32_t GetIndicatorId()
|
||||
int32_t CreateIndicatorId()
|
||||
{
|
||||
if (!indicatorId_.has_value()) {
|
||||
indicatorId_ = ElementRegister::GetInstance()->MakeUniqueId();
|
||||
}
|
||||
indicatorId_ = ElementRegister::GetInstance()->MakeUniqueId();
|
||||
return indicatorId_.value();
|
||||
}
|
||||
|
||||
int32_t GetIndicatorId() const
|
||||
{
|
||||
return indicatorId_.has_value() ? indicatorId_.value() : -1;
|
||||
}
|
||||
|
||||
int32_t GetLeftButtonId()
|
||||
{
|
||||
if (!leftButtonId_.has_value()) {
|
||||
|
Loading…
Reference in New Issue
Block a user