Fast Scroll drag handle similar to Contacts ListView

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Fast Scroll drag handle similar to Contacts ListView

Postby aminaz » Thu Jan 07, 2010 5:14 pm

I have a ListView which contains over a thousand entries (sorted from
A to Z) and want to know how to scroll this quickly similar to how the
Contacts list can be scrolled quickly

How can this be achieved? Is it an option for the view, or do I have
to implement it? Alternatively, is it possible to see the source of
the Contacts ListView as I could probably reuse that.

Thanks.
aminaz
Junior Developer
Junior Developer
 
Posts: 19
Joined: Thu Jan 07, 2010 5:07 pm

Top

Postby wirelessdesigns » Thu Jan 07, 2010 7:09 pm

Faster scrolling behavior can be achieved through the process of recycling view objects that are returned for each item in the list. This increases the efficiency of the code over creating a new object for each row.

This is done best by overriding getView() in your adapter class, as is shown in this example. Checking whether or not "convertView" exists allows the reuse of a view if it matches the adapter's needs.

This will speed up scrolling, but I'm afraid I do not know how to implement the "grabbable" scroll bar widget like the Contacts application does.

Hope that is of some help!
wirelessdesigns
Developer
Developer
 
Posts: 25
Joined: Fri Dec 18, 2009 3:27 pm
Location: Littleton, CO

Postby qlimax » Thu Jan 07, 2010 7:15 pm

¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>
User avatar
qlimax
Master Developer
Master Developer
 
Posts: 271
Joined: Mon Aug 31, 2009 10:54 am
Location: Swiss

Postby qlimax » Fri Jan 08, 2010 12:11 am

¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>
User avatar
qlimax
Master Developer
Master Developer
 
Posts: 271
Joined: Mon Aug 31, 2009 10:54 am
Location: Swiss

Postby aminaz » Fri Jan 08, 2010 9:46 am

Thnks :)))) a lot
aminaz
Junior Developer
Junior Developer
 
Posts: 19
Joined: Thu Jan 07, 2010 5:07 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google Feedfetcher, Majestic-12 [Bot] and 7 guests