hey guys Im trying to make a fadeout animation in my to do list app in android. I have this code
public void removeToDo(){
myItems.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) {
ObjectAnimator anim = ObjectAnimator.ofFloat(view, View.ALPHA, 0);
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
items.remove(position);
itemsAdapter.notifyDataSetChanged();
}
});
anim.start();
return true;
}
});
}
yeah its fading out beautifully but the problem is when I added a new Item it reuses the row that fades out the item already so the result is that I will have a new row upon adding a new Item but without text on it.
https://i.sstatic.net/o6wPz.jpg
please help Im just a newbie :)