逐步加圖片的Android控件:BlurImageView

jopen 9年前發布 | 9K 次閱讀 Android開發 移動開發 BlurImageView

BlurImageView For Android,你可以用它來逐步加你的圖就像Medium

How it works?

  1. First it will show user a blurry image;
  2. At the same time, it starts to load the real image;
  3. once loaded, replace the blurry one automatically.

Why I do this?

This lib is inspired by Medium and users love this way of loading pics, Because a beautiful Blurry pic is always better than a blank area or an ugly thumbnail.

How to use it?

    BlurImageView blurImageView = (BlurImageView) findViewById(R.id.XXX);
    blurImageView.setBlurImageByUrl(blurImageUrl);

This will load and blur a image.

BlurImageView fullBlurImageView = (BlurImageView) findViewById(R.id.XXX)
  fullBlurImageView.setFullImageByUrl(blurImageUrl, normalImageUrl);

This will load two images progressively.

blurImageView.setBlurFactor(blurFactor);

This can set the factor of blurry, default 8 - 10.

項目主頁:http://www.baiduhome.net/lib/view/home/1447423790600

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!