StaggeredAnimationGroupTest.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:StaggeredAnimationGroup 作者:
@Test
public void preparePartialTransition_setsPartialInterpolator() {
    //given
    final StaggeredAnimationGroup spiedGroup = prepareSpiedGroup();
    final TimeInterpolator testInterpolator = new LinearOutSlowInInterpolator();
    final Transition spiedTransition = spy(new AutoTransition());
    final StaggeredAnimationGroup.PartialTransitionFactory factory =
            new StaggeredAnimationGroup.PartialTransitionFactory() {
                @Override
                public Transition createPartialTransition(boolean show, int viewId, int indexInTransition) {
                    return spiedTransition;
                }
            };
    spiedGroup.setPartialTransitionFactory(factory);
    spiedGroup.setPartialInterpolator(testInterpolator);

    //when
    spiedGroup.preparePartialTransition(true, 0, 0);

    //then
    verify(spiedTransition, times(1)).setInterpolator(testInterpolator);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号