FileDocCategorySizeDatePackage
AnimatorInflaterTest.javaAPI DocAndroid 5.1 API2169Thu Mar 12 22:22:12 GMT 2015android.animation

AnimatorInflaterTest

public class AnimatorInflaterTest extends android.test.ActivityInstrumentationTestCase2

Fields Summary
Set
identityHashes
Constructors Summary
public AnimatorInflaterTest()


      
        super(BasicAnimatorActivity.class);
    
Methods Summary
private voidassertUnique(java.lang.Object object)

        assertUnique(object, "");
    
private voidassertUnique(java.lang.Object object, java.lang.String msg)

        final int code = System.identityHashCode(object);
        assertTrue("object should be unique " + msg + ", obj:" + object, identityHashes.add(code));

    
public voidtestLoadStateListAnimator()

        StateListAnimator sla1 = AnimatorInflater.loadStateListAnimator(getActivity(),
                R.anim.test_state_anim);
        sla1.setTarget(getActivity().mAnimatingButton);
        StateListAnimator sla2 = AnimatorInflater.loadStateListAnimator(getActivity(),
                R.anim.test_state_anim);
        assertNull(sla2.getTarget());
        for (StateListAnimator sla : new StateListAnimator[]{sla1, sla2}) {
            assertUnique(sla);
            assertEquals(3, sla.getTuples().size());
            for (StateListAnimator.Tuple tuple : sla.getTuples()) {
                assertUnique(tuple);
                assertUnique(tuple.getAnimator());
            }
        }