GithubHelp home page GithubHelp logo

Comments (6)

jkyeo avatar jkyeo commented on August 17, 2024

I have the same issue with you.

from android-parallax-recyclerview.

kanytu avatar kanytu commented on August 17, 2024

Hi..

Sorry for the time I took to help you with this issue.

Could you try recyclerView.getLayoutManager().smoothScrollToPosition instead?

from android-parallax-recyclerview.

jkyeo avatar jkyeo commented on August 17, 2024

@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:

device-2015-06-06-164653
device-2015-06-06-165158
device-2015-06-06-165839

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.

kanytu avatar kanytu commented on August 17, 2024

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.

jkyeo avatar jkyeo commented on August 17, 2024

@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.

kanytu avatar kanytu commented on August 17, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.