DetailActivity.java 文件源码

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

项目:LittleFlickr 作者:
void startShowAnimation() {
    float toolBarYStart = mDetailToolBar.getTop();
    float toolBarYEnd = mDetailToolBar.getTop() - mDetailToolBar.getBottom();

    float floatingButtonYStart = mFloatingActionButton.getTop();
    float floatingButtonYEnd = mViewPager.getBottom();

    ObjectAnimator toolBarAnimator = ObjectAnimator
            .ofFloat(mDetailToolBar, "y", toolBarYEnd, toolBarYStart)
            .setDuration(500);
    toolBarAnimator.setInterpolator(new AccelerateInterpolator());

    ObjectAnimator floatingButtonAnimator = ObjectAnimator
            .ofFloat(mFloatingActionButton, "y", floatingButtonYEnd, floatingButtonYStart)
            .setDuration(500);
    floatingButtonAnimator.setInterpolator(new AccelerateInterpolator());

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet
            .play(toolBarAnimator)
            .before(floatingButtonAnimator);
    animatorSet.start();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号