• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use custom color for each textview in listview that extends SimpleAdapter in Android ?

 
Pritam Shah
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a listview with custom rows and that extends SimpleAdapter.
Each row consist of two linear layouts : 1st having two textviews of which one is hidden in horizontal orientation, second having two textviews in horizontal orientation. Now depending on the value in hidden textview , I want to setcolor for the remaining items for the row.
To put it as simple: each listview item has some custom colors the value of which comes from the hidden field.

I have done this by overriding getview() for the simpleadapter and returning view for each, but this makes list very slow to render (and that I think is obvious as so much of work for each view before showing it).

Can I do this in some more efficient way ? like making views and then add up to list instead of using xml layout maybe one solution OR any other ? Any help ? Thanks.
I have made same post here and here

P.S. : making views and adding up will not solve the problem as the list has a dynamic search box that filters the list as user types, so will result in even slower performance.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This topic discusses two techniques for improving the performance of ListViews. See the linked video for details and explanations.
 
Pritam Shah
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:This topic discusses two techniques for improving the performance of ListViews. See the linked video for details and explanations.


Thanks for pointing to post. I will watch the video and try doing changes to code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic