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

Scrollfix for short list #43

Open
wants to merge 2 commits into
base: scrollfix_for_short_list
Choose a base branch
from

Conversation

jasonsutor
Copy link

Changes:

  1. Adding in project.properties for latest Eclipse ADT build.
  2. Improving code for when call is made to setAdapter(null);
  3. Improving footer height estimation, particularly when list items are variable height.
  4. Improving selection of 0th or 1st element.
  5. Adding in a listener for end of list reached. This allows for endless lists to be created, data can be loaded as user scrolls to bottom.

@johannilsson
Copy link
Owner

Hi, sorry for the late reply to this. Just had a test at it looks good. Will need to change the code style to adapt to previous style though but that's a minor. Would have preferred to have upgrade of sdk and adt in separate commits but it's def fine for now.

When there's very few items the OnEndOfListListener is triggered for every interaction with the list, like adding and removing items. Guess this is what's expected and up to the client to handle the event that's triggered.

Thank you, will merge later on today.

@pathakashish
Copy link

Thank you jasonsutor for these changes.

But I have one issue with this. When the list does not occupy whole screen(consider that list has only 0 or 1 or 2 elements) it constantly shows "Pull To Refresh...". Can you tell me how to handle this so that "Pull To Refresh..." will only be shown when user pulls the list down?

@jasonsutor
Copy link
Author

It shouldn't, it only shows the "Pull To Refresh..." text when I haven't set the adapter. Once I set the adapter the footer view is adjusted to cover enough to scroll the text off screen. If your adapter views start out defaulted to a large size and then shrink as data is loaded then I can see that messing up the footer view calculation.

@pathakashish
Copy link

If we set the PullToRefreshListView height to wrap_content, the above mentioned issue occurs.
When I tried setting the height to fill_parent, it worked fine.

Thank you jasonsutor for this modifications.

@alexfu
Copy link

alexfu commented Jan 16, 2012

Hi, I get the following errors when my adapter calls notifyDataSetChanged: http://pastebin.com/hDZJAiJF It seems like there's an issue with measuring the height of all the items in the list view? I'm not sure but that is where the error is pointing to. Any ideas as to how to fix this?

@jasonsutor
Copy link
Author

Are your LayoutParams set for the new list elements? On line 428 (in API 2.2, other versions have no code on that line) of RelativeLayout.java it is checking mLayoutParams.width, it appears that isn't set which causes the null pointer exception

@alexfu
Copy link

alexfu commented Jan 16, 2012

Yes, I have the list view fill_parent both width and height.

@jasonsutor
Copy link
Author

What about the list items though? The exception would be due to the item's layoutparams not being set.

@alexfu
Copy link

alexfu commented Jan 16, 2012

The list items layout width & height are set.. This error only comes up when I am on this branch. Master branch doesn't have this issue. I can show you the XML code for my list items?

It seems as though it doesn't like RelativeLayout being the child. I switched the list items layout to a LinearLayout and the error is gone.

@monsif
Copy link

monsif commented Sep 14, 2012

hello everyone, firstofall thank you for this librery it wors fine ;) but i found some trouble when trying to integrate a menu on the top, there is no way to inflate the menu class O_o !! can you hep me with this please . thanks a lot

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

Successfully merging this pull request may close these issues.

5 participants