SlidingFragments.java 文件源码

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

项目:DevCamp2014 作者:
/**
 * This method animates the image fragment into the background by both
 * scaling and rotating the fragment's view, as well as adding a
 * translucent dark hover view to inform the user that it is inactive.
 */
public void slideBack(AnimatorListener listener)
{
    View movingFragmentView = mImageFragment.getView();

    PropertyValuesHolder rotateX =  PropertyValuesHolder.ofFloat("rotationX", 40f);
    PropertyValuesHolder scaleX =  PropertyValuesHolder.ofFloat("scaleX", 0.8f);
    PropertyValuesHolder scaleY =  PropertyValuesHolder.ofFloat("scaleY", 0.8f);
    ObjectAnimator movingFragmentAnimator = ObjectAnimator.
            ofPropertyValuesHolder(movingFragmentView, rotateX, scaleX, scaleY);

    ObjectAnimator darkHoverViewAnimator = ObjectAnimator.
            ofFloat(mDarkHoverView, "alpha", 0.0f, 0.5f);

    ObjectAnimator movingFragmentRotator = ObjectAnimator.
            ofFloat(movingFragmentView, "rotationX", 0);
    movingFragmentRotator.setStartDelay(getResources().
            getInteger(R.integer.half_slide_up_down_duration));

    AnimatorSet s = new AnimatorSet();
    s.playTogether(movingFragmentAnimator, darkHoverViewAnimator, movingFragmentRotator);
    s.addListener(listener);
    s.start();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号