开发者

Android : Is there a way to animate both group and listview of an ExpandableListView?

I'm new to StackOverflow and I hope to find some help about ExpandableListView.

I'm using an ExpandableListView having several 开发者_C百科groups but only one child in each group. The child is a custom view (FrameLayout) which contains some ImageViews. Only one group can be expanded at the same time (this is ok).

I would like to animate the expand and collapse actions : as soon as a group header is clicked, an animation should collapse the current expanded group if any and an other animation should expand the clicked group.

I would like the animation to be a smooth transition animating both the child view (hiding progresively if collapsing or showning progressively if expanding) and the other groups (which should move progressively with the hiding/showing of the child view).

I tried to animate the child view without great success : I didn't find how to define the "progressively hiding/showing" animation. I used the default android one called slide_in_left for test purpose but it is animating only the child view.

Can someone help me to find a way to animate smoothly the showing/hiding of the child view and allowing the groups header to follow this animation ?

Thanks a lot,

Massou


lstdata= (ExpandableListView)findViewById(R.id.walllist);

int flag=1;
adapter=new MydataAdapter(this,flag,wallpostlist);
lstdata.setAdapter(adapter);

adapter.notifyDataSetChanged();

lstdata.setOnGroupExpandListener(new OnGroupExpandListener() {
    @Override
    public void onGroupExpand(int groupPosition) {
        int len = lstdata.getAdapter().getCount();
            if(i != groupPosition) {
                lstdata.collapseGroup(i);
            }
        }
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜