Skip to content

Latest commit

 

History

History
46 lines (41 loc) · 1.11 KB

image_loader.md

File metadata and controls

46 lines (41 loc) · 1.11 KB

ImageLoader

中文文档

For loading images with free style(There are many third-party libraries can easily use to load image), we define ImageLoader interface, so you can use the way you like to load image.

Take Picasso for example:

ImageLoader imageLoader = new ImageLoader() {
  @Override
  public void loadAvatarImage(ImageView avatarImageView, String string) {
      Glide.with(mContext)
          .load(string)
          .centerCrop()
          .into(avatarImageView);
  }

  @Override
  public void loadImage(ImageView imageView, String string) {
      Picasso.with(mContext)
          .load(string)
          .into(imageView);
  }
};

or Glide:

ImageLoader imageLoader = new ImageLoader() {
  @Override
  public void loadAvatarImage(ImageView avatarImageView, String string) {
      Glide.with(mContext)
          .load(string)
          .centerCrop()
          .into(avatarImageView);
  }

  @Override
  public void loadImage(ImageView imageView, String string) {
      Glide.with(mContext)
          .load(string)
          .centerCrop()
          .into(imageView);
  }
};