tjerkw/Android-SlideExpandableListView — pull request #89 by valbertos (2014-11-08 13:27:26+00:00)
Title: Added suport for animation’s listener with an example

Hi!

I use this library frequently and I think it’s really useful. But something I’ve missed so far it’s a group of callbacks to listening for when a row is expanding or collapsing (starting or ending). For that reason, I’ve added a simple interface to handle it:

public interface SlideExpandableListener {
public void onStartExpandAnimation(View view, int position);
public void onEndExpandAnimation(View view, int position);
public void onStartCollapseAnimation(View view, int position);
public void onEndCollapseAnimation(View view, int position);
}

This interface could be implemented and linked to an instance of SlideExpandableListAdapter as follow:

slideAdapter.setExpandableSlideListener(new SlideExpandableListener() {

@Override
public void onStartExpandAnimation(View view, int position) {
Log.d("slide", "start animation expand with item position: " + position);
}

@Override
public void onEndExpandAnimation(View view, int position) {
Log.d("slide", "end animation expand with item position:" + position);
}

@Override
public void onStartCollapseAnimation(View view, int position) {
Log.d("slide", "start animation collapse with item position: " + position);
}

@Override
public void onEndCollapseAnimation(View view, int position) {
Log.d("slide", "end animation collapse with item position: " + position);
}
});

Also, I’ve faced a few problems trying to compile the project with the current version of Android Studio (0.8.14). So I've had to make some changes to get it to work.

Greetings,
Victor.