2

I have a ListView with several rows, and the user can start async tasks by pressing buttons on these rows. When a task is started, the corresponding row should show some "Loading" View, and when the task finishes, the row should show the results of that async task.

Functionally, everything is working currently. But I'd like to switch a row's state using animations. Right now, I always call .onDataSetChanged() on the ListView's adapter when a row's state has to change (e.g. Loading -> Some content). But this reloads/redraws the whole ListView.

I only want to modify a single row, and I'd like to do it with a nice animation. AFAIK, you always have to call .onDataSetChanged() on the adapter, whenever the data behind the ListView changes, or else you get an Exception.

So is it possible to somehow load new data into a ListView row, and present it with animation (that affects only the modified row)?

Thanks

1 Answer 1

3

Well 1 way to do it was select the child view and add the animation to that view. And when the animation is done you could update the values for the view. Something like getListView.getChildAt(index).startAnimation(anim);

And add a animation listener to 'anim' so you can update the values when the animation ends.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.