I am trying to get the "fadingEdge" effect working on a list on a Xyboard 10.1 (Xoom 2) running Honeycomb 3.2.2. As a way to demonstrate the problem, I am using the basic android list-view tutorial, described here:
http://developer.android.com/resources/tutorials/views/hello-listview.html
The modified code looks like:
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String[] countries = getResources().getStringArray(R.array.countries_array);
setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, countries));
ListView lv = getListView();
lv.setTextFilterEnabled(true);
lv.setVerticalFadingEdgeEnabled( true );
lv.setHorizontalFadingEdgeEnabled( true );
lv.setFadingEdgeLength( 30 );
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// When clicked, show a toast with the TextView text
Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
Toast.LENGTH_SHORT).show();
}
});
}
Specifically, I added three lines in the middle that enable fading in both directions, and set an arbitrary fade length. I have also verified that valid and expected values are coming back from the get-fade-strength getters, so it is not a matter of the strength getters returning zero.
Note that in our real application, we must enable this functionality programatically, which is why I have not configured this behavior in XML.
Aside from the Xyboard, I have verified that this test class and fading-edge effect successfully works on every other device I have tried, including:
- Galaxy Tab 8.9 (Honeycomb 3.1)
- Galaxy Nexus (ICS 4.0)
- emulator (Honeycomb 3.2)