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

Add progressViewOffset on iOS #11356

Closed
wants to merge 7 commits into from
Closed

Add progressViewOffset on iOS #11356

wants to merge 7 commits into from

Conversation

scarlac
Copy link
Contributor

@scarlac scarlac commented Dec 7, 2016

Fixes #10718. This adds support for the progressViewOffset on the
RefreshControl component on iOS.

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 7, 2016
@ericnakagawa
Copy link
Contributor

@scarlac Hey Seph, is there anyway we could add some tests around these changes?

@scarlac
Copy link
Contributor Author

scarlac commented Dec 8, 2016

@ericnakagawa I get where you're going though I'm not sure how to go about it.

I could maybe make an assertion so that we're guaranteed that we're repositioning "something" but it wouldn't guarantee it would be the spinner. What's your opinion on that?

// UIRefreshControl is managed so avoid changing it directly
// This method may break in future versions of iOS (subview structure may change)
// And self.transform won't shift title text
if(_isInitialRender) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what view are we looking for? can we be more certain that it's the right one.
also I would a better explanation as to what view you're looking for so that whomever has to fix this when it breaks knows what to do :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion, @mmmulani! I actually forgot about that I could inspect the UI layers.
I'm thinking of this, which seems to work:

NSString *subviewClass = NSStringFromClass([subview class]);
if([subviewClass isEqualToString:@"_UIRefreshControlModernContentView"]) { ... }

I will look into adding a test instead of doing this runtime this week.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a look at this PR again. I'm concerned about the code here. It's been a while since I've worked on iOS and I am not sure about what current best practices are. @mmmulani do you approve of this method for finding the progress view subview?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, cc @brentvatne since it sounded like you were interested in this PR. Can you take a look?

@hramos
Copy link
Contributor

hramos commented Jan 20, 2017

Waiting on tests.

@scarlac
Copy link
Contributor Author

scarlac commented Jan 20, 2017

Where can I find some info on writing tests for React Native?

@hramos
Copy link
Contributor

hramos commented Jan 20, 2017

I suggest taking a look at the existing set of tests. They can be found within the Examples/UIExplorer app.

# Conflicts:
#	React/Views/RCTRefreshControl.m
@mkonicek
Copy link
Contributor

mkonicek commented Mar 14, 2017

Should this PR also contain docs for the new prop, as propTypes on the RefreshControl so it gets displayed on the website?

@ptomasroos
Copy link
Contributor

@scarlac can you update this pr? Otherwise I can fork it and fix the last details?

@scarlac
Copy link
Contributor Author

scarlac commented Mar 15, 2017

@mkonicek: I've updated the docs - the prop already exists, so I've just removed the "@platform android" tag.
@ptomasroos: I won't have the time to write an integration test for this. I'll have to leave it up to you to do that, if necessary.
Thanks for the follow up guys!

@ptomasroos
Copy link
Contributor

I dont see why would need integration tests for this, I guess a test plan with added examples with progressViewOffset in the UIExplorer would do, right @hramos @mkonicek ?

@hramos
Copy link
Contributor

hramos commented Mar 15, 2017

That works for me.

@arsen
Copy link

arsen commented Apr 5, 2017

Looks like it is breaking it, it is not showing refresh indicator while you are scrolling down.
refreshcontrol

@Weakky
Copy link

Weakky commented May 8, 2017

Are there any news about that PR guys ? I'm having the same issue as @arsen here.

@hramos hramos closed this May 15, 2017
@scarlac
Copy link
Contributor Author

scarlac commented May 18, 2017

@Weakky See my comment on #10718 - I don't have the time to fix it at the moment, sorry

wschurman referenced this pull request Sep 5, 2017
Summary:
Previous `contentOffset` can be invalid for a new layout and overscroll the ScrollView, so the diff fixes that.
Also documented here: #13566

Reviewed By: mmmulani

Differential Revision: D5414442

fbshipit-source-id: 7de1b4a4571108a37d1795e80f165bca5aba5fef
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants