0

I have a ListView.

I'm using anArrayAdapter and I'd like to: when the user clicks any item on the list, its LinearLayout (is just a content for x information) fades out and is substituted by other LinearLayout (with y information) which fades in.

However, I do not know how to apply this on my ArrayAdapter. I've searched for a while but I'm not understanding how can I access a single item from the Adapter and make it's children fade out or fade in.

Any help would be very appreciated. Thank you very much for your time.

Arshad Ali
  • 3,082
  • 12
  • 56
  • 99
user3050910
  • 3,107
  • 3
  • 13
  • 11

1 Answers1

2

In general - adapters do not hold items the role of adapter is to get data model, and to produce item views when i.e. list view needs them.

The main concept of replacing item is to replace data inside the adapter and call notifyDataSetChanged(); - thats all.

I don't like ArrayAdapter as it's aimed for very simple scenarios. Usually I just create my own Adapter class extending BaseAdapter (just 4 methods to implement).

The transitions of items on ListView are described here: Adding animation to a List View in Android

Community
  • 1
  • 1
piotrpo
  • 12,398
  • 7
  • 42
  • 58