ListExpandableView:
Implementation:
listview_row.xml:
- In listview_row xml file we have two relative layout. 1.- rel_top_layout and 2. - rel_bottom_layout
- ByDefault bottom layout visibility is gone and top layout is visible.
- we handle visibility control and animation in this adapter class.
- In below code we are checking any view clickable previously or not, if clickable than we display bottom view for that particular position.
if(stringArrayList.get(position).isDisplayView()){
viewHolder.relBottomLayout.setVisibility(View.VISIBLE);
animation = AnimationUtils.loadAnimation(mContext,R.anim.grow_from_bottom);
viewHolder.relBottomLayout.startAnimation(animation);
} else {
viewHolder.relBottomLayout.setVisibility(View.GONE);
}
- Below code is use for hide and provide animation to bottom view
stringArrayList.get(position).setDisplayView(false);
animation = AnimationUtils.loadAnimation(mContext,R.anim.slide_out_down);
viewHolder.relBottomLayout.startAnimation(animation);
{
@Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationEnd(Animation animation) {
viewHolder.relBottomLayout.setVisibility(View.GONE);
}
});
Download Source Code : http://www.4shared.com/zip/pjG9pilo/ListExpandableView.html


0 comments :
Post a Comment