How can I identify objects in the resulting ArrayList of AnimatorSet.getChildAnimations()?

67 Views Asked by At

So I've got a method (method 1) that returns an AnimatorSet to another method (method 2). In method 2, I'd like to pick some of the Animator's inside the AnimatorSet, and use them independently of each other.

I found the .getChildAnimations() method, which should help me in some way, but unfortunately, I don't know how to work the ArrayList<Animator> properly. I tried using a .toString() on the items in the ArrayList, so I might be able to identify the Animators by title, but that returns android.animation.RevealAnimator@....., so basically nothing useful.

ArrayList<Animator> animatorList = animatorSet.getChildAnimations();
for (Animator a : animatorList) {
    Log.d(TAG, "show: "+a.toString());
}

result:

05-08 14:02:25.177 11044-11044/com.example.tim.timapp D/CStA: show: android.animation.RevealAnimator@17e554b
05-08 14:02:25.177 11044-11044/com.example.tim.timapp D/CStA: show: android.animation.RevealAnimator@3c95b28
05-08 14:02:25.177 11044-11044/com.example.tim.timapp D/CStA: show: android.animation.RevealAnimator@f723041

So, how can I identify Animators inside an AnimatorSet, so I can pick those that I need?

0

There are 0 best solutions below