react-native/React/Views
rxb dcf245a9a2 Definable distance pagination for ScrollView
Summary: This is an enhancement for ScrollView that adds the ability to paginate based on a width other than the width of the ScrollView itself. This is a fairly common pattern used on apps like Facebook, App Store, and Twitter to scroll through a horizontal set of cards or icons:

![img_8726 2](https://cloud.githubusercontent.com/assets/451050/8017899/39f9f47c-0bd2-11e5-9c1d-889452f20cf7.PNG) ![img_8727 2](https://cloud.githubusercontent.com/assets/451050/8017898/39f962dc-0bd2-11e5-98b4-461ac0f7f21b.PNG)  ![img_8728 2](https://cloud.githubusercontent.com/assets/451050/8017900/39fd91a4-0bd2-11e5-8786-4cf0316295a0.PNG)

After trying to accomplish this only with JS, it appears that attempting to take over an in-progress native scroll animation with JS is always going to result in some amount of jankiness and jumping.

This pull request uses `scrollViewWillEndDragging` in RCTScrollView.m to adjust `targetContentOffset` based on two new optional props added to ScrollView. `snapToInterval` sets the multiple that the
Closes https://github.com/facebook/react-native/pull/1532

Reviewed By: @​svcscm, @​trunkagent

Differential Revision: D2443701

Pulled By: @vjeux
2015-09-23 11:47:25 -07:00
..
RCTActivityIndicatorViewManager.h Improved RCTActivityIndicatorView and fixed some flow errors 2015-04-26 02:17:13 -08:00
RCTActivityIndicatorViewManager.m Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
RCTAnimationType.h [LayoutAnimation] RCTAnimationTypeKeyboard 2015-06-25 09:17:01 -08:00
RCTAutoInsetsProtocol.h Automatically adjust content inset after view controller did layout subviews 2015-09-04 07:00:21 -08:00
RCTBorderDrawing.h Implemented fast path for same borders/radii 2015-05-28 09:16:44 -08:00
RCTBorderDrawing.m Implemented fast path for same borders/radii 2015-05-28 09:16:44 -08:00
RCTComponent.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTComponentData.h [rn] Pass props when creating a view in RCTViewManager 2015-08-25 08:08:17 -08:00
RCTComponentData.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTConvert+CoreLocation.h [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTConvert+CoreLocation.m [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTConvert+MapKit.h [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTConvert+MapKit.m Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
RCTDatePicker.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTDatePicker.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTDatePickerManager.h Removed deprecated RCT_EXPORT + code paths 2015-06-05 09:58:25 -08:00
RCTDatePickerManager.m Fixed DatePickerIOS onChange event 2015-09-10 10:10:26 -07:00
RCTMap.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTMap.m Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
RCTMapManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTMapManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTModalHostView.h Enable transparent modal presentation with <Modal /> 2015-08-14 04:47:12 -08:00
RCTModalHostView.m Prevent setFrame:forView: being called for invalidated views 2015-09-18 17:33:25 -07:00
RCTModalHostViewController.h Add <Modal /> component 2015-07-28 07:21:50 -08:00
RCTModalHostViewController.m Prevent setFrame:forView: being called for invalidated views 2015-09-18 17:33:25 -07:00
RCTModalHostViewManager.h Enable transparent modal presentation with <Modal /> 2015-08-14 04:47:12 -08:00
RCTModalHostViewManager.m Enable transparent modal presentation with <Modal /> 2015-08-14 04:47:12 -08:00
RCTNavItem.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTNavItem.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTNavItemManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTNavItemManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTNavigator.h Remove isValid from RCTInvalidating 2015-08-14 01:57:18 -08:00
RCTNavigator.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTNavigatorManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTNavigatorManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTPicker.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTPicker.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTPickerManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTPickerManager.m Fixed PickerIOS onChange event 2015-09-08 03:34:33 -08:00
RCTPointerEvents.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTProgressViewManager.h Added ProgressViewIOS 2015-06-03 09:49:35 -08:00
RCTProgressViewManager.m Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
RCTScrollView.h Definable distance pagination for ScrollView 2015-09-23 11:47:25 -07:00
RCTScrollView.m Definable distance pagination for ScrollView 2015-09-23 11:47:25 -07:00
RCTScrollViewManager.h Removed deprecated RCT_EXPORT + code paths 2015-06-05 09:58:25 -08:00
RCTScrollViewManager.m Definable distance pagination for ScrollView 2015-09-23 11:47:25 -07:00
RCTScrollableProtocol.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSegmentedControl.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTSegmentedControl.m Fixed segmented control 2015-09-10 04:50:24 -07:00
RCTSegmentedControlManager.h Add SegmentedControlIOS 2015-04-29 08:08:45 -08:00
RCTSegmentedControlManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTShadowView.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTShadowView.m pull in github css-layout into fbobjc react native 2015-09-20 20:35:29 -07:00
RCTSlider.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTSlider.m [SliderIOS] Apply value after minimum/maximumValue in order to ensure it is properly set 2015-04-21 11:09:10 -08:00
RCTSliderManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSliderManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTSwitch.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTSwitch.m [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSwitchManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSwitchManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBar.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBar.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBarItem.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBarItem.m Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
RCTTabBarItemManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTTabBarItemManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBarManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTTabBarManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTextDecorationLineType.h <Text> module add textDecoration style attributes 2015-07-07 06:15:20 -08:00
RCTView.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTView.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTViewControllerProtocol.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTViewManager.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTViewManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTWebView.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTWebView.m Automatically adjust content inset after view controller did layout subviews 2015-09-04 07:00:21 -08:00
RCTWebViewManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTWebViewManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTWrapperViewController.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTWrapperViewController.m Automatically adjust content inset after view controller did layout subviews 2015-09-04 07:00:21 -08:00
UIView+Private.h Perform clip update on RCTScrollView in increments of 50 pt 2015-08-13 07:56:41 -08:00
UIView+React.h Refactor RCTUIManager 2015-08-06 15:49:35 -08:00
UIView+React.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00