Skip to content
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

Bug : getting a gap on the header area in case the scrollView's LinearLayout child removes views #96

Open
AndroidDeveloperLB opened this issue Nov 25, 2014 · 4 comments

Comments

@AndroidDeveloperLB
Copy link

Scenario:
make the app have the FadingActionBar , with parralex effect and an imageView in the header.
The bottom area (the content) should be a vertical LinearLayout and a lot of views, enough to be able to scroll.
At runtime, scroll a bit down and then cause the LinearLayout to remove some of its views.

The bug:
the imageView on the top gets an empty gap below itself, which doesn't contain anything.

How do I solve this?

@Suresh1988
Copy link

For the above scenario, you could try the following option:

  1. Get the removed view height
  2. Get the current ObservableScrollview scrollY position
  3. Deduct the scrollY value with the removed view height and get the newscrollY value
  4. call the ObservableScrollview.scrollTo(0,newscrollY)

Then the gap wont appear

@doodlleus
Copy link

i have this issue using a listview if i reinitialize the adapter. any ideas how i would go about sorting this issue for a listview that doesn't have the observablescrollview property?

@doodlleus
Copy link

actually I can see a way forward. by making the base class' onNewScroll() method public, i can call it using the necessary offset.

@FarhanAhmad
Copy link

+1 for the problem. M trying with the logic but not clear about the offset i need to use. any help @doodlleus ? did u make it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants