HomeFragment.java 文件源码

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

项目:BookMySkills 作者:
private void setMarkerBounce(final Marker marker) {
    final Handler handler = new Handler();
    final long startTime = SystemClock.uptimeMillis();
    final long duration = 2000;
    final Interpolator interpolator = new BounceInterpolator();
    handler.post(new Runnable() {
        @Override
        public void run() {
            long elapsed = SystemClock.uptimeMillis() - startTime;
            float t = Math.max(
                    1 - interpolator.getInterpolation((float) elapsed
                            / duration), 0);
            marker.setAnchor(0.5f, 1.0f + t);

            if (t > 0.0) {
                handler.postDelayed(this, 16);
            } else {
                setMarkerBounce(marker);
            }
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号