GenericDraweeHierarchy.java 文件源码

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

项目:GitHub 作者:
private void setProgress(float progress) {
  Drawable progressBarDrawable = mFadeDrawable.getDrawable(PROGRESS_BAR_IMAGE_INDEX);
  if (progressBarDrawable == null) {
    return;
  }

  // display progressbar when not fully loaded, hide otherwise
  if (progress >= 0.999f) {
    if (progressBarDrawable instanceof Animatable) {
      ((Animatable) progressBarDrawable).stop();
    }
    fadeOutLayer(PROGRESS_BAR_IMAGE_INDEX);
  } else {
    if (progressBarDrawable instanceof Animatable) {
      ((Animatable) progressBarDrawable).start();
    }
    fadeInLayer(PROGRESS_BAR_IMAGE_INDEX);
  }
  // set drawable level, scaled to [0, 10000] per drawable specification
  progressBarDrawable.setLevel(Math.round(progress * 10000));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号