Skip to content
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

Fix RefreshControl race condition #7683

Closed

Conversation

janicduplessis
Copy link
Contributor

Improved version of #7317.

setRefreshing and setProgressViewOffset needs to be called after the view has been layed out. Instead of using post to do that we update the refreshing and progressViewOffset values in the first call to onLayout.

I also noticed that progressViewOffset default value wasn't exactly the same as when not calling setProgressViewOffset at all. Tweaked the values to match android defaults.

Test plan (required)
Make sure the integration test passes,
In UIExplorer: test RefreshControl with refreshing = true initially, test progressViewOffset.

@ghost
Copy link

ghost commented May 23, 2016

By analyzing the blame information on this pull request, we identified @bestander and @UnoDeTantos to be potential reviewers.

@ghost ghost added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels May 23, 2016
@bestander
Copy link
Contributor

Great job, @janicduplessis!
O wonder if this will make the test less flaky now.

@bestander
Copy link
Contributor

@facebook-github-bot shipit

@ghost ghost added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels May 23, 2016
@ghost
Copy link

ghost commented May 23, 2016

Thanks for importing. If you are an FB employee go to Phabricator to review.

@ghost ghost closed this in bb5aede May 23, 2016
bubblesunyum pushed a commit to iodine/react-native that referenced this pull request Aug 23, 2016
Summary:
Improved version of facebook#7317.

`setRefreshing` and `setProgressViewOffset` needs to be called after the view has been layed out. Instead of using `post` to do that we update the `refreshing` and `progressViewOffset` values in the first call to `onLayout`.

I also noticed that `progressViewOffset` default value wasn't exactly the same as when not calling `setProgressViewOffset` at all. Tweaked the values to match android defaults.

**Test plan (required)**
Make sure the integration test passes,
In UIExplorer: test RefreshControl with `refreshing = true` initially, test `progressViewOffset`.
Closes facebook#7683

Differential Revision: D3334426

fbshipit-source-id: ddd63a5e9a6afe2b8b7fe6a25e875a40f4e888c6
mpretty-cyro pushed a commit to HomePass/react-native that referenced this pull request Aug 25, 2016
Summary:
Improved version of facebook#7317.

`setRefreshing` and `setProgressViewOffset` needs to be called after the view has been layed out. Instead of using `post` to do that we update the `refreshing` and `progressViewOffset` values in the first call to `onLayout`.

I also noticed that `progressViewOffset` default value wasn't exactly the same as when not calling `setProgressViewOffset` at all. Tweaked the values to match android defaults.

**Test plan (required)**
Make sure the integration test passes,
In UIExplorer: test RefreshControl with `refreshing = true` initially, test `progressViewOffset`.
Closes facebook#7683

Differential Revision: D3334426

fbshipit-source-id: ddd63a5e9a6afe2b8b7fe6a25e875a40f4e888c6
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants