[Android] Implement fading edges for ScrollView and it's dependent FlatList#26163
[Android] Implement fading edges for ScrollView and it's dependent FlatList#26163andre-krueger wants to merge 1 commit into
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. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
702084e to
1979c1f
Compare
analysis-bot
left a comment
There was a problem hiding this comment.
Code analysis results:
eslintfound some issues. Runyarn lint --fixto automatically fix problems.
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
1979c1f to
f1213a1
Compare
f1213a1 to
3bae7cc
Compare
|
Oh man that options list is getting pretty large...can you make it slightly larger by adding "android-only" to this new option so people don't get confused on iOS and this it's a bug when nothing happens? Also, could you or someone you work with implement support for iOS as well? It would be awesome to have platform parity on as many features as possible. This is a bit old, but is probably still relevant: https://www.cocoanetics.com/2011/08/adding-fading-gradients-to-uitableview/ |
sahrens
left a comment
There was a problem hiding this comment.
nevermind, your OS === android check is probably fine.
There was a problem hiding this comment.
Oh I see you added an android check - that's fine.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@sahrens is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
This pull request was successfully merged by André Krüger in f8a64f9. When will my fix make it into a release? | Upcoming Releases |
|
Is there a need to have a distinction between That would make this go from needing three props, to only one. :) |
|
I agree, let's only have a single edge length prop. I'm reverting now. |
…ollView and it's dependent FlatList" Summary: After some thought, we decided we don't need the flexibility of separate horizontal and vertical props - it would be much nicer to just have a single prop for the edge length and then the native code can enable the booleans as appropriate. Original PR: #26163 Original commit changeset: f72a9a890d90 Reviewed By: TheSavior Differential Revision: D16997468 fbshipit-source-id: 7973262287a7ec2cee5957f8dc1806a0f28c1432
3bae7cc to
51acd31
Compare
|
I did combine the props to a single one, but unfortunately, I don't feel too confident to also implement the feature for iOS (I might be able to do that in a follow-up, though). |
There was a problem hiding this comment.
Do we need this Boolean? Or can we just check whether the length is 0 for disabled, non zero for enabled?
There was a problem hiding this comment.
Yeah, you're right. Fixed.
51acd31 to
841b6df
Compare
elicwhite
left a comment
There was a problem hiding this comment.
Thanks for the update, this is really close! Two more small nits.
There was a problem hiding this comment.
This isn’t needed here anymore, right?
There was a problem hiding this comment.
Can you add a bit more description here? Assume that what you put here will be the sentence describing what this prop does in our websites api documentation.
There was a problem hiding this comment.
Thanks for the feedback. I added more description.
841b6df to
de33eb8
Compare
elicwhite
left a comment
There was a problem hiding this comment.
Looks good! Approved for someone to land on Monday
There was a problem hiding this comment.
Ah, just checking this one last time made me realize that if the prop is set to 0 it should become disabled again.
I think this needs the following, right?
else {
view.setHorizontalFadingEdgeEnabled(false);
}
In both files
There was a problem hiding this comment.
Yeah, you're right, this might apply to dev environments where the prop is changed quite often. Maybe the fading edge length should also be reset?
|
Found one more thing that stood out to me. Sorry for the churn and the back and forth! We'll get this in! |
de33eb8 to
df6bb8a
Compare
|
Did you verify that toggling the fade switch in the example correctly shows and hides the fade? |
This should add props for enabling horizontal and vertical fading edges for Scrollview and FlatList. These fading edges are used to communicate to the user that there is more content to see.
df6bb8a to
b86efed
Compare
|
Yes, it works correctly. I'm now also resetting the fading edge length to zero if the fading edges are disabled, just in case. |
|
Ok great. |
|
We are having some trouble landing this PR due to some internal tooling issues around having previously reverting this. I reached out to our Open Source team for support. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@TheSavior is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary
This should add props for enabling horizontal and vertical fading
edges for Scrollview and FlatList.
These fading edges are used to communicate to the user that there is more content to see.
Changelog
[Android] [Added] - fading edges props to the FlatList and ScrollView components
Test Plan
Open the React Native test app and navigate to the FlatList section.
Enable the
useFadingEdgesswitch and insert a number intoFading edge length.