Add animation to an ExpandableListView

前端 未结 5 1644
星月不相逢
星月不相逢 2021-02-08 05:44

Is there a way to add animation when opening an expandable list in Android? I want it so that when the user clicks on the expandable list, it has an animation/effect like I\'m o

5条回答
  •  既然无缘
    2021-02-08 05:59

    So what I've done is use a regular ListView and then perform the animation in onListItemClick. The animation is similar to what I do at this link: Android animate drop down/up view proper

    But only for a portion of the row view. The row view is implemented in following way in xml:

    
        
        
        
        
    
    

    The normal is used without expand. When expand is activated the expanded is set to visible instead of gone. You need to keep control of setting it to gone again when closing (remember this is set at your convertviews which are recycled).

    I can clarify further if needed, it's just quite a lot of code to put in.

提交回复
热议问题