Reputation: 117
I only have 1 child view for each group view, which is inflated from a layout .xml file. I wish to animate the child view so that when the child item is displayed, the list item below it slides down. I tries this with a number of animations, but the isse is that the height/ width of the child view is first made visible and then the view animates within that space. However, I want a child view to show between 2 list views by making the following group view slide down to make way for the chile view.
For exanple, I tried the following. The animation does happens, but not as I have described above. I have added the following to the getChildView(), just before I return the child view:
Animation anim = AnimationUtils.loadAnimation(MyExpandableList.this,
R.anim.translate);
v.setAnimation(anim);
Here's is my translate.xml:
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromYDelta="-50%p"
android:toYDelta="0"
android:duration="500"/>
Thanks for your help.
Ani.
Upvotes: 3
Views: 1363
Reputation: 24233
You have to animate all child views below the currently added child view also.
Add all the Aniamtions
to an AnimationSet
and start the set.
Upvotes: 1