views:

113

answers:

2

I have a list of events which are seperated by month and year (Jun 2010, Jul 2010 etc.). I have enabled fast scrolling because the list is really long. I've also implemented SectionIndexer so that people can see what month and year they are currently viewing when scrolling down the list of events at speed.

I don't have any problem with the implementation, just how the information is shown. Fast scrolling with SectionIndexer seems to only really be able to support a label with a single letter. If the list was alphabetised this would be perfect, however I want it to display a bit more text.

If you look at the screenshot bellow you'll see the problem I'm having.

A screenshot of the problem described

What I want to know is: is it possible to change how the text in the centre of the screen is displayed. Can I change it somehow to make it look right (with the background covering all of the text).

Thanks in advance. If you need any clarification, or code just ask.

+1  A: 

The FastScroller widget is responsible for drawing the overlay. You should probably take a look at its source: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob_plain;f=core/java/android/widget/FastScroller.java;hb=HEAD

Search for comment:

// If user is dragging the scroll bar, draw the alphabet overlay

TalkLittle
I've seen that bit as well. How would I go about making it so I can change how FastScroller works? AbsListView provides no way of changing which FastScroller is used (stored in private member mFastScroller). Would I be able to overwirte all the methods in AbsListView where mFastScroller is set and then change it to MyFastScroller or soemthing. I'd then just have to make a copy of FastScroller.java under my package and make the changes I need because it's a private class. It would be great if Android provided a way to do this easily ;-)
matto1990
Yes unfortunately numerous parts of Android still require manual copying/extending rather than having nice access via API. The way you described sounds like the way to go.
TalkLittle
I've made a start on it and there is quite a lot of code (and drawables) which need to be replaced. I'm going to keep at it until I get something manageable. If I get the code to look half decent (might try extending the ListView class to add all the functionality) I'll release the code out because I'd think this is something quite a few people would need at some point.Thanks for the help TalkLittle!
matto1990
A: 

Hi Matto1990, Even I have a similar problem with fast scroll display. Can you help me in this ?

venroid
Afraid not, I've yet to find a good solution short of basically copy all the default code into my package and change the code very slightly to make it do what I want. Which really is a bit stupid. I've sort of left it now, given up on finding an elegant solution.
matto1990