ExpandableListViewの子をアニメーションで表示させようとしています。Android 2.2 APIを使用しているため、expandGroup(int groupPos、boolean animate)メソッドを使用できません
ここから取得したアニメーションを使用しています:Androidアニメーションのドロップダウン/アップビューが適切
そして、ExpandableListViewアダプタのgetChildViewメソッドで次のようにconvertViewに設定しています。
public View getChildView(int groupPosition, int childPosition, boolean isLastChild,
View convertView, ViewGroup parent) {
...
ExpandCollapseAnimation animation = new ExpandCollapseAnimation(convertView, 500, 0);
convertView.setAnimation(animation);
return convertView;
}
ExpandableListViewのグループをクリックすると、最初にアニメーションのないすべての子が表示され、次に必要に応じてすべての子に対してすぐに展開アニメーションが実行されます。
アニメーションだけを表示するために必要です。どんな助けでもとても素晴らしいでしょう。