19 Commits
Author SHA1 Message Date
James Ide c704a4caa0 [RN] Split React and React Native imports 2016-05-10 03:13:45 -07:00
James Ide b260838a9f [0.1.0] BREAKING: Must use RN 0.18+
Switch to react-clone-referenced-element
2016-01-19 12:39:30 -08:00
Brent Vatne 06c83dc5ce contentInset prop is optional, should respect that in _restoreScrollView 2015-10-08 21:01:25 -07:00
James Ide 1df3f42ca7 [Perf] Add shouldComponentUpdate check + reduce scroll timeout to 300ms 2015-10-01 00:47:28 -07:00
James Ide 845fb8e173 [Perf/Interaction] Fix jank when letting go and regrabbing after refresh end + avoid spurious setState calls
- If you pulled down, let the refresh complete, then let go and regrabbed the scroll view, RefreshableScrollView would still try to restore the scroll position and you'd see the scroll view jump a bit as the content inset shifted. Get rid of that by looking at `this.state.tracking` when deciding whether to restore the scroll position (need to wait for the `onResponderGrant` callback though, so used rAF for now... should switch to a latch).
- Avoid calling `setState` when the scroll position is positive since the user isn't pulling. Save some power and CPU :)
2015-09-30 20:11:55 -07:00
James Ide a1b8728afe [Interaction] Greatly reduce jankiness when restoring the scroll position
Rewrote the part for restoring the scroll position after refreshing is completed. This mimics the Twitter app in this way where the scroll view is non-interactive while it slides back up from its resting position w/the refresh indicator to its resting position without it. This is feeling close to production quality.
2015-09-30 14:07:18 -07:00
James Ide 3fa54b103d [Bugfix] Accommodate missing contentInset prop or missing fields
If you don't provide a contentInset (or are missing some of the fields) we should not crash or thread through silent NaNs.
2015-09-23 22:05:44 -07:00
James Ide 4d37c1f73a Comment out the scrollTo adjustment when the refresh completes
Feels less janky without this. We should probably animate the contentInset instead.
2015-07-09 13:42:33 -07:00
James Ide f7d174fbe5 Don't hide the indicator unless we're not refreshing and progress = 0
Progress can be zero even if we're refreshing, in which case we still want to show the indicator.
2015-07-08 19:05:56 -07:00
James Ide 9e80086616 Don't start a second refresh until the user has lifted their finger after the first completed
You could get into an aggressive flurry of refreshes if you pulled down to refresh, then kept your finger down while the refresh completes, and then moved your finger a bit to trigger another refresh.

Fix this by requiring the user to have lifted their finger (i.e. for the gesture responder to have stopped tracking) after the refresh completes before allowing a second one.
2015-07-08 15:12:39 -07:00
James Ide 967fd2f2b4 Hide the refresh indicator until the user has started scrolling
This is so that an empty scroll view doesn't show the indicator.
2015-07-08 12:21:05 -07:00
James Ide 7d2af08b28 Get the pull to refresh behavior working
Lots of fixes, especially around using the native adjusted content inset.
2015-07-07 00:39:30 -07:00
James Ide 40a383309e Developing... 2015-07-06 16:15:21 -07:00
James Ide 91191c8858 Use let instead of var in more places 2015-07-06 15:52:19 -07:00
James Ide fa2d2a7ec8 Use cloneReferencedElement and fix scroll component composition 2015-07-06 02:24:26 -07:00
James Ide 1a97c031b7 Use a composed callback refs for the refresh indicator 2015-07-05 23:28:21 -07:00
James Ide 56c6453e83 Use function to render refresh indicator, rename delegate fn to renderScrollComponent 2015-07-05 21:54:56 -07:00
James Ide 0deee37a66 Update license info to standard MIT 2015-05-27 22:23:24 -07:00
James Ide bac6667519 Add source files and a package.json 2015-05-19 21:54:44 -07:00