Commit Graph

108 Commits

Author SHA1 Message Date
Spencer Ahrens ecf4c48966 Add `scrollToLocation` for `SectionList`
Summary:
Basic functionality that takes `itemIndex` and `sectionIndex`

**TestPlan**

Added this to onChangeText:

	this._listRef.getNode().scrollToLocation({itemIndex: 6, sectionIndex: 3, viewOffset: 25});

and saw it scroll to the correct position right under the sticky header.

Reviewed By: bvaughn

Differential Revision: D4821714

fbshipit-source-id: 261e373f9c4af384db5a363df5b0fd9274b1bdfe
2017-04-03 18:48:48 -07:00
Spencer Ahrens 87bdcbde6a propagate getScrollResponder, getScrollableNode
Summary:
so users can call `setNativeProps` and do more compositing.

**Test Plan:**

Added this to `onPress` of `SectionListExample` and `FlatListExample`:

    this._listRef.getNode().getScrollResponder().setNativeProps({scrollEnabled: false});

and saw scroll get disabled. Note the call to `getNode` because we are using the `Animated.createComponent` wrapper.

Reviewed By: achen1, bvaughn

Differential Revision: D4821711

fbshipit-source-id: 8d1f3dd7ccc646524f154721c5c7036620d57132
2017-04-03 18:48:48 -07:00
Spencer Ahrens 128596b311 Fixup comments to indicate sticky headers are now supported
Reviewed By: achen1

Differential Revision: D4822080

fbshipit-source-id: a0f09eedca40ccc72581b7f6e55a09d9e8f3f61f
2017-04-03 18:48:47 -07:00
Spencer Ahrens e8f9c442d6 Fix separator keys for LayoutAnimation
Summary:
Should key separators with their cells.

**Test Plan**

before/after in this video: https://youtu.be/vid1w5x8-58

Reviewed By: achen1

Differential Revision: D4821708

fbshipit-source-id: 261f1bac34dfa9001297a24a44f11128f338e62b
2017-04-03 18:48:47 -07:00
Spencer Ahrens f186cfb9d6 Allow override of `scrollEventThrottle` (in case `useNativeDriver` is not an option)
Reviewed By: achen1

Differential Revision: D4819635

fbshipit-source-id: 9cc7b32e05bf2c573553b9806a17141f1783a1c6
2017-04-03 18:48:46 -07:00
Spencer Ahrens 22a4205bdd onEndReached should clear when data changes
Summary: it's possible to update data and not have the content length change, which could prevent onEndReached from ever firing again, so fix that.

Reviewed By: bvaughn, yungsters

Differential Revision: D4783818

fbshipit-source-id: ec4640f4b8cf820165b045eaafee6fb41c0b0499
2017-03-28 20:07:09 -07:00
Spencer Ahrens acc1edd188 expand example with `PureComponent` usage, explicit `extraData` prop, `initialNumToRender`
Summary: Should help with some common pitfalls, e.g. https://github.com/facebook/react-native/issues/12512#issuecomment-289521758.

Reviewed By: yungsters

Differential Revision: D4781833

fbshipit-source-id: 3dec2f0c444645ad710e9ed81390636da4581f0f
2017-03-27 20:00:10 -07:00
Eric Vicenti ff4468ad1b Re-License Lists with standard React Native License
Reviewed By: sahrens

Differential Revision: D4771084

fbshipit-source-id: 9878a813b7dacb6ec1215fee469b946df0752de9
2017-03-24 14:31:19 -07:00