Reputation: 5830
i have a listView which uses a custom .xml for showing each item.
Fine, in this xml i have a CheckBox (with visibility set GONE) and a TextView with a text.
What i want is have an animation which moves the text to the right and shows the CheckBox.
I have the animation working fine for one item, but if i want to start it for all the items the problem comes.
I've tried with a loop over all the items but the animations start at different times (so visually is weird). Also, i've tried with an AnimationSet, but it moves the entire listview to the right instead the TextView (i can't launch the animationset from a single item because only moves that item then).
So.. anyone could help me?
Thanks
Upvotes: 0
Views: 2403
Reputation: 400
I am new to Android development but it sounds like you might want to look into writing a custom class that inherits from LayoutAnimationController
. In this subclass you would override the getDelayForView(android.view.View)
method. This way you could set the delay time to nothing and the specified animation should run on all of the items at the same time.
Like I said I am new to this Android party so I could be completely off, but from the way I understand it this sounds like the way to go.
Upvotes: 0
Reputation: 1006564
Use two Animation
objects, one for the CheckBox
, one for the TextView
. Configure each Animation
, and call startAnimation()
on each widget. The animations will run in parallel.
Upvotes: 1