0

I want animations, if I add or remove some elements in my custom Item list.

I tried it using

(and maybe some others I didn't found yet)

As I said, I have a Custom View with Items and I add always minimum 2 - depends on the situation. The views are all the same custom views - only different texts and HTML style, but that shouldn't matter. Then I call notifyDataSetChanged().

Both methods above didn't help.
ListViewAnimations resorts my list.
The Handler works sometimes...
and sometimes I've empty views (until I scroll)

Is there any way I can handle that?

ListViewAnimations would be nice, if there is an example with Insertable. I couldn't adapt it for my situation. The Appearance Animations worked nice.

Community
  • 1
  • 1
rala
  • 895
  • 2
  • 18
  • 43
  • 2
    You can use `RecycleView`. It has some default animations when `removing` or `adding` an item to the list. Check [ItemAnimator](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.ItemAnimator.html) for more information – hrskrs Mar 17 '15 at 12:18
  • @hrskrs how to use that with custom `Item`s? – rala Mar 17 '15 at 13:31
  • [here](http://blog.lovelyhq.com/creating-lists-with-recyclerview-in-android/) is an example – hrskrs Mar 17 '15 at 14:26
  • yes it works! - any idea how to highlight an item if I click on the element? – rala Mar 17 '15 at 14:30
  • you can use `xml selector` for focused, clicked, or whatever state. [Here](http://stackoverflow.com/questions/2562051/listview-item-background-via-custom-selector) is an example – hrskrs Mar 17 '15 at 14:40

0 Answers0