DrawerLayoutContainer.java 文件源码

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

项目:airgram 作者:
public void closeDrawer(boolean fast) {
    cancelCurrentAnimation();
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playTogether(
            ObjectAnimator.ofFloat(this, "drawerPosition", 0)
    );
    animatorSet.setInterpolator(new DecelerateInterpolator());
    if (fast) {
        animatorSet.setDuration(Math.max((int) (200.0f / drawerLayout.getMeasuredWidth() * drawerPosition), 50));
    } else {
        animatorSet.setDuration(300);
    }
    animatorSet.addListener(new AnimatorListenerAdapterProxy() {
        @Override
        public void onAnimationEnd(Animator animator) {
            onDrawerAnimationEnd(false);
        }
    });
    animatorSet.start();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号