Animate the removal of a ListView item

后端 未结 4 1852
生来不讨喜
生来不讨喜 2021-01-30 05:33

I\'m attempting to animate the removal of a ListView item using this:

    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Overr         


        
4条回答
  •  再見小時候
    2021-01-30 06:01

    I just found a beautiful solution: https://github.com/paraches/ListViewCellDeleteAnimation

    Here is video: http://www.youtube.com/watch?v=bOl5MIti7n0

    Many thanks to 'paraches' ;)

    Edit

    As of Android version 22.0.0 the new android.support.v7.widget.RecyclerView is available as a successor of ListView. Standard add/remove/update animations are available out of the box. The widget animations are also easy to customize (few custom animations).

    I strongly recommend switching from ListView to RecyclerView if you need custom item animations.

提交回复
热议问题