-
Notifications
You must be signed in to change notification settings - Fork 282
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
Contents overlap header item #7
Comments
I spent my whole morning trying to fix this issue with no success. The problem is that layoutManager is detaching the header from the recyclerview when the card reaches the top. I posted a question on stackoverflow and I will keep looking for a solution to this problem: |
@kanytu I really appreciate your time & effort trying to solve it, I also spent a whole day trying 😄 and I'll still struggling till it being solved. |
So I found a workaround for this. You will have to update your version because I made some changes. 9844c3f Next you will have to change your activity/fragment layout so that you have a view just like the header behind your RecyclerView. It should look like this:
Next change your current header to have an alpha of 0. That will make it transparent and work as a placeholder. This way the header you actually see when you run is not the header itself but the view you added behind the RecyclerView. Next implement In conclusion:
I've uploaded a new branch to my example-project so that you see what needs to be changed. kanytu/example-parallaxrecycler@867de6d I will leave the issue open until someone finds a better solution |
is that example-project displaying a cardview like the above gif? where can I view the code behind the recyclerview with cards? thanks |
Yes @sirvon. That's a CardView layout. Refer to this https://developer.android.com/training/material/lists-cards.html for more information. A simple example of a row layout is:
|
@kanytu I really thank you for your effort to make it work 👍, sorry for late response because I was kinda busy past 3 days. |
I've created a branch with an attempt to fix this https://github.com/kanytu/android-parallax-recyclerview/tree/fixing7: You should use now You should also call:
And also call: |
Try, This Library .Helped me ! |
Is it possible to make
RecyclerView
content overlaps little bit upon the header, something like Google's Play Newsstand??I have tried to mimic that behavior by adding an additional offset to
setClipY
function, I could make contents overlap header but the problem is the header disappears early when first item reaches top edge of the view port.Also the header appears with additional offset when scrolling down again.
Demo:
![Demo](https://camo.githubusercontent.com/72b4b9c381a318a43c5518b49202ab0718bdaad67c1bbd8355fb695baf9fc581/687474703a2f2f7332312e706f7374696d672e6f72672f356c623479313239332f707265766965772e676966)
Code:
The text was updated successfully, but these errors were encountered: