-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support snapToInterval for horizontal scrollview on Android #10242
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! |
@pp026pp updated the pull request - view changes |
a354080
to
44459b6
Compare
@pp026pp updated the pull request - view changes |
@pp026pp does this only work for the horizontal scrollview? we might want to add support for the verticle scrollview as well. Also, it would be nice to update the docs to have |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also make this work on both horizontal and normal scrollview.
@@ -497,6 +498,10 @@ const ScrollView = React.createClass({ | |||
props.decelerationRate = processDecelerationRate(decelerationRate); | |||
} | |||
|
|||
if (Platform.OS === 'android' && props.snapToInterval) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't happen here. It should be adjusted in native code like we do all other measures
@pp026pp updated the pull request - view changes |
6af6c72
to
277dde4
Compare
@pp026pp updated the pull request - view changes |
@@ -12,6 +12,7 @@ | |||
'use strict'; | |||
|
|||
const ColorPropType = require('ColorPropType'); | |||
const Dimensions = require('Dimensions'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no-unused-vars: 'Dimensions' is defined but never used
@dmmiller @lelandrichardson Thanks for the review! Looks like |
277dde4
to
c894826
Compare
@pp026pp updated the pull request - view changes |
@pp026pp seems reasonable... we'd be in a strictly better place than we were in before |
c894826
to
0610854
Compare
@pp026pp updated the pull request - view changes |
@pp026pp can you rebase again? I think you're stuck on a broken sha |
+1 |
@pp026pp can you rebase? |
@pp026pp - rebase please :O |
0610854
to
0c44323
Compare
Sorry to comment on an old, closed pull-request. Was this only closed because the maintainer disappeared? Would love to finish this off, especially if it was just a rebase that prevented merging |
It was closed due to non-response for almost two months. Feel free to open a new PR. |
Summary: `snapToInterval` is available on iOS but on android yet. This PR is to add support for `snapToInterval` on android. Example: ![android_snap](https://cloud.githubusercontent.com/assets/1699429/19086983/39d3ee1c-8a25-11e6-9c84-20f25a751f32.gif) TO: lelandrichardson spikebrehm Closes #10242 Differential Revision: D4168527 fbshipit-source-id: de3dd9ac5d9e0fddfce5e5bc0aa6a4f33f1e30b3
Summary: `snapToInterval` is available on iOS but on android yet. This PR is to add support for `snapToInterval` on android. Example: ![android_snap](https://cloud.githubusercontent.com/assets/1699429/19086983/39d3ee1c-8a25-11e6-9c84-20f25a751f32.gif) TO: lelandrichardson spikebrehm Closes facebook/react-native#10242 Differential Revision: D4168527 fbshipit-source-id: de3dd9ac5d9e0fddfce5e5bc0aa6a4f33f1e30b3
Summary: `snapToInterval` is available on iOS but on android yet. This PR is to add support for `snapToInterval` on android. Example: ![android_snap](https://cloud.githubusercontent.com/assets/1699429/19086983/39d3ee1c-8a25-11e6-9c84-20f25a751f32.gif) TO: lelandrichardson spikebrehm Closes facebook#10242 Differential Revision: D4168527 fbshipit-source-id: de3dd9ac5d9e0fddfce5e5bc0aa6a4f33f1e30b3
snapToInterval
is available on iOS but on android yet. This PR is to add support forsnapToInterval
on android.Example:
TO: @lelandrichardson @spikebrehm