Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controlling the color of the fading edge in ListViews

I have a theme that derives from Android's default light theme. My ListViews are configured with a white background, and I guess as a side-effect of this, the color of the fading edge is white, which is not something that I want - I'd like them to be black.

It seems impossible to simply change the color of the edge (although I can control the length and other factors), and the usual suggestion of using a black color for listview's hint color results in some pretty horrible side-effects when the list scrolls.

Can anyone advise a reliable way of changing the color of the fading edge to an arbitrary color?

like image 721
Melllvar Avatar asked Jan 13 '11 08:01

Melllvar


People also ask

What is fadinglistview in Salesforce?

The class FadingListView is a solution to these problems. A changed list view item is displayed in a different color than the other list view items to make it stick out; to show it is a “hot” item. The item will then slowly cool with time and change to its original color, i.e. normal color.

How do I edit or delete a list view?

Figure 1: The demo application with the list view control. Normally a list view is updated by a user directly by selecting a list view item and then editing or deleting it. New items are usually added at the bottom of the list. This works fine since the user knows which items have been changed or deleted and where the new items will pop up.

How do I update a list view?

Normally a list view is updated by a user directly by selecting a list view item and then editing or deleting it. New items are usually added at the bottom of the list. This works fine since the user knows which items have been changed or deleted and where the new items will pop up.

What are the disadvantages of a list view in Salesforce?

A drawback of it is that, if the list is sorted, then new items will not be displayed in a sorted way, instead they will be listed in the order of being created. Some list views however are automatically modified because of some event which causes the list view to be updated.


1 Answers

It's actually much easier then that.

You can change the colour of the fade to anything you want using the: 'android:cacheColorHint' setting.

eg:

<ListView
....
android:cacheColorHint="#FFFFFF"
/>
like image 90
Scott Avatar answered Sep 29 '22 13:09

Scott