ksoichiro / Android-ObservableScrollView

Android library to observe scroll events on scrollable views.
http://ksoichiro.github.io/Android-ObservableScrollView/
Apache License 2.0
9.66k stars 2.06k forks source link

Getting onScrollChanged being called when rotating the screen, with huge scrolling value #108

Open AndroidDeveloperLB opened 9 years ago

AndroidDeveloperLB commented 9 years ago

I'm working on an app that has about the same functionality as of the parallex demo, and for some reason, sometimes, when changing the orientation from portrait to landscape, I've noticed that onScrollChanged gets called with a huge boost to the y-scrolling (448 in the case of HTC One M8) .

This causes an issue when the orientation change has completed , as it puts the scrollview scroll-y about in the middle of the screen.

I've worked on this for the whole day and thought it has something to do with the code I've made, but I still don't know why it occurs.

Here are some extra clues:

  1. it's in an activity.
  2. the bottom area (the content) consist of views that are created both dynamically (via code) and statically (via XML).
  3. the upper area (the imageView/header) is of a constant height of 250dp.
  4. if I don't use "setSaveEnabled(false)" on the ObservableScrollView , the header might go down a bit, causing a gap to appear above it.
  5. on a similar activity, which has all views being created statically (via XML), I can't reproduce it.

How could it be?

mineshpatel1511 commented 9 years ago

Has there been a resolution to this issue? I am facing a similar issue. Please help.