Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Emeka Farrier
Courses Plus Student 2,892 PointsInfinite Scrolling
So i'm that kind of developer that likes to rebuild frameworks, library's from scratch just for fun though. So i took up the task of building an infinite scroll feature like facebook, twitter apps etc. As I looked for resources online I saw some really complex code to do it. I never went with this approach though. What I did was create a list item with an array adapter an as the user scrolled to the bottom I included some code to check to see if the user had reached the bottom
If that was the case all I did was add more items to the listview and called notifyOnDataSetChanged (I think thats the name)
TO my surprise this worked with just a fraction of code of which I saw from the online resources. The code add new list items to the bottom of the list view while maintaining the position.
Now this baffles be at the same time, is my approach wrong am I not considering any other important factors? Because my code came up to about 10 lines compared to the resources.
1 Answer
Justin Iezzi
18,199 PointsSome libraries, at their core, are fundamentally simple. The added complexity tends to comes from customization features, broad compatibility fixes, performance minded code, and more.
Emeka Farrier
Courses Plus Student 2,892 PointsEmeka Farrier
Courses Plus Student 2,892 PointsGreat Thanks I thought I was doing something wrong and was missing some critical information