@@ -165,8 +165,11 @@ void SpringScrollViewNode::onDown(ArkUI_GestureEvent *evt) {
165
165
auto recordEvent =
166
166
std::static_pointer_cast<SpringScrollViewEvent>(EventBus::EventBus::getInstance ()->getEvent ());
167
167
this ->contentOffset = recordEvent->getEventContentOffset ();
168
+ this ->recordSwipeY = recordEvent->getEventRecordSwipeY ();
168
169
refreshStatus = " waiting" ;
169
- loadingStatus = " waiting" ;
170
+ if (recordEvent->getLoadingStatus () != " allLoaded" ) {
171
+ loadingStatus = " waiting" ;
172
+ }
170
173
float x = OH_ArkUI_PanGesture_GetOffsetX (evt);
171
174
float y = OH_ArkUI_PanGesture_GetOffsetY (evt);
172
175
beginPoint.x = lastPoint.x = x;
@@ -196,6 +199,7 @@ void SpringScrollViewNode::onDown(ArkUI_GestureEvent *evt) {
196
199
this ->recordEventModel ->setEventContentInsets (contentInsets);
197
200
this ->recordEventModel ->setEventBeginPoint (beginPoint);
198
201
this ->recordEventModel ->setEventLastPoint (lastPoint);
202
+ this ->recordEventModel ->setEventRecordSwipeY (this ->recordSwipeY );
199
203
auto baseEvent = std::static_pointer_cast<EventBus::Event>(this ->recordEventModel );
200
204
EventBus::EventBus::getInstance ()->setEvent (baseEvent);
201
205
}
@@ -562,6 +566,7 @@ void SpringScrollViewNode ::setContentOffset(float x, float y) {
562
566
this ->recordEventModel ->setLoadingStatus (loadingStatus);
563
567
this ->recordEventModel ->setEventBounces (bounces);
564
568
this ->recordEventModel ->setEventContentOffset (contentOffset);
569
+ this ->recordEventModel ->setEventRecordSwipeY (contentOffset.y );
565
570
auto baseEvent = std::static_pointer_cast<EventBus::Event>(this ->recordEventModel );
566
571
EventBus::EventBus::getInstance ()->setEvent (baseEvent);
567
572
std::array<ArkUI_NumberValue, 3 > translateValue = {
@@ -583,6 +588,21 @@ void SpringScrollViewNode ::setAllLoaded(bool allLoaded) {
583
588
if (allLoaded) {
584
589
contentInsets.bottom = 0 ;
585
590
}
591
+ this ->recordEventModel = std::make_shared<SpringScrollViewEvent>(5 );
592
+ this ->recordEventModel ->setEventMomentumScrolling (false );
593
+ this ->recordEventModel ->setNodeHandle (m_stackArkUINodeHandle);
594
+ this ->recordEventModel ->setEventSpringScrollViewNodeDelegate (this ->m_scrollNodeDelegate );
595
+ this ->recordEventModel ->setRefreshStatus (refreshStatus);
596
+ this ->recordEventModel ->setLoadingStatus (loadingStatus);
597
+ this ->recordEventModel ->setEventBounces (bounces);
598
+ this ->recordEventModel ->setEventContentOffset (contentOffset);
599
+ this ->recordEventModel ->setEventSize (size);
600
+ this ->recordEventModel ->setEventContentSize (contentSize);
601
+ this ->recordEventModel ->setEventContentInsets (contentInsets);
602
+ this ->recordEventModel ->setEventBeginPoint (beginPoint);
603
+ this ->recordEventModel ->setEventLastPoint (lastPoint);
604
+ auto baseEvent = std::static_pointer_cast<EventBus::Event>(this ->recordEventModel );
605
+ EventBus::EventBus::getInstance ()->setEvent (baseEvent);
586
606
}
587
607
588
608
void SpringScrollViewNode ::setDecelerationRate (float rate) { decelerationRate = rate; }
@@ -623,6 +643,7 @@ void SpringScrollViewNode ::endLoading() {
623
643
this ->recordEventModel ->setEventContentInsets (contentInsets);
624
644
this ->recordEventModel ->setEventBeginPoint (beginPoint);
625
645
this ->recordEventModel ->setEventLastPoint (lastPoint);
646
+ this ->recordEventModel ->setEventRecordSwipeY (contentOffset.y );
626
647
auto baseEvent = std::static_pointer_cast<EventBus::Event>(this ->recordEventModel );
627
648
EventBus::EventBus::getInstance ()->setEvent (baseEvent);
628
649
this ->m_scrollNodeDelegate ->callArkTSAnimationCancel ();
@@ -660,9 +681,10 @@ void SpringScrollViewNode ::endRefresh() {
660
681
void SpringScrollViewNode ::scrollTo (float x, float y, bool animated) {
661
682
this ->setRecordEventModel ();
662
683
if (x == BEGIN_REFRESH){
663
- m_scrollNodeDelegate->callArkTSScrollYStart (0 , y, 500 );
664
- this ->beginRefresh ();
665
- return ;
684
+ if (!this ->bounces ) return ;
685
+ m_scrollNodeDelegate->callArkTSScrollYStart (0 , y, 500 );
686
+ this ->beginRefresh ();
687
+ return ;
666
688
}
667
689
if ( x == DISMINATE_KEYBOARD_SHOW_HIDE && this ->recordKeyBoardShow ) return ;
668
690
if (y == DISMINATE_KEYBOARD_SHOW_HIDE){
@@ -702,6 +724,7 @@ void SpringScrollViewNode::onEvent(std::shared_ptr<SpringScrollViewEvent> &event
702
724
this ->contentInsets = recordEvent->getEventContentInsets ();
703
725
this ->size = recordEvent->getEventSize ();
704
726
this ->momentumScrolling = recordEvent->getEventMomentumScrolling ();
727
+ this ->recordSwipeY = recordEvent->getEventRecordSwipeY ();
705
728
DLOG (INFO) << " SpringScrollViewNode onEvent " << event->getMessageType () << " getEventType "
706
729
<< event->getEventType ();
707
730
0 commit comments