[Tut]Using AlphabetIndexer for fastscrolling ListView

Tutorials with advanced 'difficulty' and more Lines of Code.

Postby rciovati » Fri Apr 30, 2010 8:15 pm

I have a code like your but mime draw the letter black instead of white (that i want).
Is there a way to style it? I don't understand why it is drawn black :(
rciovati
Developer
Developer
 
Posts: 25
Joined: Mon Jan 04, 2010 12:52 am
Location: Milano (Italy)

Top

Re: [Tut]Using AlphabetIndexer for fastscrolling ListView

Postby Zeba Momin » Mon May 24, 2010 1:38 pm

Hi,
I'm using the SectionIndexer but i want to change the text color of the indexer alphabets.
I tried adding the following property to my ListView tag in xml:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. android:cacheColorHint="#00000000"
Parsed in 0.000 seconds, using GeSHi 1.0.8.4

but it didn't make any difference indexer alphabets.
Can someone plzz help me how to go about this... Thanks.
Zeba Momin
Developer
Developer
 
Posts: 49
Joined: Thu Sep 17, 2009 6:53 am

Re: [Tut]Using AlphabetIndexer for fastscrolling ListView

Postby rciovati » Mon May 24, 2010 1:49 pm

You have to change through themes the android:textColorPrimary color :)
rciovati
Developer
Developer
 
Posts: 25
Joined: Mon Jan 04, 2010 12:52 am
Location: Milano (Italy)

Re: [Tut]Using AlphabetIndexer for fastscrolling ListView

Postby Zeba Momin » Mon May 24, 2010 2:00 pm

Thanks rciovati for replying.
Can u plzz explain to me how do i change the android:textColorPrimary property ?
Zeba Momin
Developer
Developer
 
Posts: 49
Joined: Thu Sep 17, 2009 6:53 am

Re: [Tut]Using AlphabetIndexer for fastscrolling ListView

Postby rciovati » Mon May 24, 2010 2:15 pm

Zeba Momin wrote:Thanks rciovati for replying.
Can u plzz explain to me how do i change the android:textColorPrimary property ?


Sure :)

Open your res/values/themes.xml file (or create it) and enter this code:
Code: Select all
<style name="MyCustomStyle" parent="@android:style/Theme">
   <item name="android:textColorPrimary">#00000000</item>
</style>


Open AndroidManifest.xml file and change

Code: Select all
<activity android:name="MyActivity"></activity>


in

Code: Select all
<activity android:name="MyActivity" android:theme="@style/MyCustomStyle"></activity>
rciovati
Developer
Developer
 
Posts: 25
Joined: Mon Jan 04, 2010 12:52 am
Location: Milano (Italy)

Re: [Tut]Using AlphabetIndexer for fastscrolling ListView

Postby Zeba Momin » Mon May 24, 2010 2:37 pm

Thank you so much rciovati.. dat worked perfectly well... :) thanks....
Zeba Momin
Developer
Developer
 
Posts: 49
Joined: Thu Sep 17, 2009 6:53 am

Top

Re: [Tut]Using AlphabetIndexer for fastscrolling ListView

Postby miannelle » Sat Nov 06, 2010 8:18 pm

This was a great tutorial and I now have it working in one part of my code, thanks. What I don't know how to do is to implement it with my own custom adapter. My adapter changes fonts, changes icons etc. Could you explain how to use the AlphabetIndexer with a custom adapter please?
miannelle
Freshman
Freshman
 
Posts: 3
Joined: Thu Feb 18, 2010 8:04 pm

Re: [Tut]Using AlphabetIndexer for fastscrolling ListView

Postby andywhoa » Thu May 19, 2011 9:10 pm

I'm having trouble with this.

My case is slightly different than the example.

My user has a button that toggles between 2 different sort methods. I only want to use the AlphabetIndexer when the sorting method is set to alpha.

The only difference between this example and my application is that I create a new instance of AlphabetIndexer in the changeCursor() handler of my SimpleCursorAdapter (if the sort method is set to alpha). If the sort method is not alpha, I null the AlphabetIndexer and set fast scrolling to false.

I've stepped through the code and it is hitting the block to enable fast scrolling and create the AlphabetIndexer, but nothing happens on my device...
andywhoa
Experienced Developer
Experienced Developer
 
Posts: 82
Joined: Tue Jul 20, 2010 12:46 am
Location: Across the pond

Top
Previous

Return to Advanced Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests