Skip to content

Instantly share code, notes, and snippets.

@mmobin789
Last active May 28, 2020 00:17
Show Gist options
  • Save mmobin789/0ea8a9441aeccd611f59efde3d51feb0 to your computer and use it in GitHub Desktop.
Save mmobin789/0ea8a9441aeccd611f59efde3d51feb0 to your computer and use it in GitHub Desktop.
Shows use-cases for image loading using Pixel library.
// Loads an image without a placeholder.
Pixel.load("https://example.com/image.jpg", iv)
// Loads an image with a placeholder resource.
Pixel.load("https://example.com/image.jpg", iv3, PixelOptions.Builder().setPlaceholderResource(R.drawable.ic_loading_android).build())
// Loads an image of 30x30 pixels with a placeholder resource.
Pixel.load("https://example.com/image.jpg", holder.iv, PixelOptions.Builder().setPlaceholderResource(R.drawable.ic_loading_android)
.setImageSize(30, 30).build())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment