-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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 Issue 10718: Add iOS support for progressViewOffset #30737
Fix Issue 10718: Add iOS support for progressViewOffset #30737
Conversation
|
Base commit: f276214 |
Base commit: b32e996 |
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.
Code analysis results:
eslint
found some issues. Runyarn lint --fix
to automatically fix problems.
Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js
Outdated
Show resolved
Hide resolved
Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js
Outdated
Show resolved
Hide resolved
Ping @hramos:
|
Hello @davidbiedenbach, thanks for the PR! I'll take a look on Monday :) |
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.
Could you copy paste code for the test app? Just the JavaScript part is sufficient.
Thank you!
@@ -25,6 +25,7 @@ - (UIView *)view | |||
RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor) | |||
RCT_EXPORT_VIEW_PROPERTY(title, NSString) | |||
RCT_EXPORT_VIEW_PROPERTY(titleColor, UIColor) | |||
RCT_EXPORT_VIEW_PROPERTY(progressViewOffset, float) |
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.
Let's make this into CGFloat
. It better expresses the use of the property.
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.
Updated, thanks for the feedback!
@sammy-SC here's the test code. Thanks again!
|
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.
@sammy-SC has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
Thank you for the PR.
// offset in the view hierarchy, and that progressViewOffset is not inadvertently applied | ||
// multiple times. | ||
UIView *scrollView = self.superview; | ||
UIView *target = scrollView == nil ? nil : scrollView.superview; |
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.
Just a tip about obj-c :) Btw you can just call scrollView.superview
. In case scrollView is nil, nil is returned from the entire expression. No need to handle nil case explicitly.
I'll change it.
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.
Ohhh. You're right, I completely forgot that dot syntax is just sending a message to a property getter here, isn't it? I'll try to remember that for next time. Thanks for the tip (and the correction)!
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.
Sending a message to nil does nothing in Obj-c. It is a feature, not a bug :)
I'll merge this on Monday.
Thank you.
Summary: Fixes facebook#10718, bringing `progressViewOffset` support to iOS. Thanks to Taylor123 for the initial PR upon which this fix is based. ## Changelog [iOS] [Fix] - `progressViewOffset` prop of `RefreshControl` and `VirtualizedList` now works on iOS Pull Request resolved: facebook#30737 Test Plan: Tested with quick-and-dirty sample app. ![progressViewOffset-iOS](https://user-images.githubusercontent.com/1563532/104526540-82fe1d80-55b7-11eb-9f99-e025bedf4874.gif) ## Documentation The corresponding documentation update PR can be found [here](facebook/react-native-website#2441). Reviewed By: kacieb Differential Revision: D26813977 Pulled By: sammy-SC fbshipit-source-id: 45cc5a647d70e44a29c6391b7586cb41ca011bef (cherry picked from commit 310a6bc)
Summary
Fixes #10718, bringing
progressViewOffset
support to iOS.Thanks to @Taylor123 for the initial PR upon which this fix is based.
Changelog
[iOS] [Fix] -
progressViewOffset
prop ofRefreshControl
andVirtualizedList
now works on iOSTest Plan
Tested with quick-and-dirty sample app.
Documentation
The corresponding documentation update PR can be found here.