Comments (6)
I have the same issue with you.
from android-parallax-recyclerview.
Hi..
Sorry for the time I took to help you with this issue.
Could you try recyclerView.getLayoutManager().smoothScrollToPosition instead?
from android-parallax-recyclerview.
@kanytu
SmoothScrollToPosition() has no such issue both on recyclerView or recyclerView.getLayoutManager() object. But ScrollToPosition() has such issue on both of them.
Well, it looks like that ScrollToPosition() also push the parallax header the same distance as the recyclerView items. For example in the screenshot:
As you can see. I scroll the recyclerView for the distance about a half of the parallax header height. And then call ScrollToPosition(0) method. It shows the last pic.
Think that if I scroll the recyclerView for more distance, the parallax header will be pushed out of screen. SO , it disappear.
from android-parallax-recyclerview.
But didnt you solved your problem by changing to smoothscroll? Because the problem is that scrolltoposotion doesn't call onSroll. That's why you get that effect
from android-parallax-recyclerview.
@kanytu Yes, smooth scroll do resolve this problem. But in some situation, for example, long recyclerView, smooth scroll need wait for a relatively long time. So, it need scrollToPosition().
So, is it possible that scrollToPosition() method go well in parallax-recyclerView?
Thank you for your reply, @kanytu .
from android-parallax-recyclerview.
@kooze I will need you to override LinearLayoutManager to change the method for smoothScrollToPosition. The problem here is that scroolToPosition doesn't call the listener onScroll which is responsible to change the view offset.
http://stackoverflow.com/a/28853254/3410697
Here you can find an explanation of how to change the speed of smoothScrollToPosition. The first solution should be the best one. The calculateSpeedPerPixel is controls the speed of the scroll animation. With some tweaks you should be able to mimify the same effect of scrollToPosition()
Good luck :)
from android-parallax-recyclerview.
Related Issues (20)
- First Item indeterminate, especially with no header. HOT 1
- Min header heigh HOT 6
- Margin for header HOT 1
- Add another header HOT 5
- Changing parallax factor HOT 2
- Modify header in runtime HOT 3
- Getting percentage (and offset) wrong HOT 3
- percentage's value can read 100.0 HOT 1
- How can I get reference to View Object in layout which I have inflated in RecyclerView for Header? HOT 1
- When used in conjunction with widget of swiperefreshLayout a bug
- Does this work when the header layout is using databinding?
- onCreateViewHolderImpl never called HOT 6
- getAdapterPosition() wrong index, outOfBounds exception HOT 2
- Adding It To Library Project HOT 1
- Help needed HOT 1
- i need help in gridview HOT 1
- Adapter HOT 1
- overlay a header to a description element
- Dependency issue
- Zoom Effect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-parallax-recyclerview.