File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,9 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
260
260
261
261
- (void )scrollViewWillEndDragging : (UIScrollView *)scrollView withVelocity : (CGPoint)velocity targetContentOffset : (inout CGPoint *)targetContentOffset {
262
262
263
+ const auto strongEventEmitter = *std::dynamic_pointer_cast<const RNCViewPagerEventEmitter>(_eventEmitter);
264
+ strongEventEmitter.onPageScrollStateChanged (RNCViewPagerEventEmitter::OnPageScrollStateChanged{.pageScrollState = RNCViewPagerEventEmitter::OnPageScrollStateChangedPageScrollState::Settling });
265
+
263
266
if (!_overdrag) {
264
267
NSInteger maxIndex = _nativeChildrenViewControllers.count - 1 ;
265
268
BOOL isFirstPage = [self isLtrLayout ] ? _currentIndex == 0 : _currentIndex == maxIndex;
@@ -270,11 +273,12 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoi
270
273
if ((isFirstPage && contentOffset <= topBound) || (isLastPage && contentOffset >= topBound)) {
271
274
CGPoint croppedOffset = [self isHorizontal ] ? CGPointMake (topBound, 0 ) : CGPointMake (0 , topBound);
272
275
*targetContentOffset = croppedOffset;
276
+
277
+ strongEventEmitter.onPageScrollStateChanged (RNCViewPagerEventEmitter::OnPageScrollStateChanged{.pageScrollState = RNCViewPagerEventEmitter::OnPageScrollStateChangedPageScrollState::Idle });
273
278
}
274
279
}
275
280
276
- const auto strongEventEmitter = *std::dynamic_pointer_cast<const RNCViewPagerEventEmitter>(_eventEmitter);
277
- strongEventEmitter.onPageScrollStateChanged (RNCViewPagerEventEmitter::OnPageScrollStateChanged{.pageScrollState = RNCViewPagerEventEmitter::OnPageScrollStateChangedPageScrollState::Settling });
281
+
278
282
}
279
283
280
284
- (void )scrollViewDidEndDecelerating : (UIScrollView *)scrollView {
Original file line number Diff line number Diff line change @@ -375,6 +375,8 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoi
375
375
if ((isFirstPage && contentOffset <= topBound) || (isLastPage && contentOffset >= topBound)) {
376
376
CGPoint croppedOffset = [self isHorizontal ] ? CGPointMake (topBound, 0 ) : CGPointMake (0 , topBound);
377
377
*targetContentOffset = croppedOffset;
378
+
379
+ [self .eventDispatcher sendEvent: [[RCTOnPageScrollStateChanged alloc ] initWithReactTag: self .reactTag state: @" idle" coalescingKey: _coalescingKey++]];
378
380
}
379
381
}
380
382
}
You can’t perform that action at this time.
0 commit comments