Skip to content

Instantly share code, notes, and snippets.

@CristianMG
Last active September 4, 2019 06:52
Show Gist options
  • Save CristianMG/6cfc08045bf17e976958b372a7a47c9d to your computer and use it in GitHub Desktop.
Save CristianMG/6cfc08045bf17e976958b372a7a47c9d to your computer and use it in GitHub Desktop.
Image loader from network use
// From resource
imageLoader.resource {
resource { backgroundDrawable }
}.loadBackground(actionButton)
//From network
imageLoader.network {
url { FAKE_IMAGE_URL }
error { PLACE_HOLDER_ID }
placeholder { PLACE_HOLDER_ID }
errorCallback { {} }
successCallback { { Assert.fail("The image loader must return an error") } }
}.load(imageView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment